OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 VideoRotation rotation; | 143 VideoRotation rotation; |
144 bool is_texture; | 144 bool is_texture; |
145 int pixel_count() const { return width * height; } | 145 int pixel_count() const { return width * height; } |
146 }; | 146 }; |
147 | 147 |
148 void ConfigureEncoderOnTaskQueue(VideoEncoderConfig config, | 148 void ConfigureEncoderOnTaskQueue(VideoEncoderConfig config, |
149 size_t max_data_payload_length, | 149 size_t max_data_payload_length, |
150 bool nack_enabled); | 150 bool nack_enabled); |
151 void ReconfigureEncoder(); | 151 void ReconfigureEncoder(); |
152 | 152 |
153 void ConfigureQualityScaler(); | |
154 | |
155 // Implements VideoSinkInterface. | 153 // Implements VideoSinkInterface. |
156 void OnFrame(const VideoFrame& video_frame) override; | 154 void OnFrame(const VideoFrame& video_frame) override; |
157 | 155 |
158 // Implements VideoSendStatisticsCallback. | 156 // Implements VideoSendStatisticsCallback. |
159 void SendStatistics(uint32_t bit_rate, | 157 void SendStatistics(uint32_t bit_rate, |
160 uint32_t frame_rate) override; | 158 uint32_t frame_rate) override; |
161 | 159 |
162 void EncodeVideoFrame(const VideoFrame& frame, | 160 void EncodeVideoFrame(const VideoFrame& frame, |
163 int64_t time_when_posted_in_ms); | 161 int64_t time_when_posted_in_ms); |
164 | 162 |
165 // Implements EncodedImageCallback. | 163 // Implements EncodedImageCallback. |
166 EncodedImageCallback::Result OnEncodedImage( | 164 EncodedImageCallback::Result OnEncodedImage( |
167 const EncodedImage& encoded_image, | 165 const EncodedImage& encoded_image, |
168 const CodecSpecificInfo* codec_specific_info, | 166 const CodecSpecificInfo* codec_specific_info, |
169 const RTPFragmentationHeader* fragmentation) override; | 167 const RTPFragmentationHeader* fragmentation) override; |
170 | 168 |
171 void OnDroppedFrame() override; | 169 void OnDroppedFrame() override; |
172 | 170 |
173 bool EncoderPaused() const; | 171 bool EncoderPaused() const; |
174 void TraceFrameDropStart(); | 172 void TraceFrameDropStart(); |
175 void TraceFrameDropEnd(); | 173 void TraceFrameDropEnd(); |
176 | 174 |
177 rtc::Event shutdown_event_; | 175 rtc::Event shutdown_event_; |
178 | 176 |
179 const uint32_t number_of_cores_; | 177 const uint32_t number_of_cores_; |
180 // Counts how many frames we've dropped in the initial rampup phase. | |
181 int initial_rampup_; | |
182 | 178 |
183 const std::unique_ptr<VideoSourceProxy> source_proxy_; | 179 const std::unique_ptr<VideoSourceProxy> source_proxy_; |
184 EncoderSink* sink_; | 180 EncoderSink* sink_; |
185 const VideoSendStream::Config::EncoderSettings settings_; | 181 const VideoSendStream::Config::EncoderSettings settings_; |
186 const VideoCodecType codec_type_; | 182 const VideoCodecType codec_type_; |
187 | 183 |
188 vcm::VideoSender video_sender_ ACCESS_ON(&encoder_queue_); | 184 vcm::VideoSender video_sender_ ACCESS_ON(&encoder_queue_); |
189 OveruseFrameDetector overuse_detector_ ACCESS_ON(&encoder_queue_); | 185 OveruseFrameDetector overuse_detector_ ACCESS_ON(&encoder_queue_); |
190 std::unique_ptr<QualityScaler> quality_scaler_ ACCESS_ON(&encoder_queue_); | 186 std::unique_ptr<QualityScaler> quality_scaler_ ACCESS_ON(&encoder_queue_); |
191 | 187 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // All public methods are proxied to |encoder_queue_|. It must must be | 240 // All public methods are proxied to |encoder_queue_|. It must must be |
245 // destroyed first to make sure no tasks are run that use other members. | 241 // destroyed first to make sure no tasks are run that use other members. |
246 rtc::TaskQueue encoder_queue_; | 242 rtc::TaskQueue encoder_queue_; |
247 | 243 |
248 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); | 244 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); |
249 }; | 245 }; |
250 | 246 |
251 } // namespace webrtc | 247 } // namespace webrtc |
252 | 248 |
253 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 249 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
OLD | NEW |