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 |
11 #ifndef WEBRTC_VIDEO_VIE_ENCODER_H_ | 11 #ifndef WEBRTC_VIDEO_VIE_ENCODER_H_ |
12 #define WEBRTC_VIDEO_VIE_ENCODER_H_ | 12 #define WEBRTC_VIDEO_VIE_ENCODER_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/base/criticalsection.h" | 18 #include "webrtc/base/criticalsection.h" |
19 #include "webrtc/base/event.h" | 19 #include "webrtc/base/event.h" |
20 #include "webrtc/base/sequenced_task_checker.h" | 20 #include "webrtc/base/sequenced_task_checker.h" |
21 #include "webrtc/base/task_queue.h" | 21 #include "webrtc/base/task_queue.h" |
22 #include "webrtc/call.h" | 22 #include "webrtc/call.h" |
23 #include "webrtc/common_types.h" | 23 #include "webrtc/common_types.h" |
24 #include "webrtc/common_video/include/video_bitrate_allocator.h" | |
25 #include "webrtc/common_video/rotation.h" | 24 #include "webrtc/common_video/rotation.h" |
26 #include "webrtc/media/base/videosinkinterface.h" | 25 #include "webrtc/media/base/videosinkinterface.h" |
27 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 26 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
| 27 #include "webrtc/modules/video_coding/utility/simulcast_rate_allocator.h" |
28 #include "webrtc/modules/video_coding/video_coding_impl.h" | 28 #include "webrtc/modules/video_coding/video_coding_impl.h" |
29 #include "webrtc/modules/video_processing/include/video_processing.h" | 29 #include "webrtc/modules/video_processing/include/video_processing.h" |
30 #include "webrtc/system_wrappers/include/atomic32.h" | 30 #include "webrtc/system_wrappers/include/atomic32.h" |
31 #include "webrtc/video/overuse_frame_detector.h" | 31 #include "webrtc/video/overuse_frame_detector.h" |
32 #include "webrtc/video_encoder.h" | 32 #include "webrtc/video_encoder.h" |
33 #include "webrtc/video_send_stream.h" | 33 #include "webrtc/video_send_stream.h" |
34 #include "webrtc/typedefs.h" | 34 #include "webrtc/typedefs.h" |
35 | 35 |
36 namespace webrtc { | 36 namespace webrtc { |
37 | 37 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 SendStatisticsProxy* const stats_proxy_; | 178 SendStatisticsProxy* const stats_proxy_; |
179 rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_; | 179 rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_; |
180 ProcessThread* module_process_thread_; | 180 ProcessThread* module_process_thread_; |
181 rtc::ThreadChecker module_process_thread_checker_; | 181 rtc::ThreadChecker module_process_thread_checker_; |
182 // |thread_checker_| checks that public methods that are related to lifetime | 182 // |thread_checker_| checks that public methods that are related to lifetime |
183 // of ViEEncoder are called on the same thread. | 183 // of ViEEncoder are called on the same thread. |
184 rtc::ThreadChecker thread_checker_; | 184 rtc::ThreadChecker thread_checker_; |
185 | 185 |
186 VideoEncoderConfig encoder_config_ ACCESS_ON(&encoder_queue_); | 186 VideoEncoderConfig encoder_config_ ACCESS_ON(&encoder_queue_); |
187 std::unique_ptr<VideoBitrateAllocator> rate_allocator_ | 187 // TODO(sprang): Change |rate_allocator_| to be a codec type |
| 188 // agnostic interface. It is currently VP8 simulcast specific if more than |
| 189 // one layer is specified. |
| 190 std::unique_ptr<SimulcastRateAllocator> rate_allocator_ |
188 ACCESS_ON(&encoder_queue_); | 191 ACCESS_ON(&encoder_queue_); |
189 | 192 |
190 // Set when ConfigureEncoder has been called in order to lazy reconfigure the | 193 // Set when ConfigureEncoder has been called in order to lazy reconfigure the |
191 // encoder on the next frame. | 194 // encoder on the next frame. |
192 bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_); | 195 bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_); |
193 rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_); | 196 rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_); |
194 uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); | 197 uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
195 size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_); | 198 size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_); |
196 uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_); | 199 uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
197 bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_); | 200 bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 // All public methods are proxied to |encoder_queue_|. It must must be | 232 // All public methods are proxied to |encoder_queue_|. It must must be |
230 // destroyed first to make sure no tasks are run that use other members. | 233 // destroyed first to make sure no tasks are run that use other members. |
231 rtc::TaskQueue encoder_queue_; | 234 rtc::TaskQueue encoder_queue_; |
232 | 235 |
233 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); | 236 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); |
234 }; | 237 }; |
235 | 238 |
236 } // namespace webrtc | 239 } // namespace webrtc |
237 | 240 |
238 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 241 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
OLD | NEW |