1 /* 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef COMMON_VIDEO_INCLUDE_INCOMING_VIDEO_STREAM_H_ 12 #define COMMON_VIDEO_INCLUDE_INCOMING_VIDEO_STREAM_H_ 13 14 #include <stdint.h> 15 16 #include "api/task_queue/task_queue_factory.h" 17 #include "api/video/video_frame.h" 18 #include "api/video/video_sink_interface.h" 19 #include "common_video/video_render_frames.h" 20 #include "rtc_base/race_checker.h" 21 #include "rtc_base/task_queue.h" 22 #include "rtc_base/thread_checker.h" 23 24 namespace webrtc { 25 26 class IncomingVideoStream : public rtc::VideoSinkInterface<VideoFrame> { 27 public: 28 IncomingVideoStream(TaskQueueFactory* task_queue_factory, 29 int32_t delay_ms, 30 rtc::VideoSinkInterface<VideoFrame>* callback); 31 ~IncomingVideoStream() override; 32 33 private: 34 void OnFrame(const VideoFrame& video_frame) override; 35 void Dequeue(); 36 37 rtc::ThreadChecker main_thread_checker_; 38 rtc::RaceChecker decoder_race_checker_; 39 40 VideoRenderFrames render_buffers_; // Only touched on the TaskQueue. 41 rtc::VideoSinkInterface<VideoFrame>* const callback_; 42 rtc::TaskQueue incoming_render_queue_; 43 }; 44 45 } // namespace webrtc 46 47 #endif // COMMON_VIDEO_INCLUDE_INCOMING_VIDEO_STREAM_H_ 48