blob: bd3494f507bafcd49e58ad07213092fc61c49f88 [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;
stefan@webrtc.org55afdbe2013-08-22 09:29:56 +000027class ViEExternalCodec;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000028class ViENetwork;
29class ViERTP_RTCP;
30
31namespace internal {
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000032
33class ResolutionAdaptor;
34
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000035class VideoSendStream : public webrtc::VideoSendStream,
36 public VideoSendStreamInput,
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000037 public webrtc::Transport {
38 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
61 virtual int SendPacket(int /*channel*/, const void* packet, int length)
62 OVERRIDE;
63
64 virtual int SendRTCPPacket(int /*channel*/, const void* packet, int length)
65 OVERRIDE;
66
pbos@webrtc.orgce851092013-08-05 12:01:36 +000067 public:
68 bool DeliverRtcp(const uint8_t* packet, size_t length);
69
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000070 private:
71 newapi::Transport* transport_;
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000072 VideoSendStream::Config config_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000073
74 ViEBase* video_engine_base_;
75 ViECapture* capture_;
76 ViECodec* codec_;
77 ViEExternalCapture* external_capture_;
stefan@webrtc.org55afdbe2013-08-22 09:29:56 +000078 ViEExternalCodec* external_codec_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000079 ViENetwork* network_;
80 ViERTP_RTCP* rtp_rtcp_;
81
82 int channel_;
83 int capture_id_;
mflodman@webrtc.orgbf76ae22013-07-23 11:35:00 +000084 scoped_ptr<ResolutionAdaptor> overuse_observer_;
pbos@webrtc.org2a9108f2013-05-16 12:08:03 +000085};
86} // namespace internal
87} // namespace webrtc
88
89#endif // WEBRTC_VIDEO_ENGINE_INTERNAL_VIDEO_SEND_STREAM_H_