| Index: webrtc/video/vie_encoder.h
|
| diff --git a/webrtc/video/vie_encoder.h b/webrtc/video/vie_encoder.h
|
| index 42fe03b18856a5834644ff8ca342ec1556ba349b..70c157de980e417458c10d133169a243739f7458 100644
|
| --- a/webrtc/video/vie_encoder.h
|
| +++ b/webrtc/video/vie_encoder.h
|
| @@ -44,7 +44,7 @@ class SendStatisticsProxy;
|
| // Call ConfigureEncoder with the codec settings.
|
| // Provide frames to encode by calling IncomingCapturedFrame.
|
| // Call Stop() when done.
|
| -class ViEEncoder : public VideoCaptureInput,
|
| +class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>,
|
| public EncodedImageCallback,
|
| public VCMSendStatisticsCallback,
|
| public CpuOveruseObserver {
|
| @@ -63,6 +63,7 @@ class ViEEncoder : public VideoCaptureInput,
|
| void RegisterProcessThread(ProcessThread* module_process_thread);
|
| void DeRegisterProcessThread();
|
|
|
| + void SetSource(rtc::VideoSourceInterface<VideoFrame>* source);
|
| void SetSink(EncodedImageCallback* sink);
|
|
|
| // TODO(perkj): Can we remove VideoCodec.startBitrate ?
|
| @@ -75,11 +76,6 @@ class ViEEncoder : public VideoCaptureInput,
|
| // guaranteed that no encoded frames will be delivered to the sink.
|
| void Stop();
|
|
|
| - // Implements VideoCaptureInput.
|
| - // TODO(perkj): Refactor ViEEncoder to inherit rtc::VideoSink instead of
|
| - // VideoCaptureInput.
|
| - void IncomingCapturedFrame(const VideoFrame& video_frame) override;
|
| -
|
| void SendKeyFrame();
|
|
|
| // virtual to test EncoderStateFeedback with mocks.
|
| @@ -93,10 +89,14 @@ class ViEEncoder : public VideoCaptureInput,
|
|
|
| private:
|
| class EncodeTask;
|
| + class VideoSourceProxy;
|
|
|
| void ConfigureEncoderInternal(const VideoCodec& video_codec,
|
| size_t max_data_payload_length);
|
|
|
| + // Implements VideoSinkInterface.
|
| + void OnFrame(const VideoFrame& video_frame) override;
|
| +
|
| // Implements VideoSendStatisticsCallback.
|
| void SendStatistics(uint32_t bit_rate,
|
| uint32_t frame_rate,
|
| @@ -121,6 +121,8 @@ class ViEEncoder : public VideoCaptureInput,
|
| rtc::Event shutdown_event_;
|
|
|
| const uint32_t number_of_cores_;
|
| +
|
| + const std::unique_ptr<VideoSourceProxy> source_proxy_;
|
| EncodedImageCallback* sink_;
|
| const VideoSendStream::Config::EncoderSettings settings_;
|
|
|
| @@ -133,6 +135,7 @@ class ViEEncoder : public VideoCaptureInput,
|
| rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_;
|
| ProcessThread* module_process_thread_;
|
| rtc::ThreadChecker module_process_thread_checker_;
|
| + rtc::ThreadChecker main_thread_checker_;
|
|
|
| VideoCodec encoder_config_ ACCESS_ON(&encoder_queue_);
|
|
|
| @@ -155,6 +158,8 @@ class ViEEncoder : public VideoCaptureInput,
|
| // All public methods are proxied to |encoder_queue_|. It must must be
|
| // destroyed first to make sure no tasks are run that use other members.
|
| rtc::TaskQueue encoder_queue_;
|
| +
|
| + RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder);
|
| };
|
|
|
| } // namespace webrtc
|
|
|