Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: webrtc/video/video_send_stream.h

Issue 1441673002: Move BitrateAllocator from BitrateController logic to Call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ 11 #ifndef WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
12 #define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ 12 #define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
13 13
14 #include <map> 14 #include <map>
15 #include <vector> 15 #include <vector>
16 16
17 #include "webrtc/call.h" 17 #include "webrtc/call.h"
18 #include "webrtc/call/transport_adapter.h" 18 #include "webrtc/call/transport_adapter.h"
19 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 19 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
20 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 20 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
21 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" 21 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
22 #include "webrtc/video/encoded_frame_callback_adapter.h" 22 #include "webrtc/video/encoded_frame_callback_adapter.h"
23 #include "webrtc/video/send_statistics_proxy.h" 23 #include "webrtc/video/send_statistics_proxy.h"
24 #include "webrtc/video/video_capture_input.h" 24 #include "webrtc/video/video_capture_input.h"
25 #include "webrtc/video_receive_stream.h" 25 #include "webrtc/video_receive_stream.h"
26 #include "webrtc/video_send_stream.h" 26 #include "webrtc/video_send_stream.h"
27 27
28 namespace webrtc { 28 namespace webrtc {
29 29
30 class BitrateAllocator;
30 class CallStats; 31 class CallStats;
31 class CongestionController; 32 class CongestionController;
32 class EncoderStateFeedback; 33 class EncoderStateFeedback;
33 class ProcessThread; 34 class ProcessThread;
34 class ViEChannel; 35 class ViEChannel;
35 class ViEEncoder; 36 class ViEEncoder;
36 37
37 namespace internal { 38 namespace internal {
38 39
39 class VideoSendStream : public webrtc::VideoSendStream, 40 class VideoSendStream : public webrtc::VideoSendStream,
40 public webrtc::CpuOveruseObserver { 41 public webrtc::CpuOveruseObserver {
41 public: 42 public:
42 VideoSendStream(int num_cpu_cores, 43 VideoSendStream(int num_cpu_cores,
43 ProcessThread* module_process_thread, 44 ProcessThread* module_process_thread,
44 CallStats* call_stats, 45 CallStats* call_stats,
45 CongestionController* congestion_controller, 46 CongestionController* congestion_controller,
47 BitrateAllocator* bitrate_allocator,
46 const VideoSendStream::Config& config, 48 const VideoSendStream::Config& config,
47 const VideoEncoderConfig& encoder_config, 49 const VideoEncoderConfig& encoder_config,
48 const std::map<uint32_t, RtpState>& suspended_ssrcs); 50 const std::map<uint32_t, RtpState>& suspended_ssrcs);
49 51
50 ~VideoSendStream() override; 52 ~VideoSendStream() override;
51 53
52 // webrtc::SendStream implementation. 54 // webrtc::SendStream implementation.
53 void Start() override; 55 void Start() override;
54 void Stop() override; 56 void Stop() override;
55 void SignalNetworkState(NetworkState state) override; 57 void SignalNetworkState(NetworkState state) override;
56 bool DeliverRtcp(const uint8_t* packet, size_t length) override; 58 bool DeliverRtcp(const uint8_t* packet, size_t length) override;
57 59
58 // webrtc::VideoSendStream implementation. 60 // webrtc::VideoSendStream implementation.
59 VideoCaptureInput* Input() override; 61 VideoCaptureInput* Input() override;
60 bool ReconfigureVideoEncoder(const VideoEncoderConfig& config) override; 62 bool ReconfigureVideoEncoder(const VideoEncoderConfig& config) override;
61 Stats GetStats() override; 63 Stats GetStats() override;
62 64
63 // webrtc::CpuOveruseObserver implementation. 65 // webrtc::CpuOveruseObserver implementation.
64 void OveruseDetected() override; 66 void OveruseDetected() override;
65 void NormalUsage() override; 67 void NormalUsage() override;
66 68
67 typedef std::map<uint32_t, RtpState> RtpStateMap; 69 typedef std::map<uint32_t, RtpState> RtpStateMap;
68 RtpStateMap GetRtpStates() const; 70 RtpStateMap GetRtpStates() const;
69 71
70 int64_t GetRtt() const; 72 int64_t GetRtt() const;
73 int GetPaddingNeededBps() const;
71 74
72 private: 75 private:
73 bool SetSendCodec(VideoCodec video_codec); 76 bool SetSendCodec(VideoCodec video_codec);
74 void ConfigureSsrcs(); 77 void ConfigureSsrcs();
75 78
76 SendStatisticsProxy stats_proxy_; 79 SendStatisticsProxy stats_proxy_;
77 TransportAdapter transport_adapter_; 80 TransportAdapter transport_adapter_;
78 EncodedFrameCallbackAdapter encoded_frame_proxy_; 81 EncodedFrameCallbackAdapter encoded_frame_proxy_;
79 const VideoSendStream::Config config_; 82 const VideoSendStream::Config config_;
80 VideoEncoderConfig encoder_config_; 83 VideoEncoderConfig encoder_config_;
(...skipping 10 matching lines...) Expand all
91 94
92 // Used as a workaround to indicate that we should be using the configured 95 // Used as a workaround to indicate that we should be using the configured
93 // start bitrate initially, instead of the one reported by VideoEngine (which 96 // start bitrate initially, instead of the one reported by VideoEngine (which
94 // defaults to too high). 97 // defaults to too high).
95 bool use_config_bitrate_; 98 bool use_config_bitrate_;
96 }; 99 };
97 } // namespace internal 100 } // namespace internal
98 } // namespace webrtc 101 } // namespace webrtc
99 102
100 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ 103 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698