| 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 <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "webrtc/base/criticalsection.h" | 17 #include "webrtc/base/criticalsection.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/media/base/videosinkinterface.h" |
| 22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 23 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 23 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
| 24 #include "webrtc/modules/video_processing/include/video_processing.h" | 24 #include "webrtc/modules/video_processing/include/video_processing.h" |
| 25 #include "webrtc/typedefs.h" | 25 #include "webrtc/typedefs.h" |
| 26 | 26 |
| 27 namespace webrtc { | 27 namespace webrtc { |
| 28 | 28 |
| 29 class Config; | 29 class Config; |
| 30 class EncodedImageCallback; | 30 class EncodedImageCallback; |
| 31 class OveruseFrameDetector; | 31 class OveruseFrameDetector; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 42 class ViEEncoder : public VideoEncoderRateObserver, | 42 class ViEEncoder : public VideoEncoderRateObserver, |
| 43 public VCMPacketizationCallback, | 43 public VCMPacketizationCallback, |
| 44 public VCMSendStatisticsCallback { | 44 public VCMSendStatisticsCallback { |
| 45 public: | 45 public: |
| 46 friend class ViEBitrateObserver; | 46 friend class ViEBitrateObserver; |
| 47 | 47 |
| 48 ViEEncoder(uint32_t number_of_cores, | 48 ViEEncoder(uint32_t number_of_cores, |
| 49 const std::vector<uint32_t>& ssrcs, | 49 const std::vector<uint32_t>& ssrcs, |
| 50 ProcessThread* module_process_thread, | 50 ProcessThread* module_process_thread, |
| 51 SendStatisticsProxy* stats_proxy, | 51 SendStatisticsProxy* stats_proxy, |
| 52 I420FrameCallback* pre_encode_callback, | 52 // TODO(nisse): Used only for tests, delete? |
| 53 rtc::VideoSinkInterface<VideoFrame>* pre_encode_callback, |
| 53 OveruseFrameDetector* overuse_detector, | 54 OveruseFrameDetector* overuse_detector, |
| 54 PacedSender* pacer, | 55 PacedSender* pacer, |
| 55 PayloadRouter* payload_router); | 56 PayloadRouter* payload_router); |
| 56 ~ViEEncoder(); | 57 ~ViEEncoder(); |
| 57 | 58 |
| 58 bool Init(); | 59 bool Init(); |
| 59 | 60 |
| 60 VideoCodingModule* vcm() const; | 61 VideoCodingModule* vcm() const; |
| 61 | 62 |
| 62 void SetNetworkTransmissionState(bool is_transmitting); | 63 void SetNetworkTransmissionState(bool is_transmitting); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 const uint32_t number_of_cores_; | 124 const uint32_t number_of_cores_; |
| 124 const std::vector<uint32_t> ssrcs_; | 125 const std::vector<uint32_t> ssrcs_; |
| 125 | 126 |
| 126 const std::unique_ptr<VideoProcessing> vp_; | 127 const std::unique_ptr<VideoProcessing> vp_; |
| 127 const std::unique_ptr<QMVideoSettingsCallback> qm_callback_; | 128 const std::unique_ptr<QMVideoSettingsCallback> qm_callback_; |
| 128 const std::unique_ptr<VideoCodingModule> vcm_; | 129 const std::unique_ptr<VideoCodingModule> vcm_; |
| 129 | 130 |
| 130 rtc::CriticalSection data_cs_; | 131 rtc::CriticalSection data_cs_; |
| 131 | 132 |
| 132 SendStatisticsProxy* const stats_proxy_; | 133 SendStatisticsProxy* const stats_proxy_; |
| 133 I420FrameCallback* const pre_encode_callback_; | 134 rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_; |
| 134 OveruseFrameDetector* const overuse_detector_; | 135 OveruseFrameDetector* const overuse_detector_; |
| 135 PacedSender* const pacer_; | 136 PacedSender* const pacer_; |
| 136 PayloadRouter* const send_payload_router_; | 137 PayloadRouter* const send_payload_router_; |
| 137 | 138 |
| 138 // The time we last received an input frame or encoded frame. This is used to | 139 // The time we last received an input frame or encoded frame. This is used to |
| 139 // track when video is stopped long enough that we also want to stop sending | 140 // track when video is stopped long enough that we also want to stop sending |
| 140 // padding. | 141 // padding. |
| 141 int64_t time_of_last_frame_activity_ms_ GUARDED_BY(data_cs_); | 142 int64_t time_of_last_frame_activity_ms_ GUARDED_BY(data_cs_); |
| 142 VideoCodec encoder_config_ GUARDED_BY(data_cs_); | 143 VideoCodec encoder_config_ GUARDED_BY(data_cs_); |
| 143 int min_transmit_bitrate_bps_ GUARDED_BY(data_cs_); | 144 int min_transmit_bitrate_bps_ GUARDED_BY(data_cs_); |
| 144 uint32_t last_observed_bitrate_bps_ GUARDED_BY(data_cs_); | 145 uint32_t last_observed_bitrate_bps_ GUARDED_BY(data_cs_); |
| 145 bool network_is_transmitting_ GUARDED_BY(data_cs_); | 146 bool network_is_transmitting_ GUARDED_BY(data_cs_); |
| 146 bool encoder_paused_ GUARDED_BY(data_cs_); | 147 bool encoder_paused_ GUARDED_BY(data_cs_); |
| 147 bool encoder_paused_and_dropped_frame_ GUARDED_BY(data_cs_); | 148 bool encoder_paused_and_dropped_frame_ GUARDED_BY(data_cs_); |
| 148 std::vector<int64_t> time_last_intra_request_ms_ GUARDED_BY(data_cs_); | 149 std::vector<int64_t> time_last_intra_request_ms_ GUARDED_BY(data_cs_); |
| 149 | 150 |
| 150 ProcessThread* module_process_thread_; | 151 ProcessThread* module_process_thread_; |
| 151 | 152 |
| 152 bool has_received_sli_ GUARDED_BY(data_cs_); | 153 bool has_received_sli_ GUARDED_BY(data_cs_); |
| 153 uint8_t picture_id_sli_ GUARDED_BY(data_cs_); | 154 uint8_t picture_id_sli_ GUARDED_BY(data_cs_); |
| 154 bool has_received_rpsi_ GUARDED_BY(data_cs_); | 155 bool has_received_rpsi_ GUARDED_BY(data_cs_); |
| 155 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); | 156 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); |
| 156 | 157 |
| 157 bool video_suspended_ GUARDED_BY(data_cs_); | 158 bool video_suspended_ GUARDED_BY(data_cs_); |
| 158 }; | 159 }; |
| 159 | 160 |
| 160 } // namespace webrtc | 161 } // namespace webrtc |
| 161 | 162 |
| 162 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 163 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
| OLD | NEW |