pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [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 | f3973e8 | 2013-12-13 09:40:45 | [diff] [blame] | 11 | #ifndef WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |
| 12 | #define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 13 | |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 14 | #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
sprang@webrtc.org | 4070935 | 2013-11-26 11:41:59 | [diff] [blame] | 15 | #include "webrtc/video/encoded_frame_callback_adapter.h" |
sprang@webrtc.org | ccd4284 | 2014-01-07 09:54:34 | [diff] [blame^] | 16 | #include "webrtc/video/send_statistics_proxy.h" |
pbos@webrtc.org | 16e03b7 | 2013-10-28 16:32:01 | [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 | 6488761 | 2013-11-14 08:58:14 | [diff] [blame] | 20 | #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 21 | |
| 22 | namespace webrtc { |
| 23 | |
| 24 | class VideoEngine; |
| 25 | class ViEBase; |
| 26 | class ViECapture; |
| 27 | class ViECodec; |
| 28 | class ViEExternalCapture; |
stefan@webrtc.org | 360e376 | 2013-08-22 09:29:56 | [diff] [blame] | 29 | class ViEExternalCodec; |
pbos@webrtc.org | fe1ef93 | 2013-10-21 10:34:43 | [diff] [blame] | 30 | class ViEImageProcess; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 31 | class ViENetwork; |
| 32 | class ViERTP_RTCP; |
| 33 | |
| 34 | namespace internal { |
mflodman@webrtc.org | 6879c8a | 2013-07-23 11:35:00 | [diff] [blame] | 35 | |
| 36 | class ResolutionAdaptor; |
| 37 | |
pbos@webrtc.org | 74fa489 | 2013-08-23 09:19:30 | [diff] [blame] | 38 | class VideoSendStream : public webrtc::VideoSendStream, |
sprang@webrtc.org | ccd4284 | 2014-01-07 09:54:34 | [diff] [blame^] | 39 | public VideoSendStreamInput, |
| 40 | public SendStatisticsProxy::StreamStatsProvider { |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 41 | public: |
| 42 | VideoSendStream(newapi::Transport* transport, |
mflodman@webrtc.org | 6879c8a | 2013-07-23 11:35:00 | [diff] [blame] | 43 | bool overuse_detection, |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 44 | webrtc::VideoEngine* video_engine, |
mflodman@webrtc.org | f3973e8 | 2013-12-13 09:40:45 | [diff] [blame] | 45 | const VideoSendStream::Config& config, |
| 46 | int base_channel); |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 47 | |
| 48 | virtual ~VideoSendStream(); |
| 49 | |
pbos@webrtc.org | 53c8573 | 2013-11-20 11:36:47 | [diff] [blame] | 50 | virtual void StartSending() OVERRIDE; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 51 | |
pbos@webrtc.org | 53c8573 | 2013-11-20 11:36:47 | [diff] [blame] | 52 | virtual void StopSending() OVERRIDE; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 53 | |
pbos@webrtc.org | 6488761 | 2013-11-14 08:58:14 | [diff] [blame] | 54 | virtual bool SetCodec(const VideoCodec& codec) OVERRIDE; |
| 55 | virtual VideoCodec GetCodec() OVERRIDE; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 56 | |
sprang@webrtc.org | ccd4284 | 2014-01-07 09:54:34 | [diff] [blame^] | 57 | virtual Stats GetStats() const OVERRIDE; |
| 58 | |
pbos@webrtc.org | bbb07e6 | 2013-08-05 12:01:36 | [diff] [blame] | 59 | bool DeliverRtcp(const uint8_t* packet, size_t length); |
| 60 | |
sprang@webrtc.org | ccd4284 | 2014-01-07 09:54:34 | [diff] [blame^] | 61 | // From VideoSendStreamInput. |
| 62 | virtual void PutFrame(const I420VideoFrame& frame) OVERRIDE; |
| 63 | virtual void SwapFrame(I420VideoFrame* frame) OVERRIDE; |
| 64 | |
| 65 | // From webrtc::VideoSendStream. |
| 66 | virtual VideoSendStreamInput* Input() OVERRIDE; |
| 67 | |
| 68 | protected: |
| 69 | // From SendStatisticsProxy::StreamStatsProvider. |
| 70 | virtual bool GetSendSideDelay(VideoSendStream::Stats* stats) OVERRIDE; |
| 71 | virtual std::string GetCName() OVERRIDE; |
| 72 | |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 73 | private: |
pbos@webrtc.org | 724947b | 2013-12-11 16:26:16 | [diff] [blame] | 74 | I420VideoFrame input_frame_; |
pbos@webrtc.org | e75a1bf | 2013-09-18 11:52:42 | [diff] [blame] | 75 | TransportAdapter transport_adapter_; |
sprang@webrtc.org | 4070935 | 2013-11-26 11:41:59 | [diff] [blame] | 76 | EncodedFrameCallbackAdapter encoded_frame_proxy_; |
pbos@webrtc.org | 6488761 | 2013-11-14 08:58:14 | [diff] [blame] | 77 | scoped_ptr<CriticalSectionWrapper> codec_lock_; |
pbos@webrtc.org | 74fa489 | 2013-08-23 09:19:30 | [diff] [blame] | 78 | VideoSendStream::Config config_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 79 | |
| 80 | ViEBase* video_engine_base_; |
| 81 | ViECapture* capture_; |
| 82 | ViECodec* codec_; |
| 83 | ViEExternalCapture* external_capture_; |
stefan@webrtc.org | 360e376 | 2013-08-22 09:29:56 | [diff] [blame] | 84 | ViEExternalCodec* external_codec_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 85 | ViENetwork* network_; |
| 86 | ViERTP_RTCP* rtp_rtcp_; |
pbos@webrtc.org | fe1ef93 | 2013-10-21 10:34:43 | [diff] [blame] | 87 | ViEImageProcess* image_process_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 88 | |
| 89 | int channel_; |
| 90 | int capture_id_; |
mflodman@webrtc.org | 6879c8a | 2013-07-23 11:35:00 | [diff] [blame] | 91 | scoped_ptr<ResolutionAdaptor> overuse_observer_; |
sprang@webrtc.org | ccd4284 | 2014-01-07 09:54:34 | [diff] [blame^] | 92 | |
| 93 | scoped_ptr<SendStatisticsProxy> stats_proxy_; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 | [diff] [blame] | 94 | }; |
| 95 | } // namespace internal |
| 96 | } // namespace webrtc |
| 97 | |
mflodman@webrtc.org | f3973e8 | 2013-12-13 09:40:45 | [diff] [blame] | 98 | #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |