2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
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.
11 #ifndef WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_
12 #define WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_
16 #include "webrtc/call.h"
17 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
18 #include "webrtc/modules/video_render/include/video_render_defines.h"
19 #include "webrtc/system_wrappers/interface/clock.h"
20 #include "webrtc/system_wrappers/interface/scoped_ptr.h"
21 #include "webrtc/video/encoded_frame_callback_adapter.h"
22 #include "webrtc/video/receive_statistics_proxy.h"
23 #include "webrtc/video/transport_adapter.h"
24 #include "webrtc/video_engine/include/vie_render.h"
25 #include "webrtc/video_receive_stream.h"
32 class ViEExternalCodec;
33 class ViEImageProcess;
41 class VideoReceiveStream : public webrtc::VideoReceiveStream,
42 public I420FrameCallback,
43 public VideoRenderCallback {
45 VideoReceiveStream(webrtc::VideoEngine* video_engine,
46 const VideoReceiveStream::Config& config,
47 newapi::Transport* transport,
48 webrtc::VoiceEngine* voice_engine,
50 virtual ~VideoReceiveStream();
52 virtual void Start() OVERRIDE;
53 virtual void Stop() OVERRIDE;
54 virtual Stats GetStats() const OVERRIDE;
56 // Overrides I420FrameCallback.
57 virtual void FrameCallback(I420VideoFrame* video_frame) OVERRIDE;
59 // Overrides VideoRenderCallback.
60 virtual int32_t RenderFrame(const uint32_t stream_id,
61 I420VideoFrame& video_frame) OVERRIDE;
63 void SignalNetworkState(Call::NetworkState state);
65 virtual bool DeliverRtcp(const uint8_t* packet, size_t length);
66 virtual bool DeliverRtp(const uint8_t* packet, size_t length);
69 void SetRtcpMode(newapi::RtcpMode mode);
71 TransportAdapter transport_adapter_;
72 EncodedFrameCallbackAdapter encoded_frame_proxy_;
73 const VideoReceiveStream::Config config_;
76 ViEBase* video_engine_base_;
78 ViEExternalCodec* external_codec_;
81 ViERTP_RTCP* rtp_rtcp_;
82 ViEImageProcess* image_process_;
84 scoped_ptr<ReceiveStatisticsProxy> stats_proxy_;
88 } // namespace internal
91 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_