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 | |
mflodman@webrtc.org | dadfc9e | 2013-12-13 09:40:45 +0000 | [diff] [blame^] | 11 | #ifndef WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |
| 12 | #define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 13 | |
| 14 | #include <vector> |
| 15 | |
| 16 | #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
sprang@webrtc.org | 2e98d45 | 2013-11-26 11:41:59 +0000 | [diff] [blame] | 17 | #include "webrtc/video/encoded_frame_callback_adapter.h" |
pbos@webrtc.org | 24e2089 | 2013-10-28 16:32:01 +0000 | [diff] [blame] | 18 | #include "webrtc/video/transport_adapter.h" |
| 19 | #include "webrtc/video_receive_stream.h" |
| 20 | #include "webrtc/video_send_stream.h" |
pbos@webrtc.org | 6904054 | 2013-11-14 08:58:14 +0000 | [diff] [blame] | 21 | #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 22 | |
| 23 | namespace webrtc { |
| 24 | |
| 25 | class VideoEngine; |
| 26 | class ViEBase; |
| 27 | class ViECapture; |
| 28 | class ViECodec; |
| 29 | class ViEExternalCapture; |
stefan@webrtc.org | 55afdbe | 2013-08-22 09:29:56 +0000 | [diff] [blame] | 30 | class ViEExternalCodec; |
pbos@webrtc.org | 63301bd | 2013-10-21 10:34:43 +0000 | [diff] [blame] | 31 | class ViEImageProcess; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 32 | class ViENetwork; |
| 33 | class ViERTP_RTCP; |
| 34 | |
| 35 | namespace internal { |
mflodman@webrtc.org | bf76ae2 | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 36 | |
| 37 | class ResolutionAdaptor; |
| 38 | |
pbos@webrtc.org | c179706 | 2013-08-23 09:19:30 +0000 | [diff] [blame] | 39 | class VideoSendStream : public webrtc::VideoSendStream, |
pbos@webrtc.org | 1ddd57f | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 40 | public VideoSendStreamInput { |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 41 | public: |
| 42 | VideoSendStream(newapi::Transport* transport, |
mflodman@webrtc.org | bf76ae2 | 2013-07-23 11:35:00 +0000 | [diff] [blame] | 43 | bool overuse_detection, |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 44 | webrtc::VideoEngine* video_engine, |
mflodman@webrtc.org | dadfc9e | 2013-12-13 09:40:45 +0000 | [diff] [blame^] | 45 | const VideoSendStream::Config& config, |
| 46 | int base_channel); |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 47 | |
| 48 | virtual ~VideoSendStream(); |
| 49 | |
pbos@webrtc.org | c33d37c | 2013-12-11 16:26:16 +0000 | [diff] [blame] | 50 | virtual void PutFrame(const I420VideoFrame& frame) OVERRIDE; |
| 51 | |
| 52 | virtual void SwapFrame(I420VideoFrame* frame) OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 53 | |
pbos@webrtc.org | c179706 | 2013-08-23 09:19:30 +0000 | [diff] [blame] | 54 | virtual VideoSendStreamInput* Input() OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 55 | |
pbos@webrtc.org | 7f9f840 | 2013-11-20 11:36:47 +0000 | [diff] [blame] | 56 | virtual void StartSending() OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 57 | |
pbos@webrtc.org | 7f9f840 | 2013-11-20 11:36:47 +0000 | [diff] [blame] | 58 | virtual void StopSending() OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 59 | |
pbos@webrtc.org | 6904054 | 2013-11-14 08:58:14 +0000 | [diff] [blame] | 60 | virtual bool SetCodec(const VideoCodec& codec) OVERRIDE; |
| 61 | virtual VideoCodec GetCodec() OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 62 | |
pbos@webrtc.org | ce85109 | 2013-08-05 12:01:36 +0000 | [diff] [blame] | 63 | public: |
| 64 | bool DeliverRtcp(const uint8_t* packet, size_t length); |
| 65 | |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 66 | private: |
pbos@webrtc.org | c33d37c | 2013-12-11 16:26:16 +0000 | [diff] [blame] | 67 | I420VideoFrame input_frame_; |
pbos@webrtc.org | 1ddd57f | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 68 | TransportAdapter transport_adapter_; |
sprang@webrtc.org | 2e98d45 | 2013-11-26 11:41:59 +0000 | [diff] [blame] | 69 | EncodedFrameCallbackAdapter encoded_frame_proxy_; |
pbos@webrtc.org | 6904054 | 2013-11-14 08:58:14 +0000 | [diff] [blame] | 70 | scoped_ptr<CriticalSectionWrapper> codec_lock_; |
pbos@webrtc.org | c179706 | 2013-08-23 09:19:30 +0000 | [diff] [blame] | 71 | VideoSendStream::Config config_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 72 | |
| 73 | ViEBase* video_engine_base_; |
| 74 | ViECapture* capture_; |
| 75 | ViECodec* codec_; |
| 76 | ViEExternalCapture* external_capture_; |
stefan@webrtc.org | 55afdbe | 2013-08-22 09:29:56 +0000 | [diff] [blame] | 77 | ViEExternalCodec* external_codec_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 78 | ViENetwork* network_; |
| 79 | ViERTP_RTCP* rtp_rtcp_; |
pbos@webrtc.org | 63301bd | 2013-10-21 10:34:43 +0000 | [diff] [blame] | 80 | ViEImageProcess* image_process_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 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 | |
mflodman@webrtc.org | dadfc9e | 2013-12-13 09:40:45 +0000 | [diff] [blame^] | 89 | #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |