blob: b6b53190e47723744497862beb795bc75e4ea958 [file] [log] [blame]
pbos@webrtc.org29d58392013-05-16 12:08:03 +00001/*
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"
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000019#include "webrtc/video_engine/internal/transport_adapter.h"
pbos@webrtc.org29d58392013-05-16 12:08:03 +000020#include "webrtc/video_engine/new_include/video_receive_stream.h"
21
22namespace webrtc {
23
24class VideoEngine;
25class ViEBase;
26class ViECodec;
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000027class ViEExternalCodec;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000028class ViENetwork;
29class ViERender;
30class ViERTP_RTCP;
31
32namespace internal {
33
pbos@webrtc.org74fa4892013-08-23 09:19:30 +000034class VideoReceiveStream : public webrtc::VideoReceiveStream,
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000035 public webrtc::ExternalRenderer {
pbos@webrtc.org29d58392013-05-16 12:08:03 +000036 public:
37 VideoReceiveStream(webrtc::VideoEngine* video_engine,
pbos@webrtc.org74fa4892013-08-23 09:19:30 +000038 const VideoReceiveStream::Config& config,
pbos@webrtc.org29d58392013-05-16 12:08:03 +000039 newapi::Transport* transport);
40 virtual ~VideoReceiveStream();
41
42 virtual void StartReceive() OVERRIDE;
43 virtual void StopReceive() OVERRIDE;
44
45 virtual void GetCurrentReceiveCodec(VideoCodec* receive_codec) OVERRIDE;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000046
pbos@webrtc.org29d58392013-05-16 12:08:03 +000047 virtual int FrameSizeChange(unsigned int width, unsigned int height,
48 unsigned int /*number_of_streams*/) OVERRIDE;
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000049 virtual int DeliverFrame(uint8_t* frame, int buffer_size, uint32_t timestamp,
wu@webrtc.org9dba5252013-08-05 20:36:57 +000050 int64_t render_time, void* /*handle*/) OVERRIDE;
51
52 virtual bool IsTextureSupported() OVERRIDE;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000053
pbos@webrtc.orgbbb07e62013-08-05 12:01:36 +000054 public:
55 virtual bool DeliverRtcp(const uint8_t* packet, size_t length);
56 virtual bool DeliverRtp(const uint8_t* packet, size_t length);
57
pbos@webrtc.org29d58392013-05-16 12:08:03 +000058 private:
pbos@webrtc.orge75a1bf2013-09-18 11:52:42 +000059 TransportAdapter transport_adapter_;
pbos@webrtc.org74fa4892013-08-23 09:19:30 +000060 VideoReceiveStream::Config config_;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000061 Clock* clock_;
62
63 ViEBase* video_engine_base_;
64 ViECodec* codec_;
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000065 ViEExternalCodec* external_codec_;
pbos@webrtc.org29d58392013-05-16 12:08:03 +000066 ViENetwork* network_;
67 ViERender* render_;
68 ViERTP_RTCP* rtp_rtcp_;
69
70 int channel_;
71
72 // TODO(pbos): Remove VideoReceiveStream can operate on I420 frames directly.
73 unsigned int height_;
74 unsigned int width_;
75};
76} // internal
77} // webrtc
78
79#endif // WEBRTC_VIDEO_ENGINE_INTERNAL_VIDEO_RECEIVE_STREAM_H_