pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 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 | |
mflodman@webrtc.org | dadfc9e | 2013-12-13 09:40:45 +0000 | [diff] [blame] | 11 | #ifndef WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |
| 12 | #define WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 13 | |
| 14 | #include <vector> |
| 15 | |
| 16 | #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
pbos@webrtc.org | 3051951 | 2013-11-20 13:19:54 +0000 | [diff] [blame] | 17 | #include "webrtc/modules/video_render/include/video_render_defines.h" |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 18 | #include "webrtc/system_wrappers/interface/clock.h" |
sprang@webrtc.org | c8ab721 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 19 | #include "webrtc/system_wrappers/interface/scoped_ptr.h" |
sprang@webrtc.org | 2e98d45 | 2013-11-26 11:41:59 +0000 | [diff] [blame] | 20 | #include "webrtc/video/encoded_frame_callback_adapter.h" |
sprang@webrtc.org | c8ab721 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 21 | #include "webrtc/video/receive_statistics_proxy.h" |
pbos@webrtc.org | 24e2089 | 2013-10-28 16:32:01 +0000 | [diff] [blame] | 22 | #include "webrtc/video/transport_adapter.h" |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 23 | #include "webrtc/video_engine/include/vie_render.h" |
pbos@webrtc.org | 24e2089 | 2013-10-28 16:32:01 +0000 | [diff] [blame] | 24 | #include "webrtc/video_receive_stream.h" |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 25 | |
| 26 | namespace webrtc { |
| 27 | |
| 28 | class VideoEngine; |
| 29 | class ViEBase; |
| 30 | class ViECodec; |
pbos@webrtc.org | 618a0ec | 2013-09-09 08:26:30 +0000 | [diff] [blame] | 31 | class ViEExternalCodec; |
pbos@webrtc.org | 63301bd | 2013-10-21 10:34:43 +0000 | [diff] [blame] | 32 | class ViEImageProcess; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 33 | class ViENetwork; |
| 34 | class ViERender; |
| 35 | class ViERTP_RTCP; |
stefan@webrtc.org | e028410 | 2013-11-18 11:45:11 +0000 | [diff] [blame] | 36 | class VoiceEngine; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 37 | |
| 38 | namespace internal { |
| 39 | |
pbos@webrtc.org | c179706 | 2013-08-23 09:19:30 +0000 | [diff] [blame] | 40 | class VideoReceiveStream : public webrtc::VideoReceiveStream, |
sprang@webrtc.org | c8ab721 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 41 | public I420FrameCallback, |
pbos@webrtc.org | 3051951 | 2013-11-20 13:19:54 +0000 | [diff] [blame] | 42 | public VideoRenderCallback { |
sprang@webrtc.org | c8ab721 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 43 | |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 44 | public: |
| 45 | VideoReceiveStream(webrtc::VideoEngine* video_engine, |
pbos@webrtc.org | c179706 | 2013-08-23 09:19:30 +0000 | [diff] [blame] | 46 | const VideoReceiveStream::Config& config, |
stefan@webrtc.org | e028410 | 2013-11-18 11:45:11 +0000 | [diff] [blame] | 47 | newapi::Transport* transport, |
mflodman@webrtc.org | dadfc9e | 2013-12-13 09:40:45 +0000 | [diff] [blame] | 48 | webrtc::VoiceEngine* voice_engine, |
| 49 | int base_channel); |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 50 | virtual ~VideoReceiveStream(); |
| 51 | |
pbos@webrtc.org | 7f9f840 | 2013-11-20 11:36:47 +0000 | [diff] [blame] | 52 | virtual void StartReceiving() OVERRIDE; |
| 53 | virtual void StopReceiving() OVERRIDE; |
sprang@webrtc.org | 0feb8fa | 2014-02-07 15:32:45 +0000 | [diff] [blame] | 54 | virtual Stats GetStats() const OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 55 | |
| 56 | virtual void GetCurrentReceiveCodec(VideoCodec* receive_codec) OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 57 | |
sprang@webrtc.org | c8ab721 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 58 | // Overrides I420FrameCallback. |
| 59 | virtual void FrameCallback(I420VideoFrame* video_frame) OVERRIDE; |
| 60 | |
| 61 | // Overrides VideoRenderCallback. |
pbos@webrtc.org | 3051951 | 2013-11-20 13:19:54 +0000 | [diff] [blame] | 62 | virtual int32_t RenderFrame(const uint32_t stream_id, |
| 63 | I420VideoFrame& video_frame) OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 64 | |
pbos@webrtc.org | ce85109 | 2013-08-05 12:01:36 +0000 | [diff] [blame] | 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 | |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 69 | private: |
pbos@webrtc.org | 1ddd57f | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 70 | TransportAdapter transport_adapter_; |
sprang@webrtc.org | 2e98d45 | 2013-11-26 11:41:59 +0000 | [diff] [blame] | 71 | EncodedFrameCallbackAdapter encoded_frame_proxy_; |
pbos@webrtc.org | c179706 | 2013-08-23 09:19:30 +0000 | [diff] [blame] | 72 | VideoReceiveStream::Config config_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 73 | Clock* clock_; |
| 74 | |
| 75 | ViEBase* video_engine_base_; |
| 76 | ViECodec* codec_; |
pbos@webrtc.org | 618a0ec | 2013-09-09 08:26:30 +0000 | [diff] [blame] | 77 | ViEExternalCodec* external_codec_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 78 | ViENetwork* network_; |
| 79 | ViERender* render_; |
| 80 | ViERTP_RTCP* rtp_rtcp_; |
pbos@webrtc.org | 63301bd | 2013-10-21 10:34:43 +0000 | [diff] [blame] | 81 | ViEImageProcess* image_process_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 82 | |
sprang@webrtc.org | c8ab721 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 83 | scoped_ptr<ReceiveStatisticsProxy> stats_proxy_; |
| 84 | |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 85 | int channel_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 86 | }; |
mflodman@webrtc.org | dadfc9e | 2013-12-13 09:40:45 +0000 | [diff] [blame] | 87 | } // namespace internal |
| 88 | } // namespace webrtc |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 89 | |
mflodman@webrtc.org | dadfc9e | 2013-12-13 09:40:45 +0000 | [diff] [blame] | 90 | #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |