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_SEND_STREAM_H_
12 #define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
14 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
15 #include "webrtc/video/encoded_frame_callback_adapter.h"
16 #include "webrtc/video/send_statistics_proxy.h"
17 #include "webrtc/video/transport_adapter.h"
18 #include "webrtc/video_receive_stream.h"
19 #include "webrtc/video_send_stream.h"
20 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
24 class CpuOveruseObserver;
29 class ViEExternalCapture;
30 class ViEExternalCodec;
31 class ViEImageProcess;
37 class VideoSendStream : public webrtc::VideoSendStream,
38 public VideoSendStreamInput,
39 public SendStatisticsProxy::StatsProvider {
41 VideoSendStream(newapi::Transport* transport,
42 CpuOveruseObserver* overuse_observer,
43 webrtc::VideoEngine* video_engine,
44 const VideoSendStream::Config& config,
45 const std::vector<VideoStream> video_streams,
46 const void* encoder_settings,
50 virtual ~VideoSendStream();
52 virtual void Start() OVERRIDE;
53 virtual void Stop() OVERRIDE;
55 virtual bool ReconfigureVideoEncoder(const std::vector<VideoStream>& streams,
56 const void* encoder_settings) OVERRIDE;
58 virtual Stats GetStats() const OVERRIDE;
60 bool DeliverRtcp(const uint8_t* packet, size_t length);
62 // From VideoSendStreamInput.
63 virtual void SwapFrame(I420VideoFrame* frame) OVERRIDE;
65 // From webrtc::VideoSendStream.
66 virtual VideoSendStreamInput* Input() OVERRIDE;
69 // From SendStatisticsProxy::StreamStatsProvider.
70 virtual bool GetSendSideDelay(VideoSendStream::Stats* stats) OVERRIDE;
71 virtual std::string GetCName() OVERRIDE;
74 TransportAdapter transport_adapter_;
75 EncodedFrameCallbackAdapter encoded_frame_proxy_;
76 const VideoSendStream::Config config_;
77 const int start_bitrate_bps_;
79 ViEBase* video_engine_base_;
82 ViEExternalCapture* external_capture_;
83 ViEExternalCodec* external_codec_;
85 ViERTP_RTCP* rtp_rtcp_;
86 ViEImageProcess* image_process_;
91 const scoped_ptr<SendStatisticsProxy> stats_proxy_;
93 } // namespace internal
96 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_