pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 1 | /* |
| 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.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 17 | #include "webrtc/video_engine/new_include/video_receive_stream.h" |
pbos@webrtc.org | 281cff8 | 2013-05-17 13:44:48 +0000 | [diff] [blame] | 18 | #include "webrtc/video_engine/new_include/video_send_stream.h" |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | |
| 22 | class VideoEngine; |
| 23 | class ViEBase; |
| 24 | class ViECapture; |
| 25 | class ViECodec; |
| 26 | class ViEExternalCapture; |
stefan@webrtc.org | 55afdbe | 2013-08-22 09:29:56 +0000 | [diff] [blame^] | 27 | class ViEExternalCodec; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 28 | class ViENetwork; |
| 29 | class ViERTP_RTCP; |
| 30 | |
| 31 | namespace internal { |
mflodman@webrtc.org | bf76ae2 | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 32 | |
| 33 | class ResolutionAdaptor; |
| 34 | |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 35 | class VideoSendStream : public newapi::VideoSendStream, |
| 36 | public newapi::VideoSendStreamInput, |
| 37 | public webrtc::Transport { |
| 38 | public: |
| 39 | VideoSendStream(newapi::Transport* transport, |
mflodman@webrtc.org | bf76ae2 | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 40 | bool overuse_detection, |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 41 | webrtc::VideoEngine* video_engine, |
pbos@webrtc.org | 6f1c3ef | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 42 | const newapi::VideoSendStream::Config& config); |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 43 | |
| 44 | virtual ~VideoSendStream(); |
| 45 | |
pbos@webrtc.org | 08f3ca9 | 2013-05-23 12:37:11 +0000 | [diff] [blame] | 46 | virtual void PutFrame(const I420VideoFrame& frame, |
| 47 | uint32_t time_since_capture_ms) OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 48 | |
| 49 | virtual newapi::VideoSendStreamInput* Input() OVERRIDE; |
| 50 | |
| 51 | virtual void StartSend() OVERRIDE; |
| 52 | |
| 53 | virtual void StopSend() OVERRIDE; |
| 54 | |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 55 | 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.org | ce85109 | 2013-08-05 12:01:36 +0000 | [diff] [blame] | 67 | public: |
| 68 | bool DeliverRtcp(const uint8_t* packet, size_t length); |
| 69 | |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 70 | private: |
| 71 | newapi::Transport* transport_; |
pbos@webrtc.org | 6f1c3ef | 2013-06-05 11:33:21 +0000 | [diff] [blame] | 72 | newapi::VideoSendStream::Config config_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 73 | |
| 74 | ViEBase* video_engine_base_; |
| 75 | ViECapture* capture_; |
| 76 | ViECodec* codec_; |
| 77 | ViEExternalCapture* external_capture_; |
stefan@webrtc.org | 55afdbe | 2013-08-22 09:29:56 +0000 | [diff] [blame^] | 78 | ViEExternalCodec* external_codec_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 79 | ViENetwork* network_; |
| 80 | ViERTP_RTCP* rtp_rtcp_; |
| 81 | |
| 82 | int channel_; |
| 83 | int capture_id_; |
mflodman@webrtc.org | bf76ae2 | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 84 | scoped_ptr<ResolutionAdaptor> overuse_observer_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 85 | }; |
| 86 | } // namespace internal |
| 87 | } // namespace webrtc |
| 88 | |
| 89 | #endif // WEBRTC_VIDEO_ENGINE_INTERNAL_VIDEO_SEND_STREAM_H_ |