| 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_ENGINE_VIE_ENCODER_H_ | 11 #ifndef WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ |
| 12 #define WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ | 12 #define WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "webrtc/base/scoped_ptr.h" | 17 #include "webrtc/base/scoped_ptr.h" |
| 18 #include "webrtc/base/scoped_ref_ptr.h" | 18 #include "webrtc/base/scoped_ref_ptr.h" |
| 19 #include "webrtc/base/thread_annotations.h" | 19 #include "webrtc/base/thread_annotations.h" |
| 20 #include "webrtc/common_types.h" | 20 #include "webrtc/common_types.h" |
| 21 #include "webrtc/frame_callback.h" | 21 #include "webrtc/frame_callback.h" |
| 22 #include "webrtc/modules/bitrate_controller/include/bitrate_allocator.h" | 22 #include "webrtc/modules/bitrate_controller/include/bitrate_allocator.h" |
| 23 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | |
| 24 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" | 23 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" |
| 25 #include "webrtc/modules/video_coding/main/interface/video_coding_defines.h" | 24 #include "webrtc/modules/video_coding/main/interface/video_coding_defines.h" |
| 26 #include "webrtc/modules/video_processing/main/interface/video_processing.h" | 25 #include "webrtc/modules/video_processing/main/interface/video_processing.h" |
| 27 #include "webrtc/typedefs.h" | 26 #include "webrtc/typedefs.h" |
| 28 #include "webrtc/video/video_capture_input.h" | 27 #include "webrtc/video/video_capture_input.h" |
| 29 #include "webrtc/video_engine/vie_defines.h" | 28 #include "webrtc/video_engine/vie_defines.h" |
| 30 | 29 |
| 31 namespace webrtc { | 30 namespace webrtc { |
| 32 | 31 |
| 33 class Config; | 32 class Config; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 public VCMPacketizationCallback, | 67 public VCMPacketizationCallback, |
| 69 public VCMSendStatisticsCallback, | 68 public VCMSendStatisticsCallback, |
| 70 public VideoCaptureCallback { | 69 public VideoCaptureCallback { |
| 71 public: | 70 public: |
| 72 friend class ViEBitrateObserver; | 71 friend class ViEBitrateObserver; |
| 73 | 72 |
| 74 ViEEncoder(int32_t channel_id, | 73 ViEEncoder(int32_t channel_id, |
| 75 uint32_t number_of_cores, | 74 uint32_t number_of_cores, |
| 76 ProcessThread& module_process_thread, | 75 ProcessThread& module_process_thread, |
| 77 PacedSender* pacer, | 76 PacedSender* pacer, |
| 78 BitrateAllocator* bitrate_allocator, | 77 BitrateAllocator* bitrate_allocator); |
| 79 BitrateController* bitrate_controller); | |
| 80 ~ViEEncoder(); | 78 ~ViEEncoder(); |
| 81 | 79 |
| 82 bool Init(); | 80 bool Init(); |
| 83 | 81 |
| 84 // This function is assumed to be called before any frames are delivered and | 82 // This function is assumed to be called before any frames are delivered and |
| 85 // only once. | 83 // only once. |
| 86 // Ideally this would be done in Init, but the dependencies between ViEEncoder | 84 // Ideally this would be done in Init, but the dependencies between ViEEncoder |
| 87 // and ViEChannel makes it really hard to do in a good way. | 85 // and ViEChannel makes it really hard to do in a good way. |
| 88 void StartThreadsAndSetSharedMembers( | 86 void StartThreadsAndSetSharedMembers( |
| 89 rtc::scoped_refptr<PayloadRouter> send_payload_router, | 87 rtc::scoped_refptr<PayloadRouter> send_payload_router, |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 const rtc::scoped_ptr<QMVideoSettingsCallback> qm_callback_; | 195 const rtc::scoped_ptr<QMVideoSettingsCallback> qm_callback_; |
| 198 const rtc::scoped_ptr<VideoCodingModule> vcm_; | 196 const rtc::scoped_ptr<VideoCodingModule> vcm_; |
| 199 rtc::scoped_refptr<PayloadRouter> send_payload_router_; | 197 rtc::scoped_refptr<PayloadRouter> send_payload_router_; |
| 200 | 198 |
| 201 rtc::scoped_ptr<CriticalSectionWrapper> callback_cs_; | 199 rtc::scoped_ptr<CriticalSectionWrapper> callback_cs_; |
| 202 rtc::scoped_ptr<CriticalSectionWrapper> data_cs_; | 200 rtc::scoped_ptr<CriticalSectionWrapper> data_cs_; |
| 203 rtc::scoped_ptr<BitrateObserver> bitrate_observer_; | 201 rtc::scoped_ptr<BitrateObserver> bitrate_observer_; |
| 204 | 202 |
| 205 PacedSender* const pacer_; | 203 PacedSender* const pacer_; |
| 206 BitrateAllocator* const bitrate_allocator_; | 204 BitrateAllocator* const bitrate_allocator_; |
| 207 BitrateController* const bitrate_controller_; | |
| 208 | 205 |
| 209 // The time we last received an input frame or encoded frame. This is used to | 206 // The time we last received an input frame or encoded frame. This is used to |
| 210 // track when video is stopped long enough that we also want to stop sending | 207 // track when video is stopped long enough that we also want to stop sending |
| 211 // padding. | 208 // padding. |
| 212 int64_t time_of_last_frame_activity_ms_ GUARDED_BY(data_cs_); | 209 int64_t time_of_last_frame_activity_ms_ GUARDED_BY(data_cs_); |
| 213 bool simulcast_enabled_ GUARDED_BY(data_cs_); | 210 bool simulcast_enabled_ GUARDED_BY(data_cs_); |
| 214 int min_transmit_bitrate_kbps_ GUARDED_BY(data_cs_); | 211 int min_transmit_bitrate_kbps_ GUARDED_BY(data_cs_); |
| 215 uint32_t last_observed_bitrate_bps_ GUARDED_BY(data_cs_); | 212 uint32_t last_observed_bitrate_bps_ GUARDED_BY(data_cs_); |
| 216 int target_delay_ms_ GUARDED_BY(data_cs_); | 213 int target_delay_ms_ GUARDED_BY(data_cs_); |
| 217 bool network_is_transmitting_ GUARDED_BY(data_cs_); | 214 bool network_is_transmitting_ GUARDED_BY(data_cs_); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 235 bool video_suspended_ GUARDED_BY(data_cs_); | 232 bool video_suspended_ GUARDED_BY(data_cs_); |
| 236 I420FrameCallback* pre_encode_callback_ GUARDED_BY(callback_cs_); | 233 I420FrameCallback* pre_encode_callback_ GUARDED_BY(callback_cs_); |
| 237 const int64_t start_ms_; | 234 const int64_t start_ms_; |
| 238 | 235 |
| 239 SendStatisticsProxy* send_statistics_proxy_ GUARDED_BY(callback_cs_); | 236 SendStatisticsProxy* send_statistics_proxy_ GUARDED_BY(callback_cs_); |
| 240 }; | 237 }; |
| 241 | 238 |
| 242 } // namespace webrtc | 239 } // namespace webrtc |
| 243 | 240 |
| 244 #endif // WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ | 241 #endif // WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ |
| OLD | NEW |