blob: 05c481f3f7fb3a6c29271b15d2155fab00fd1497 [file] [log] [blame]
pbos@webrtc.org29d58392013-05-16 12:08:031/*
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
mflodman@webrtc.orgf3973e82013-12-13 09:40:4511#ifndef WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
12#define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
pbos@webrtc.org29d58392013-05-16 12:08:0313
pbos@webrtc.org29d58392013-05-16 12:08:0314#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
sprang@webrtc.org40709352013-11-26 11:41:5915#include "webrtc/video/encoded_frame_callback_adapter.h"
sprang@webrtc.orgccd42842014-01-07 09:54:3416#include "webrtc/video/send_statistics_proxy.h"
pbos@webrtc.org16e03b72013-10-28 16:32:0117#include "webrtc/video/transport_adapter.h"
18#include "webrtc/video_receive_stream.h"
19#include "webrtc/video_send_stream.h"
pbos@webrtc.org64887612013-11-14 08:58:1420#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
pbos@webrtc.org29d58392013-05-16 12:08:0321
22namespace webrtc {
23
24class VideoEngine;
25class ViEBase;
26class ViECapture;
27class ViECodec;
28class ViEExternalCapture;
stefan@webrtc.org360e3762013-08-22 09:29:5629class ViEExternalCodec;
pbos@webrtc.orgfe1ef932013-10-21 10:34:4330class ViEImageProcess;
pbos@webrtc.org29d58392013-05-16 12:08:0331class ViENetwork;
32class ViERTP_RTCP;
33
34namespace internal {
mflodman@webrtc.org6879c8a2013-07-23 11:35:0035
36class ResolutionAdaptor;
37
pbos@webrtc.org74fa4892013-08-23 09:19:3038class VideoSendStream : public webrtc::VideoSendStream,
sprang@webrtc.orgccd42842014-01-07 09:54:3439 public VideoSendStreamInput,
40 public SendStatisticsProxy::StreamStatsProvider {
pbos@webrtc.org29d58392013-05-16 12:08:0341 public:
42 VideoSendStream(newapi::Transport* transport,
mflodman@webrtc.org6879c8a2013-07-23 11:35:0043 bool overuse_detection,
pbos@webrtc.org29d58392013-05-16 12:08:0344 webrtc::VideoEngine* video_engine,
mflodman@webrtc.orgf3973e82013-12-13 09:40:4545 const VideoSendStream::Config& config,
46 int base_channel);
pbos@webrtc.org29d58392013-05-16 12:08:0347
48 virtual ~VideoSendStream();
49
pbos@webrtc.org53c85732013-11-20 11:36:4750 virtual void StartSending() OVERRIDE;
pbos@webrtc.org29d58392013-05-16 12:08:0351
pbos@webrtc.org53c85732013-11-20 11:36:4752 virtual void StopSending() OVERRIDE;
pbos@webrtc.org29d58392013-05-16 12:08:0353
pbos@webrtc.org64887612013-11-14 08:58:1454 virtual bool SetCodec(const VideoCodec& codec) OVERRIDE;
55 virtual VideoCodec GetCodec() OVERRIDE;
pbos@webrtc.org29d58392013-05-16 12:08:0356
sprang@webrtc.orgccd42842014-01-07 09:54:3457 virtual Stats GetStats() const OVERRIDE;
58
pbos@webrtc.orgbbb07e62013-08-05 12:01:3659 bool DeliverRtcp(const uint8_t* packet, size_t length);
60
sprang@webrtc.orgccd42842014-01-07 09:54:3461 // From VideoSendStreamInput.
62 virtual void PutFrame(const I420VideoFrame& frame) OVERRIDE;
63 virtual void SwapFrame(I420VideoFrame* frame) OVERRIDE;
64
65 // From webrtc::VideoSendStream.
66 virtual VideoSendStreamInput* Input() OVERRIDE;
67
68 protected:
69 // From SendStatisticsProxy::StreamStatsProvider.
70 virtual bool GetSendSideDelay(VideoSendStream::Stats* stats) OVERRIDE;
71 virtual std::string GetCName() OVERRIDE;
72
pbos@webrtc.org29d58392013-05-16 12:08:0373 private:
pbos@webrtc.org724947b2013-12-11 16:26:1674 I420VideoFrame input_frame_;
pbos@webrtc.orge75a1bf2013-09-18 11:52:4275 TransportAdapter transport_adapter_;
sprang@webrtc.org40709352013-11-26 11:41:5976 EncodedFrameCallbackAdapter encoded_frame_proxy_;
pbos@webrtc.org64887612013-11-14 08:58:1477 scoped_ptr<CriticalSectionWrapper> codec_lock_;
pbos@webrtc.org74fa4892013-08-23 09:19:3078 VideoSendStream::Config config_;
pbos@webrtc.org29d58392013-05-16 12:08:0379
80 ViEBase* video_engine_base_;
81 ViECapture* capture_;
82 ViECodec* codec_;
83 ViEExternalCapture* external_capture_;
stefan@webrtc.org360e3762013-08-22 09:29:5684 ViEExternalCodec* external_codec_;
pbos@webrtc.org29d58392013-05-16 12:08:0385 ViENetwork* network_;
86 ViERTP_RTCP* rtp_rtcp_;
pbos@webrtc.orgfe1ef932013-10-21 10:34:4387 ViEImageProcess* image_process_;
pbos@webrtc.org29d58392013-05-16 12:08:0388
89 int channel_;
90 int capture_id_;
mflodman@webrtc.org6879c8a2013-07-23 11:35:0091 scoped_ptr<ResolutionAdaptor> overuse_observer_;
sprang@webrtc.orgccd42842014-01-07 09:54:3492
93 scoped_ptr<SendStatisticsProxy> stats_proxy_;
pbos@webrtc.org29d58392013-05-16 12:08:0394};
95} // namespace internal
96} // namespace webrtc
97
mflodman@webrtc.orgf3973e82013-12-13 09:40:4598#endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_