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 | |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 14 | #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
sprang@webrtc.org | 2e98d45 | 2013-11-26 11:41:59 +0000 | [diff] [blame] | 15 | #include "webrtc/video/encoded_frame_callback_adapter.h" |
sprang@webrtc.org | 49812e6 | 2014-01-07 09:54:34 +0000 | [diff] [blame] | 16 | #include "webrtc/video/send_statistics_proxy.h" |
pbos@webrtc.org | 24e2089 | 2013-10-28 16:32:01 +0000 | [diff] [blame] | 17 | #include "webrtc/video/transport_adapter.h" |
| 18 | #include "webrtc/video_receive_stream.h" |
| 19 | #include "webrtc/video_send_stream.h" |
pbos@webrtc.org | 6904054 | 2013-11-14 08:58:14 +0000 | [diff] [blame] | 20 | #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 21 | |
| 22 | namespace webrtc { |
| 23 | |
asapersson@webrtc.org | 8ef6548 | 2014-01-31 10:05:07 +0000 | [diff] [blame] | 24 | class CpuOveruseObserver; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 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 | |
pbos@webrtc.org | c179706 | 2013-08-23 09:19:30 +0000 | [diff] [blame] | 37 | class VideoSendStream : public webrtc::VideoSendStream, |
sprang@webrtc.org | 49812e6 | 2014-01-07 09:54:34 +0000 | [diff] [blame] | 38 | public VideoSendStreamInput, |
sprang@webrtc.org | c8ab721 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 39 | public SendStatisticsProxy::StatsProvider { |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 40 | public: |
| 41 | VideoSendStream(newapi::Transport* transport, |
asapersson@webrtc.org | 8ef6548 | 2014-01-31 10:05:07 +0000 | [diff] [blame] | 42 | CpuOveruseObserver* overuse_observer, |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 43 | webrtc::VideoEngine* video_engine, |
mflodman@webrtc.org | dadfc9e | 2013-12-13 09:40:45 +0000 | [diff] [blame] | 44 | const VideoSendStream::Config& config, |
| 45 | int base_channel); |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 46 | |
| 47 | virtual ~VideoSendStream(); |
| 48 | |
pbos@webrtc.org | 7f9f840 | 2013-11-20 11:36:47 +0000 | [diff] [blame] | 49 | virtual void StartSending() OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 50 | |
pbos@webrtc.org | 7f9f840 | 2013-11-20 11:36:47 +0000 | [diff] [blame] | 51 | virtual void StopSending() OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 52 | |
pbos@webrtc.org | 6904054 | 2013-11-14 08:58:14 +0000 | [diff] [blame] | 53 | virtual bool SetCodec(const VideoCodec& codec) OVERRIDE; |
| 54 | virtual VideoCodec GetCodec() OVERRIDE; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 55 | |
sprang@webrtc.org | 49812e6 | 2014-01-07 09:54:34 +0000 | [diff] [blame] | 56 | virtual Stats GetStats() const OVERRIDE; |
| 57 | |
pbos@webrtc.org | ce85109 | 2013-08-05 12:01:36 +0000 | [diff] [blame] | 58 | bool DeliverRtcp(const uint8_t* packet, size_t length); |
| 59 | |
sprang@webrtc.org | 49812e6 | 2014-01-07 09:54:34 +0000 | [diff] [blame] | 60 | // From VideoSendStreamInput. |
| 61 | virtual void PutFrame(const I420VideoFrame& frame) OVERRIDE; |
| 62 | virtual void SwapFrame(I420VideoFrame* frame) OVERRIDE; |
| 63 | |
| 64 | // From webrtc::VideoSendStream. |
| 65 | virtual VideoSendStreamInput* Input() OVERRIDE; |
| 66 | |
| 67 | protected: |
| 68 | // From SendStatisticsProxy::StreamStatsProvider. |
| 69 | virtual bool GetSendSideDelay(VideoSendStream::Stats* stats) OVERRIDE; |
| 70 | virtual std::string GetCName() OVERRIDE; |
| 71 | |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 72 | private: |
pbos@webrtc.org | c33d37c | 2013-12-11 16:26:16 +0000 | [diff] [blame] | 73 | I420VideoFrame input_frame_; |
pbos@webrtc.org | 1ddd57f | 2013-09-18 11:52:42 +0000 | [diff] [blame] | 74 | TransportAdapter transport_adapter_; |
sprang@webrtc.org | 2e98d45 | 2013-11-26 11:41:59 +0000 | [diff] [blame] | 75 | EncodedFrameCallbackAdapter encoded_frame_proxy_; |
pbos@webrtc.org | 6904054 | 2013-11-14 08:58:14 +0000 | [diff] [blame] | 76 | scoped_ptr<CriticalSectionWrapper> codec_lock_; |
pbos@webrtc.org | c179706 | 2013-08-23 09:19:30 +0000 | [diff] [blame] | 77 | VideoSendStream::Config config_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 78 | |
| 79 | ViEBase* video_engine_base_; |
| 80 | ViECapture* capture_; |
| 81 | ViECodec* codec_; |
| 82 | ViEExternalCapture* external_capture_; |
stefan@webrtc.org | 55afdbe | 2013-08-22 09:29:56 +0000 | [diff] [blame] | 83 | ViEExternalCodec* external_codec_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 84 | ViENetwork* network_; |
| 85 | ViERTP_RTCP* rtp_rtcp_; |
pbos@webrtc.org | 63301bd | 2013-10-21 10:34:43 +0000 | [diff] [blame] | 86 | ViEImageProcess* image_process_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 87 | |
| 88 | int channel_; |
| 89 | int capture_id_; |
sprang@webrtc.org | 49812e6 | 2014-01-07 09:54:34 +0000 | [diff] [blame] | 90 | |
| 91 | scoped_ptr<SendStatisticsProxy> stats_proxy_; |
pbos@webrtc.org | 2a9108f | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 92 | }; |
| 93 | } // namespace internal |
| 94 | } // namespace webrtc |
| 95 | |
mflodman@webrtc.org | dadfc9e | 2013-12-13 09:40:45 +0000 | [diff] [blame] | 96 | #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |