pbos@webrtc.org | 29d5839 | 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 | |
| 11 | #ifndef WEBRTC_VIDEO_ENGINE_VIDEO_RECEIVE_STREAM_IMPL_H_ |
| 12 | #define WEBRTC_VIDEO_ENGINE_VIDEO_RECEIVE_STREAM_IMPL_H_ |
| 13 | |
| 14 | #include <vector> |
| 15 | |
| 16 | #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
| 17 | #include "webrtc/system_wrappers/interface/clock.h" |
| 18 | #include "webrtc/video_engine/include/vie_render.h" |
| 19 | #include "webrtc/video_engine/new_include/video_receive_stream.h" |
| 20 | |
| 21 | namespace webrtc { |
| 22 | |
| 23 | class VideoEngine; |
| 24 | class ViEBase; |
| 25 | class ViECodec; |
| 26 | class ViENetwork; |
| 27 | class ViERender; |
| 28 | class ViERTP_RTCP; |
| 29 | |
| 30 | namespace internal { |
| 31 | |
pbos@webrtc.org | 74fa489 | 2013-08-23 09:19:30 +0000 | [diff] [blame^] | 32 | class VideoReceiveStream : public webrtc::VideoReceiveStream, |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 33 | public webrtc::ExternalRenderer, |
| 34 | public webrtc::Transport { |
| 35 | public: |
| 36 | VideoReceiveStream(webrtc::VideoEngine* video_engine, |
pbos@webrtc.org | 74fa489 | 2013-08-23 09:19:30 +0000 | [diff] [blame^] | 37 | const VideoReceiveStream::Config& config, |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 38 | newapi::Transport* transport); |
| 39 | virtual ~VideoReceiveStream(); |
| 40 | |
| 41 | virtual void StartReceive() OVERRIDE; |
| 42 | virtual void StopReceive() OVERRIDE; |
| 43 | |
| 44 | virtual void GetCurrentReceiveCodec(VideoCodec* receive_codec) OVERRIDE; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 45 | |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 46 | virtual int FrameSizeChange(unsigned int width, unsigned int height, |
| 47 | unsigned int /*number_of_streams*/) OVERRIDE; |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 48 | virtual int DeliverFrame(uint8_t* frame, int buffer_size, uint32_t timestamp, |
wu@webrtc.org | 9dba525 | 2013-08-05 20:36:57 +0000 | [diff] [blame] | 49 | int64_t render_time, void* /*handle*/) OVERRIDE; |
| 50 | |
| 51 | virtual bool IsTextureSupported() OVERRIDE; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 52 | |
| 53 | virtual int SendPacket(int /*channel*/, const void* packet, int length) |
| 54 | OVERRIDE; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 55 | virtual int SendRTCPPacket(int /*channel*/, const void* packet, int length) |
| 56 | OVERRIDE; |
| 57 | |
pbos@webrtc.org | bbb07e6 | 2013-08-05 12:01:36 +0000 | [diff] [blame] | 58 | public: |
| 59 | virtual bool DeliverRtcp(const uint8_t* packet, size_t length); |
| 60 | virtual bool DeliverRtp(const uint8_t* packet, size_t length); |
| 61 | |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 62 | private: |
| 63 | newapi::Transport* transport_; |
pbos@webrtc.org | 74fa489 | 2013-08-23 09:19:30 +0000 | [diff] [blame^] | 64 | VideoReceiveStream::Config config_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 65 | Clock* clock_; |
| 66 | |
| 67 | ViEBase* video_engine_base_; |
| 68 | ViECodec* codec_; |
| 69 | ViENetwork* network_; |
| 70 | ViERender* render_; |
| 71 | ViERTP_RTCP* rtp_rtcp_; |
| 72 | |
| 73 | int channel_; |
| 74 | |
| 75 | // TODO(pbos): Remove VideoReceiveStream can operate on I420 frames directly. |
| 76 | unsigned int height_; |
| 77 | unsigned int width_; |
| 78 | }; |
| 79 | } // internal |
| 80 | } // webrtc |
| 81 | |
| 82 | #endif // WEBRTC_VIDEO_ENGINE_INTERNAL_VIDEO_RECEIVE_STREAM_H_ |