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

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

Issue 1993113003: Refactor how padding is calculated. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed review comments. Created 4 years, 6 months 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
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/video_send_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 namespace vcm { 45 namespace vcm {
46 class VideoSender; 46 class VideoSender;
47 } // namespace vcm 47 } // namespace vcm
48 48
49 namespace internal { 49 namespace internal {
50 50
51 class VideoSendStream : public webrtc::VideoSendStream, 51 class VideoSendStream : public webrtc::VideoSendStream,
52 public webrtc::CpuOveruseObserver, 52 public webrtc::CpuOveruseObserver,
53 public webrtc::BitrateAllocatorObserver, 53 public webrtc::BitrateAllocatorObserver,
54 public webrtc::VCMProtectionCallback, 54 public webrtc::VCMProtectionCallback,
55 protected webrtc::EncodedImageCallback { 55 public EncodedImageCallback {
56 public: 56 public:
57 VideoSendStream(int num_cpu_cores, 57 VideoSendStream(int num_cpu_cores,
58 ProcessThread* module_process_thread, 58 ProcessThread* module_process_thread,
59 CallStats* call_stats, 59 CallStats* call_stats,
60 CongestionController* congestion_controller, 60 CongestionController* congestion_controller,
61 BitrateAllocator* bitrate_allocator, 61 BitrateAllocator* bitrate_allocator,
62 SendDelayStats* send_delay_stats, 62 SendDelayStats* send_delay_stats,
63 VieRemb* remb, 63 VieRemb* remb,
64 RtcEventLog* event_log, 64 RtcEventLog* event_log,
65 const VideoSendStream::Config& config, 65 const VideoSendStream::Config& config,
(...skipping 30 matching lines...) Expand all
96 // Implements webrtc::VCMProtectionCallback. 96 // Implements webrtc::VCMProtectionCallback.
97 int ProtectionRequest(const FecProtectionParams* delta_params, 97 int ProtectionRequest(const FecProtectionParams* delta_params,
98 const FecProtectionParams* key_params, 98 const FecProtectionParams* key_params,
99 uint32_t* sent_video_rate_bps, 99 uint32_t* sent_video_rate_bps,
100 uint32_t* sent_nack_rate_bps, 100 uint32_t* sent_nack_rate_bps,
101 uint32_t* sent_fec_rate_bps) override; 101 uint32_t* sent_fec_rate_bps) override;
102 102
103 private: 103 private:
104 struct EncoderSettings { 104 struct EncoderSettings {
105 VideoCodec video_codec; 105 VideoCodec video_codec;
106 int min_transmit_bitrate_bps; 106 VideoEncoderConfig config;
107 std::vector<VideoStream> streams;
108 }; 107 };
109 108
110 // Implements EncodedImageCallback. The implementation routes encoded frames 109 // Implements EncodedImageCallback. The implementation routes encoded frames
111 // to the |payload_router_| and |config.pre_encode_callback| if set. 110 // to the |payload_router_| and |config.pre_encode_callback| if set.
112 // Called on an arbitrary encoder callback thread. 111 // Called on an arbitrary encoder callback thread.
113 int32_t Encoded(const EncodedImage& encoded_image, 112 int32_t Encoded(const EncodedImage& encoded_image,
114 const CodecSpecificInfo* codec_specific_info, 113 const CodecSpecificInfo* codec_specific_info,
115 const RTPFragmentationHeader* fragmentation) override; 114 const RTPFragmentationHeader* fragmentation) override;
116 115
117 static bool EncoderThreadFunction(void* obj); 116 static bool EncoderThreadFunction(void* obj);
(...skipping 14 matching lines...) Expand all
132 VieRemb* const remb_; 131 VieRemb* const remb_;
133 132
134 static const bool kEnableFrameRecording = false; 133 static const bool kEnableFrameRecording = false;
135 static const int kMaxLayers = 3; 134 static const int kMaxLayers = 3;
136 std::unique_ptr<IvfFileWriter> file_writers_[kMaxLayers]; 135 std::unique_ptr<IvfFileWriter> file_writers_[kMaxLayers];
137 136
138 rtc::PlatformThread encoder_thread_; 137 rtc::PlatformThread encoder_thread_;
139 rtc::Event encoder_wakeup_event_; 138 rtc::Event encoder_wakeup_event_;
140 volatile int stop_encoder_thread_; 139 volatile int stop_encoder_thread_;
141 rtc::CriticalSection encoder_settings_crit_; 140 rtc::CriticalSection encoder_settings_crit_;
142 rtc::Optional<EncoderSettings> pending_encoder_settings_ 141 std::unique_ptr<EncoderSettings> pending_encoder_settings_
143 GUARDED_BY(encoder_settings_crit_); 142 GUARDED_BY(encoder_settings_crit_);
143 // Only used on the encoder thread.
144 bool send_stream_registered_as_observer_;
145 std::unique_ptr<EncoderSettings> current_encoder_settings_;
144 146
145 OveruseFrameDetector overuse_detector_; 147 OveruseFrameDetector overuse_detector_;
146 ViEEncoder vie_encoder_; 148 ViEEncoder vie_encoder_;
147 EncoderStateFeedback encoder_feedback_; 149 EncoderStateFeedback encoder_feedback_;
148 ProtectionBitrateCalculator protection_bitrate_calculator_; 150 ProtectionBitrateCalculator protection_bitrate_calculator_;
149 151
150 vcm::VideoSender* const video_sender_; 152 vcm::VideoSender* const video_sender_;
151 153
152 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; 154 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_;
153 // RtpRtcp modules, declared here as they use other members on construction. 155 // RtpRtcp modules, declared here as they use other members on construction.
154 const std::vector<RtpRtcp*> rtp_rtcp_modules_; 156 const std::vector<RtpRtcp*> rtp_rtcp_modules_;
155 PayloadRouter payload_router_; 157 PayloadRouter payload_router_;
156 VideoCaptureInput input_; 158 VideoCaptureInput input_;
157 }; 159 };
158 } // namespace internal 160 } // namespace internal
159 } // namespace webrtc 161 } // namespace webrtc
160 162
161 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ 163 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
OLDNEW
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/video_send_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698