blob: 024a8b6c63d4ed5db4a35cb2cbf7958e12d7d1ac [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"
19#include "webrtc/video_engine/new_include/video_receive_stream.h"
20
21namespace webrtc {
22
23class VideoEngine;
24class ViEBase;
25class ViECodec;
26class ViENetwork;
27class ViERender;
28class ViERTP_RTCP;
29
30namespace internal {
31
32class VideoReceiveStream : public newapi::VideoReceiveStream,
33 public webrtc::ExternalRenderer,
34 public webrtc::Transport {
35 public:
36 VideoReceiveStream(webrtc::VideoEngine* video_engine,
37 const newapi::VideoReceiveStreamConfig& config,
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;
45 virtual void GetReceiveStatistics(newapi::ReceiveStatistics* statistics)
46 OVERRIDE;
47
48 virtual bool DeliverRtcp(const void* packet, size_t length);
49 virtual bool DeliverRtp(const void* packet, size_t length);
50
51 virtual int FrameSizeChange(unsigned int width, unsigned int height,
52 unsigned int /*number_of_streams*/) OVERRIDE;
53
54 virtual int DeliverFrame(uint8_t* frame, int buffer_size, uint32_t time_stamp,
55 int64_t render_time) OVERRIDE;
56
57 virtual int SendPacket(int /*channel*/, const void* packet, int length)
58 OVERRIDE;
59
60 virtual int SendRTCPPacket(int /*channel*/, const void* packet, int length)
61 OVERRIDE;
62
63 private:
64 newapi::Transport* transport_;
65 newapi::VideoReceiveStreamConfig config_;
66 Clock* clock_;
67
68 ViEBase* video_engine_base_;
69 ViECodec* codec_;
70 ViENetwork* network_;
71 ViERender* render_;
72 ViERTP_RTCP* rtp_rtcp_;
73
74 int channel_;
75
76 // TODO(pbos): Remove VideoReceiveStream can operate on I420 frames directly.
77 unsigned int height_;
78 unsigned int width_;
79};
80} // internal
81} // webrtc
82
83#endif // WEBRTC_VIDEO_ENGINE_INTERNAL_VIDEO_RECEIVE_STREAM_H_