blob: 571f42829131629204c9d2b56926e1d3f3033b71 [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.org2a9108f2013-05-16 12:08:03 +000017#include "webrtc/video_engine/new_include/video_receive_stream.h"
pbos@webrtc.org281cff82013-05-17 13:44:48 +000018#include "webrtc/video_engine/new_include/video_send_stream.h"
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000019
20namespace webrtc {
21
22class VideoEngine;
23class ViEBase;
24class ViECapture;
25class ViECodec;
26class ViEExternalCapture;
27class ViENetwork;
28class ViERTP_RTCP;
29
30namespace internal {
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000031
32class ResolutionAdaptor;
33
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000034class VideoSendStream : public newapi::VideoSendStream,
35 public newapi::VideoSendStreamInput,
36 public webrtc::Transport {
37 public:
38 VideoSendStream(newapi::Transport* transport,
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000039 bool overuse_detection,
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000040 webrtc::VideoEngine* video_engine,
pbos@webrtc.org6f1c3ef2013-06-05 11:33:21 +000041 const newapi::VideoSendStream::Config& config);
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000042
43 virtual ~VideoSendStream();
44
pbos@webrtc.org08f3ca92013-05-23 12:37:11 +000045 virtual void PutFrame(const I420VideoFrame& frame,
46 uint32_t time_since_capture_ms) OVERRIDE;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000047
48 virtual newapi::VideoSendStreamInput* Input() OVERRIDE;
49
50 virtual void StartSend() OVERRIDE;
51
52 virtual void StopSend() OVERRIDE;
53
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000054 virtual bool SetTargetBitrate(int min_bitrate, int max_bitrate,
55 const std::vector<SimulcastStream>& streams)
56 OVERRIDE;
57
58 virtual void GetSendCodec(VideoCodec* send_codec) OVERRIDE;
59
60 virtual int SendPacket(int /*channel*/, const void* packet, int length)
61 OVERRIDE;
62
63 virtual int SendRTCPPacket(int /*channel*/, const void* packet, int length)
64 OVERRIDE;
65
66 private:
67 newapi::Transport* transport_;
pbos@webrtc.org6f1c3ef2013-06-05 11:33:21 +000068 newapi::VideoSendStream::Config config_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000069
70 ViEBase* video_engine_base_;
71 ViECapture* capture_;
72 ViECodec* codec_;
73 ViEExternalCapture* external_capture_;
74 ViENetwork* network_;
75 ViERTP_RTCP* rtp_rtcp_;
76
77 int channel_;
78 int capture_id_;
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000079 scoped_ptr<ResolutionAdaptor> overuse_observer_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000080};
81} // namespace internal
82} // namespace webrtc
83
84#endif // WEBRTC_VIDEO_ENGINE_INTERNAL_VIDEO_SEND_STREAM_H_