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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 private: | 94 private: |
95 class EncodeTask; | 95 class EncodeTask; |
96 | 96 |
97 void ConfigureEncoderInternal(const VideoCodec& video_codec, | 97 void ConfigureEncoderInternal(const VideoCodec& video_codec, |
98 size_t max_data_payload_length); | 98 size_t max_data_payload_length); |
99 | 99 |
100 // Implements VideoSendStatisticsCallback. | 100 // Implements VideoSendStatisticsCallback. |
101 void SendStatistics(uint32_t bit_rate, | 101 void SendStatistics(uint32_t bit_rate, |
102 uint32_t frame_rate) override; | 102 uint32_t frame_rate) override; |
103 | 103 |
104 void EncodeVideoFrame(const VideoFrame& frame); | 104 void EncodeVideoFrame(const VideoFrame& frame, |
| 105 int64_t time_when_posted_in_ms); |
105 | 106 |
106 // Implements EncodedImageCallback. | 107 // Implements EncodedImageCallback. |
107 EncodedImageCallback::Result OnEncodedImage( | 108 EncodedImageCallback::Result OnEncodedImage( |
108 const EncodedImage& encoded_image, | 109 const EncodedImage& encoded_image, |
109 const CodecSpecificInfo* codec_specific_info, | 110 const CodecSpecificInfo* codec_specific_info, |
110 const RTPFragmentationHeader* fragmentation) override; | 111 const RTPFragmentationHeader* fragmentation) override; |
111 | 112 |
112 // webrtc::CpuOveruseObserver implementation. | 113 // webrtc::CpuOveruseObserver implementation. |
113 void OveruseDetected() override; | 114 void OveruseDetected() override; |
114 void NormalUsage() override; | 115 void NormalUsage() override; |
115 | 116 |
116 bool EncoderPaused() const; | 117 bool EncoderPaused() const; |
117 void TraceFrameDropStart(); | 118 void TraceFrameDropStart(); |
118 void TraceFrameDropEnd(); | 119 void TraceFrameDropEnd(); |
119 | 120 |
120 rtc::Event shutdown_event_; | 121 rtc::Event shutdown_event_; |
121 | 122 |
122 const uint32_t number_of_cores_; | 123 const uint32_t number_of_cores_; |
123 EncodedImageCallback* sink_; | 124 EncodedImageCallback* sink_; |
124 const VideoSendStream::Config::EncoderSettings settings_; | 125 const VideoSendStream::Config::EncoderSettings settings_; |
125 | 126 |
126 const std::unique_ptr<VideoProcessing> vp_; | 127 const std::unique_ptr<VideoProcessing> vp_; |
127 vcm::VideoSender video_sender_ ACCESS_ON(&encoder_queue_); | 128 vcm::VideoSender video_sender_ ACCESS_ON(&encoder_queue_); |
128 OveruseFrameDetector overuse_detector_; | 129 |
129 LoadObserver* const load_observer_ ACCESS_ON(&module_process_thread_checker_); | 130 OveruseFrameDetector overuse_detector_ ACCESS_ON(&encoder_queue_); |
| 131 LoadObserver* const load_observer_ ACCESS_ON(&encoder_queue_); |
130 | 132 |
131 SendStatisticsProxy* const stats_proxy_; | 133 SendStatisticsProxy* const stats_proxy_; |
132 rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_; | 134 rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_; |
133 ProcessThread* module_process_thread_; | 135 ProcessThread* module_process_thread_; |
134 rtc::ThreadChecker module_process_thread_checker_; | 136 rtc::ThreadChecker module_process_thread_checker_; |
135 | 137 |
136 VideoCodec encoder_config_ ACCESS_ON(&encoder_queue_); | 138 VideoCodec encoder_config_ ACCESS_ON(&encoder_queue_); |
137 | 139 |
138 int encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); | 140 int encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
139 uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_); | 141 uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
(...skipping 12 matching lines...) Expand all Loading... |
152 const int64_t delta_ntp_internal_ms_; | 154 const int64_t delta_ntp_internal_ms_; |
153 | 155 |
154 // All public methods are proxied to |encoder_queue_|. It must must be | 156 // All public methods are proxied to |encoder_queue_|. It must must be |
155 // destroyed first to make sure no tasks are run that use other members. | 157 // destroyed first to make sure no tasks are run that use other members. |
156 rtc::TaskQueue encoder_queue_; | 158 rtc::TaskQueue encoder_queue_; |
157 }; | 159 }; |
158 | 160 |
159 } // namespace webrtc | 161 } // namespace webrtc |
160 | 162 |
161 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 163 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
OLD | NEW |