blob: 1241b483d45dc5646bc3ebd03dfd920f40f50d73 [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"
pbos@webrtc.org1ddd57f2013-09-18 11:52:42 +000017#include "webrtc/video_engine/internal/transport_adapter.h"
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000018#include "webrtc/video_engine/new_include/video_receive_stream.h"
pbos@webrtc.org281cff82013-05-17 13:44:48 +000019#include "webrtc/video_engine/new_include/video_send_stream.h"
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000020
21namespace webrtc {
22
23class VideoEngine;
24class ViEBase;
25class ViECapture;
26class ViECodec;
27class ViEExternalCapture;
stefan@webrtc.org55afdbe2013-08-22 09:29:56 +000028class ViEExternalCodec;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000029class ViENetwork;
30class ViERTP_RTCP;
31
32namespace internal {
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000033
34class ResolutionAdaptor;
35
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000036class VideoSendStream : public webrtc::VideoSendStream,
pbos@webrtc.org1ddd57f2013-09-18 11:52:42 +000037 public VideoSendStreamInput {
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000038 public:
39 VideoSendStream(newapi::Transport* transport,
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000040 bool overuse_detection,
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000041 webrtc::VideoEngine* video_engine,
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000042 const VideoSendStream::Config& config);
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000043
44 virtual ~VideoSendStream();
45
pbos@webrtc.org08f3ca92013-05-23 12:37:11 +000046 virtual void PutFrame(const I420VideoFrame& frame,
47 uint32_t time_since_capture_ms) OVERRIDE;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000048
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000049 virtual VideoSendStreamInput* Input() OVERRIDE;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000050
51 virtual void StartSend() OVERRIDE;
52
53 virtual void StopSend() OVERRIDE;
54
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000055 virtual bool SetTargetBitrate(int min_bitrate, int max_bitrate,
56 const std::vector<SimulcastStream>& streams)
57 OVERRIDE;
58
59 virtual void GetSendCodec(VideoCodec* send_codec) OVERRIDE;
60
pbos@webrtc.orgce851092013-08-05 12:01:36 +000061 public:
62 bool DeliverRtcp(const uint8_t* packet, size_t length);
63
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000064 private:
pbos@webrtc.org1ddd57f2013-09-18 11:52:42 +000065 TransportAdapter transport_adapter_;
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000066 VideoSendStream::Config config_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000067
68 ViEBase* video_engine_base_;
69 ViECapture* capture_;
70 ViECodec* codec_;
71 ViEExternalCapture* external_capture_;
stefan@webrtc.org55afdbe2013-08-22 09:29:56 +000072 ViEExternalCodec* external_codec_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000073 ViENetwork* network_;
74 ViERTP_RTCP* rtp_rtcp_;
75
76 int channel_;
77 int capture_id_;
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000078 scoped_ptr<ResolutionAdaptor> overuse_observer_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000079};
80} // namespace internal
81} // namespace webrtc
82
83#endif // WEBRTC_VIDEO_ENGINE_INTERNAL_VIDEO_SEND_STREAM_H_