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,
47 virtual ~VideoSendStream();
49 virtual void Start() OVERRIDE;
50 virtual void Stop() OVERRIDE;
52 virtual bool ReconfigureVideoEncoder(const std::vector<VideoStream>& streams,
53 void* encoder_settings) OVERRIDE;
55 virtual Stats GetStats() const OVERRIDE;
57 bool DeliverRtcp(const uint8_t* packet, size_t length);
59 // From VideoSendStreamInput.
60 virtual void PutFrame(const I420VideoFrame& frame) OVERRIDE;
61 virtual void SwapFrame(I420VideoFrame* frame) OVERRIDE;
63 // From webrtc::VideoSendStream.
64 virtual VideoSendStreamInput* Input() OVERRIDE;
67 // From SendStatisticsProxy::StreamStatsProvider.
68 virtual bool GetSendSideDelay(VideoSendStream::Stats* stats) OVERRIDE;
69 virtual std::string GetCName() OVERRIDE;
72 I420VideoFrame input_frame_;
73 TransportAdapter transport_adapter_;
74 EncodedFrameCallbackAdapter encoded_frame_proxy_;
75 scoped_ptr<CriticalSectionWrapper> codec_lock_;
76 VideoSendStream::Config config_;
78 ViEBase* video_engine_base_;
81 ViEExternalCapture* external_capture_;
82 ViEExternalCodec* external_codec_;
84 ViERTP_RTCP* rtp_rtcp_;
85 ViEImageProcess* image_process_;
90 const scoped_ptr<SendStatisticsProxy> stats_proxy_;
92 } // namespace internal
95 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_