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" |
24 #include "webrtc/common_video/rotation.h" | 25 #include "webrtc/common_video/rotation.h" |
25 #include "webrtc/media/base/videosinkinterface.h" | 26 #include "webrtc/media/base/videosinkinterface.h" |
26 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 27 #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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 SendStatisticsProxy* const stats_proxy_; | 163 SendStatisticsProxy* const stats_proxy_; |
164 rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_; | 164 rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_; |
165 ProcessThread* module_process_thread_; | 165 ProcessThread* module_process_thread_; |
166 rtc::ThreadChecker module_process_thread_checker_; | 166 rtc::ThreadChecker module_process_thread_checker_; |
167 // |thread_checker_| checks that public methods that are related to lifetime | 167 // |thread_checker_| checks that public methods that are related to lifetime |
168 // of ViEEncoder are called on the same thread. | 168 // of ViEEncoder are called on the same thread. |
169 rtc::ThreadChecker thread_checker_; | 169 rtc::ThreadChecker thread_checker_; |
170 | 170 |
171 VideoEncoderConfig encoder_config_ ACCESS_ON(&encoder_queue_); | 171 VideoEncoderConfig encoder_config_ ACCESS_ON(&encoder_queue_); |
172 // TODO(sprang): Change |rate_allocator_| to be a codec type | 172 std::unique_ptr<VideoBitrateAllocator> rate_allocator_ |
173 // agnostic interface. It is currently VP8 simulcast specific if more than | |
174 // one layer is specified. | |
175 std::unique_ptr<SimulcastRateAllocator> rate_allocator_ | |
176 ACCESS_ON(&encoder_queue_); | 173 ACCESS_ON(&encoder_queue_); |
177 | 174 |
178 // Set when ConfigureEncoder has been called in order to lazy reconfigure the | 175 // Set when ConfigureEncoder has been called in order to lazy reconfigure the |
179 // encoder on the next frame. | 176 // encoder on the next frame. |
180 bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_); | 177 bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_); |
181 rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_); | 178 rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_); |
182 uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); | 179 uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
183 size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_); | 180 size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_); |
184 uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_); | 181 uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
185 bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_); | 182 bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_); |
(...skipping 17 matching lines...) Expand all Loading... |
203 // All public methods are proxied to |encoder_queue_|. It must must be | 200 // All public methods are proxied to |encoder_queue_|. It must must be |
204 // destroyed first to make sure no tasks are run that use other members. | 201 // destroyed first to make sure no tasks are run that use other members. |
205 rtc::TaskQueue encoder_queue_; | 202 rtc::TaskQueue encoder_queue_; |
206 | 203 |
207 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); | 204 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); |
208 }; | 205 }; |
209 | 206 |
210 } // namespace webrtc | 207 } // namespace webrtc |
211 | 208 |
212 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 209 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
OLD | NEW |