65fd887d339fb6e520bfdbc5467c7a29bc60ae16
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / video / video_receive_stream.h
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_VIDEO_RECEIVE_STREAM_H_
12 #define WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_
13
14 #include <vector>
15
16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
17 #include "webrtc/modules/video_render/include/video_render_defines.h"
18 #include "webrtc/system_wrappers/interface/clock.h"
19 #include "webrtc/video/encoded_frame_callback_adapter.h"
20 #include "webrtc/video/transport_adapter.h"
21 #include "webrtc/video_engine/include/vie_render.h"
22 #include "webrtc/video_receive_stream.h"
23
24 namespace webrtc {
25
26 class VideoEngine;
27 class ViEBase;
28 class ViECodec;
29 class ViEExternalCodec;
30 class ViEImageProcess;
31 class ViENetwork;
32 class ViERender;
33 class ViERTP_RTCP;
34 class VoiceEngine;
35
36 namespace internal {
37
38 class VideoReceiveStream : public webrtc::VideoReceiveStream,
39                            public VideoRenderCallback {
40  public:
41   VideoReceiveStream(webrtc::VideoEngine* video_engine,
42                      const VideoReceiveStream::Config& config,
43                      newapi::Transport* transport,
44                      webrtc::VoiceEngine* voice_engine,
45                      int base_channel);
46   virtual ~VideoReceiveStream();
47
48   virtual void StartReceiving() OVERRIDE;
49   virtual void StopReceiving() OVERRIDE;
50
51   virtual void GetCurrentReceiveCodec(VideoCodec* receive_codec) OVERRIDE;
52
53   virtual int32_t RenderFrame(const uint32_t stream_id,
54                               I420VideoFrame& video_frame) OVERRIDE;
55
56  public:
57   virtual bool DeliverRtcp(const uint8_t* packet, size_t length);
58   virtual bool DeliverRtp(const uint8_t* packet, size_t length);
59
60  private:
61   TransportAdapter transport_adapter_;
62   EncodedFrameCallbackAdapter encoded_frame_proxy_;
63   VideoReceiveStream::Config config_;
64   Clock* clock_;
65
66   ViEBase* video_engine_base_;
67   ViECodec* codec_;
68   ViEExternalCodec* external_codec_;
69   ViENetwork* network_;
70   ViERender* render_;
71   ViERTP_RTCP* rtp_rtcp_;
72   ViEImageProcess* image_process_;
73
74   int channel_;
75 };
76 }  // namespace internal
77 }  // namespace webrtc
78
79 #endif  // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_