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