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_
17 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
18 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
19 #include "webrtc/video/encoded_frame_callback_adapter.h"
20 #include "webrtc/video/send_statistics_proxy.h"
21 #include "webrtc/video/transport_adapter.h"
22 #include "webrtc/video_receive_stream.h"
23 #include "webrtc/video_send_stream.h"
24 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
28 class CpuOveruseObserver;
33 class ViEExternalCapture;
34 class ViEExternalCodec;
35 class ViEImageProcess;
41 class VideoSendStream : public webrtc::VideoSendStream,
42 public VideoSendStreamInput {
44 VideoSendStream(newapi::Transport* transport,
45 CpuOveruseObserver* overuse_observer,
46 webrtc::VideoEngine* video_engine,
47 const VideoSendStream::Config& config,
48 const std::vector<VideoStream> video_streams,
49 const void* encoder_settings,
50 const std::map<uint32_t, RtpState>& suspended_ssrcs,
54 virtual ~VideoSendStream();
56 virtual void Start() OVERRIDE;
57 virtual void Stop() OVERRIDE;
59 virtual bool ReconfigureVideoEncoder(const std::vector<VideoStream>& streams,
60 const void* encoder_settings) OVERRIDE;
62 virtual Stats GetStats() const OVERRIDE;
64 bool DeliverRtcp(const uint8_t* packet, size_t length);
66 // From VideoSendStreamInput.
67 virtual void SwapFrame(I420VideoFrame* frame) OVERRIDE;
69 // From webrtc::VideoSendStream.
70 virtual VideoSendStreamInput* Input() OVERRIDE;
72 typedef std::map<uint32_t, RtpState> RtpStateMap;
73 RtpStateMap GetRtpStates() const;
76 void ConfigureSsrcs();
77 TransportAdapter transport_adapter_;
78 EncodedFrameCallbackAdapter encoded_frame_proxy_;
79 const VideoSendStream::Config config_;
80 const int start_bitrate_bps_;
81 std::map<uint32_t, RtpState> suspended_ssrcs_;
83 ViEBase* video_engine_base_;
86 ViEExternalCapture* external_capture_;
87 ViEExternalCodec* external_codec_;
89 ViERTP_RTCP* rtp_rtcp_;
90 ViEImageProcess* image_process_;
95 SendStatisticsProxy stats_proxy_;
97 } // namespace internal
100 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_