1 /* 2 * Copyright (c) 2013 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 WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ 12 #define WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ 13 14 #include <vector> 15 16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 17 #include "webrtc/modules/video_render/include/video_render_defines.h" 18 #include "webrtc/system_wrappers/interface/clock.h" 19 #include "webrtc/system_wrappers/interface/scoped_ptr.h" 20 #include "webrtc/video/encoded_frame_callback_adapter.h" 21 #include "webrtc/video/receive_statistics_proxy.h" 22 #include "webrtc/video/transport_adapter.h" 23 #include "webrtc/video_engine/include/vie_render.h" 24 #include "webrtc/video_receive_stream.h" 25 26 namespace webrtc { 27 28 class VideoEngine; 29 class ViEBase; 30 class ViECodec; 31 class ViEExternalCodec; 32 class ViEImageProcess; 33 class ViENetwork; 34 class ViERender; 35 class ViERTP_RTCP; 36 class VoiceEngine; 37 38 namespace internal { 39 40 class VideoReceiveStream : public webrtc::VideoReceiveStream, 41 public I420FrameCallback, 42 public VideoRenderCallback { 43 44 public: 45 VideoReceiveStream(webrtc::VideoEngine* video_engine, 46 const VideoReceiveStream::Config& config, 47 newapi::Transport* transport, 48 webrtc::VoiceEngine* voice_engine, 49 int base_channel); 50 virtual ~VideoReceiveStream(); 51 52 virtual void Start() OVERRIDE; 53 virtual void Stop() OVERRIDE; 54 virtual Stats GetStats() const OVERRIDE; 55 56 virtual void GetCurrentReceiveCodec(VideoCodec* receive_codec) OVERRIDE; 57 58 // Overrides I420FrameCallback. 59 virtual void FrameCallback(I420VideoFrame* video_frame) OVERRIDE; 60 61 // Overrides VideoRenderCallback. 62 virtual int32_t RenderFrame(const uint32_t stream_id, 63 I420VideoFrame& video_frame) OVERRIDE; 64 65 public: 66 virtual bool DeliverRtcp(const uint8_t* packet, size_t length); 67 virtual bool DeliverRtp(const uint8_t* packet, size_t length); 68 69 private: 70 TransportAdapter transport_adapter_; 71 EncodedFrameCallbackAdapter encoded_frame_proxy_; 72 const VideoReceiveStream::Config config_; 73 Clock* const clock_; 74 75 ViEBase* video_engine_base_; 76 ViECodec* codec_; 77 ViEExternalCodec* external_codec_; 78 ViENetwork* network_; 79 ViERender* render_; 80 ViERTP_RTCP* rtp_rtcp_; 81 ViEImageProcess* image_process_; 82 83 scoped_ptr<ReceiveStatisticsProxy> stats_proxy_; 84 85 int channel_; 86 }; 87 } // namespace internal 88 } // namespace webrtc 89 90 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ 91