blob: addb045def2952f663b9c304bc7c9609c8552123 [file] [log] [blame]
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +00001/*
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_ENGINE_VIDEO_SEND_STREAM_IMPL_H_
12#define WEBRTC_VIDEO_ENGINE_VIDEO_SEND_STREAM_IMPL_H_
13
14#include <vector>
15
16#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
sprang@webrtc.org2e98d452013-11-26 11:41:59 +000017#include "webrtc/video/encoded_frame_callback_adapter.h"
pbos@webrtc.org24e20892013-10-28 16:32:01 +000018#include "webrtc/video/transport_adapter.h"
19#include "webrtc/video_receive_stream.h"
20#include "webrtc/video_send_stream.h"
pbos@webrtc.org69040542013-11-14 08:58:14 +000021#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000022
23namespace webrtc {
24
25class VideoEngine;
26class ViEBase;
27class ViECapture;
28class ViECodec;
29class ViEExternalCapture;
stefan@webrtc.org55afdbe2013-08-22 09:29:56 +000030class ViEExternalCodec;
pbos@webrtc.org63301bd2013-10-21 10:34:43 +000031class ViEImageProcess;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000032class ViENetwork;
33class ViERTP_RTCP;
34
35namespace internal {
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000036
37class ResolutionAdaptor;
38
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000039class VideoSendStream : public webrtc::VideoSendStream,
pbos@webrtc.org1ddd57f2013-09-18 11:52:42 +000040 public VideoSendStreamInput {
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000041 public:
42 VideoSendStream(newapi::Transport* transport,
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000043 bool overuse_detection,
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000044 webrtc::VideoEngine* video_engine,
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000045 const VideoSendStream::Config& config);
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000046
47 virtual ~VideoSendStream();
48
pbos@webrtc.orgc33d37c2013-12-11 16:26:16 +000049 virtual void PutFrame(const I420VideoFrame& frame) OVERRIDE;
50
51 virtual void SwapFrame(I420VideoFrame* frame) OVERRIDE;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000052
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000053 virtual VideoSendStreamInput* Input() OVERRIDE;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000054
pbos@webrtc.org7f9f8402013-11-20 11:36:47 +000055 virtual void StartSending() OVERRIDE;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000056
pbos@webrtc.org7f9f8402013-11-20 11:36:47 +000057 virtual void StopSending() OVERRIDE;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000058
pbos@webrtc.org69040542013-11-14 08:58:14 +000059 virtual bool SetCodec(const VideoCodec& codec) OVERRIDE;
60 virtual VideoCodec GetCodec() OVERRIDE;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000061
pbos@webrtc.orgce851092013-08-05 12:01:36 +000062 public:
63 bool DeliverRtcp(const uint8_t* packet, size_t length);
64
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000065 private:
pbos@webrtc.orgc33d37c2013-12-11 16:26:16 +000066 I420VideoFrame input_frame_;
pbos@webrtc.org1ddd57f2013-09-18 11:52:42 +000067 TransportAdapter transport_adapter_;
sprang@webrtc.org2e98d452013-11-26 11:41:59 +000068 EncodedFrameCallbackAdapter encoded_frame_proxy_;
pbos@webrtc.org69040542013-11-14 08:58:14 +000069 scoped_ptr<CriticalSectionWrapper> codec_lock_;
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000070 VideoSendStream::Config config_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000071
72 ViEBase* video_engine_base_;
73 ViECapture* capture_;
74 ViECodec* codec_;
75 ViEExternalCapture* external_capture_;
stefan@webrtc.org55afdbe2013-08-22 09:29:56 +000076 ViEExternalCodec* external_codec_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000077 ViENetwork* network_;
78 ViERTP_RTCP* rtp_rtcp_;
pbos@webrtc.org63301bd2013-10-21 10:34:43 +000079 ViEImageProcess* image_process_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000080
81 int channel_;
82 int capture_id_;
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000083 scoped_ptr<ResolutionAdaptor> overuse_observer_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000084};
85} // namespace internal
86} // namespace webrtc
87
88#endif // WEBRTC_VIDEO_ENGINE_INTERNAL_VIDEO_SEND_STREAM_H_