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 15 matching lines...) Expand all Loading... |
26 #include "webrtc/typedefs.h" | 26 #include "webrtc/typedefs.h" |
27 #include "webrtc/video/video_capture_input.h" | 27 #include "webrtc/video/video_capture_input.h" |
28 | 28 |
29 namespace webrtc { | 29 namespace webrtc { |
30 | 30 |
31 class BitrateAllocator; | 31 class BitrateAllocator; |
32 class BitrateObserver; | 32 class BitrateObserver; |
33 class Config; | 33 class Config; |
34 class CriticalSectionWrapper; | 34 class CriticalSectionWrapper; |
35 class EncodedImageCallback; | 35 class EncodedImageCallback; |
| 36 class OveruseFrameDetector; |
36 class PacedSender; | 37 class PacedSender; |
37 class PayloadRouter; | 38 class PayloadRouter; |
38 class ProcessThread; | 39 class ProcessThread; |
39 class QMVideoSettingsCallback; | 40 class QMVideoSettingsCallback; |
40 class SendStatisticsProxy; | 41 class SendStatisticsProxy; |
41 class ViEBitrateObserver; | 42 class ViEBitrateObserver; |
42 class ViEEffectFilter; | 43 class ViEEffectFilter; |
43 class VideoCodingModule; | 44 class VideoCodingModule; |
44 | 45 |
45 class ViEEncoder : public RtcpIntraFrameObserver, | 46 class ViEEncoder : public RtcpIntraFrameObserver, |
46 public VideoEncoderRateObserver, | 47 public VideoEncoderRateObserver, |
47 public VCMPacketizationCallback, | 48 public VCMPacketizationCallback, |
48 public VCMSendStatisticsCallback, | 49 public VCMSendStatisticsCallback, |
49 public VideoCaptureCallback { | 50 public VideoCaptureCallback { |
50 public: | 51 public: |
51 friend class ViEBitrateObserver; | 52 friend class ViEBitrateObserver; |
52 | 53 |
53 ViEEncoder(uint32_t number_of_cores, | 54 ViEEncoder(uint32_t number_of_cores, |
54 ProcessThread* module_process_thread, | 55 ProcessThread* module_process_thread, |
55 SendStatisticsProxy* stats_proxy, | 56 SendStatisticsProxy* stats_proxy, |
56 I420FrameCallback* pre_encode_callback, | 57 I420FrameCallback* pre_encode_callback, |
| 58 OveruseFrameDetector* overuse_detector, |
57 PacedSender* pacer, | 59 PacedSender* pacer, |
58 BitrateAllocator* bitrate_allocator); | 60 BitrateAllocator* bitrate_allocator); |
59 ~ViEEncoder(); | 61 ~ViEEncoder(); |
60 | 62 |
61 bool Init(); | 63 bool Init(); |
62 | 64 |
63 // This function is assumed to be called before any frames are delivered and | 65 // This function is assumed to be called before any frames are delivered and |
64 // only once. | 66 // only once. |
65 // Ideally this would be done in Init, but the dependencies between ViEEncoder | 67 // Ideally this would be done in Init, but the dependencies between ViEEncoder |
66 // and ViEChannel makes it really hard to do in a good way. | 68 // and ViEChannel makes it really hard to do in a good way. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 const rtc::scoped_ptr<VideoProcessing> vp_; | 158 const rtc::scoped_ptr<VideoProcessing> vp_; |
157 const rtc::scoped_ptr<QMVideoSettingsCallback> qm_callback_; | 159 const rtc::scoped_ptr<QMVideoSettingsCallback> qm_callback_; |
158 const rtc::scoped_ptr<VideoCodingModule> vcm_; | 160 const rtc::scoped_ptr<VideoCodingModule> vcm_; |
159 rtc::scoped_refptr<PayloadRouter> send_payload_router_; | 161 rtc::scoped_refptr<PayloadRouter> send_payload_router_; |
160 | 162 |
161 rtc::scoped_ptr<CriticalSectionWrapper> data_cs_; | 163 rtc::scoped_ptr<CriticalSectionWrapper> data_cs_; |
162 rtc::scoped_ptr<BitrateObserver> bitrate_observer_; | 164 rtc::scoped_ptr<BitrateObserver> bitrate_observer_; |
163 | 165 |
164 SendStatisticsProxy* const stats_proxy_; | 166 SendStatisticsProxy* const stats_proxy_; |
165 I420FrameCallback* const pre_encode_callback_; | 167 I420FrameCallback* const pre_encode_callback_; |
| 168 OveruseFrameDetector* const overuse_detector_; |
166 PacedSender* const pacer_; | 169 PacedSender* const pacer_; |
167 BitrateAllocator* const bitrate_allocator_; | 170 BitrateAllocator* const bitrate_allocator_; |
168 | 171 |
169 // The time we last received an input frame or encoded frame. This is used to | 172 // The time we last received an input frame or encoded frame. This is used to |
170 // track when video is stopped long enough that we also want to stop sending | 173 // track when video is stopped long enough that we also want to stop sending |
171 // padding. | 174 // padding. |
172 int64_t time_of_last_frame_activity_ms_ GUARDED_BY(data_cs_); | 175 int64_t time_of_last_frame_activity_ms_ GUARDED_BY(data_cs_); |
173 VideoCodec encoder_config_ GUARDED_BY(data_cs_); | 176 VideoCodec encoder_config_ GUARDED_BY(data_cs_); |
174 int min_transmit_bitrate_kbps_ GUARDED_BY(data_cs_); | 177 int min_transmit_bitrate_kbps_ GUARDED_BY(data_cs_); |
175 uint32_t last_observed_bitrate_bps_ GUARDED_BY(data_cs_); | 178 uint32_t last_observed_bitrate_bps_ GUARDED_BY(data_cs_); |
(...skipping 11 matching lines...) Expand all Loading... |
187 bool has_received_rpsi_ GUARDED_BY(data_cs_); | 190 bool has_received_rpsi_ GUARDED_BY(data_cs_); |
188 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); | 191 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); |
189 std::map<uint32_t, int> ssrc_streams_ GUARDED_BY(data_cs_); | 192 std::map<uint32_t, int> ssrc_streams_ GUARDED_BY(data_cs_); |
190 | 193 |
191 bool video_suspended_ GUARDED_BY(data_cs_); | 194 bool video_suspended_ GUARDED_BY(data_cs_); |
192 }; | 195 }; |
193 | 196 |
194 } // namespace webrtc | 197 } // namespace webrtc |
195 | 198 |
196 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 199 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
OLD | NEW |