pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 1 | /* |
| 2 | * libjingle |
| 3 | * Copyright 2014 Google Inc. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions are met: |
| 7 | * |
| 8 | * 1. Redistributions of source code must retain the above copyright notice, |
| 9 | * this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| 11 | * this list of conditions and the following disclaimer in the documentation |
| 12 | * and/or other materials provided with the distribution. |
| 13 | * 3. The name of the author may not be used to endorse or promote products |
| 14 | * derived from this software without specific prior written permission. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
| 19 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 21 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 22 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 24 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 25 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | */ |
| 27 | |
| 28 | #ifndef TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ |
| 29 | #define TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ |
| 30 | |
| 31 | #include <map> |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 32 | #include <string> |
buildbot@webrtc.org | a09a999 | 2014-08-13 17:26:08 +0000 | [diff] [blame] | 33 | #include <vector> |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 34 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 35 | #include "talk/media/base/mediaengine.h" |
| 36 | #include "talk/media/webrtc/webrtcvideochannelfactory.h" |
pbos@webrtc.org | 0a2087a | 2014-09-23 09:40:22 +0000 | [diff] [blame] | 37 | #include "talk/media/webrtc/webrtcvideodecoderfactory.h" |
| 38 | #include "talk/media/webrtc/webrtcvideoencoderfactory.h" |
buildbot@webrtc.org | a09a999 | 2014-08-13 17:26:08 +0000 | [diff] [blame] | 39 | #include "webrtc/base/cpumonitor.h" |
pbos@webrtc.org | 575d126 | 2014-10-08 14:48:08 +0000 | [diff] [blame] | 40 | #include "webrtc/base/criticalsection.h" |
buildbot@webrtc.org | a09a999 | 2014-08-13 17:26:08 +0000 | [diff] [blame] | 41 | #include "webrtc/base/scoped_ptr.h" |
pbos@webrtc.org | 38344ed | 2014-09-24 06:05:00 +0000 | [diff] [blame] | 42 | #include "webrtc/base/thread_annotations.h" |
pbos@webrtc.org | 42684be | 2014-10-03 11:25:45 +0000 | [diff] [blame] | 43 | #include "webrtc/call.h" |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 44 | #include "webrtc/common_video/interface/i420_video_frame.h" |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 45 | #include "webrtc/transport.h" |
buildbot@webrtc.org | a09a999 | 2014-08-13 17:26:08 +0000 | [diff] [blame] | 46 | #include "webrtc/video_receive_stream.h" |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 47 | #include "webrtc/video_renderer.h" |
| 48 | #include "webrtc/video_send_stream.h" |
| 49 | |
| 50 | namespace webrtc { |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 51 | class VideoDecoder; |
| 52 | class VideoEncoder; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 53 | } |
| 54 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 55 | namespace rtc { |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 56 | class CpuMonitor; |
| 57 | class Thread; |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 58 | } // namespace rtc |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 59 | |
| 60 | namespace cricket { |
| 61 | |
| 62 | class VideoCapturer; |
| 63 | class VideoFrame; |
| 64 | class VideoProcessor; |
| 65 | class VideoRenderer; |
| 66 | class VoiceMediaChannel; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 67 | class WebRtcDecoderObserver; |
| 68 | class WebRtcEncoderObserver; |
| 69 | class WebRtcLocalStreamInfo; |
| 70 | class WebRtcRenderAdapter; |
| 71 | class WebRtcVideoChannelRecvInfo; |
| 72 | class WebRtcVideoChannelSendInfo; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 73 | class WebRtcVoiceEngine; |
| 74 | |
| 75 | struct CapturedFrame; |
| 76 | struct Device; |
| 77 | |
pbos@webrtc.org | afb554f4 | 2014-08-12 23:17:13 +0000 | [diff] [blame] | 78 | class UnsignalledSsrcHandler { |
| 79 | public: |
| 80 | enum Action { |
| 81 | kDropPacket, |
| 82 | kDeliverPacket, |
| 83 | }; |
pbos@webrtc.org | a2a6fe6 | 2015-03-06 15:35:19 +0000 | [diff] [blame] | 84 | virtual Action OnUnsignalledSsrc(WebRtcVideoChannel2* channel, |
pbos@webrtc.org | afb554f4 | 2014-08-12 23:17:13 +0000 | [diff] [blame] | 85 | uint32_t ssrc) = 0; |
| 86 | }; |
| 87 | |
| 88 | // TODO(pbos): Remove, use external handlers only. |
| 89 | class DefaultUnsignalledSsrcHandler : public UnsignalledSsrcHandler { |
| 90 | public: |
| 91 | DefaultUnsignalledSsrcHandler(); |
pbos@webrtc.org | a2a6fe6 | 2015-03-06 15:35:19 +0000 | [diff] [blame] | 92 | Action OnUnsignalledSsrc(WebRtcVideoChannel2* channel, |
| 93 | uint32_t ssrc) override; |
pbos@webrtc.org | afb554f4 | 2014-08-12 23:17:13 +0000 | [diff] [blame] | 94 | |
| 95 | VideoRenderer* GetDefaultRenderer() const; |
| 96 | void SetDefaultRenderer(VideoMediaChannel* channel, VideoRenderer* renderer); |
| 97 | |
| 98 | private: |
| 99 | uint32_t default_recv_ssrc_; |
| 100 | VideoRenderer* default_renderer_; |
| 101 | }; |
| 102 | |
pbos@webrtc.org | 42684be | 2014-10-03 11:25:45 +0000 | [diff] [blame] | 103 | // CallFactory, overridden for testing to verify that webrtc::Call is configured |
| 104 | // properly. |
| 105 | class WebRtcCallFactory { |
| 106 | public: |
| 107 | virtual ~WebRtcCallFactory(); |
| 108 | virtual webrtc::Call* CreateCall(const webrtc::Call::Config& config); |
| 109 | }; |
| 110 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 111 | // WebRtcVideoEngine2 is used for the new native WebRTC Video API (webrtc:1667). |
buildbot@webrtc.org | 3c16d8b | 2014-10-13 06:35:10 +0000 | [diff] [blame] | 112 | class WebRtcVideoEngine2 : public sigslot::has_slots<> { |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 113 | public: |
pbos@webrtc.org | f1f0d9a | 2015-03-02 13:30:15 +0000 | [diff] [blame] | 114 | explicit WebRtcVideoEngine2(WebRtcVoiceEngine* voice_engine); |
pbos@webrtc.org | b648b9d | 2014-08-26 11:08:06 +0000 | [diff] [blame] | 115 | virtual ~WebRtcVideoEngine2(); |
| 116 | |
pbos@webrtc.org | 42684be | 2014-10-03 11:25:45 +0000 | [diff] [blame] | 117 | // Used for testing to be able to check and use the webrtc::Call config. |
| 118 | void SetCallFactory(WebRtcCallFactory* call_factory); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 119 | |
| 120 | // Basic video engine implementation. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 121 | bool Init(rtc::Thread* worker_thread); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 122 | void Terminate(); |
| 123 | |
| 124 | int GetCapabilities(); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 125 | bool SetDefaultEncoderConfig(const VideoEncoderConfig& config); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 126 | |
buildbot@webrtc.org | 1ecbe45 | 2014-10-14 20:29:28 +0000 | [diff] [blame] | 127 | WebRtcVideoChannel2* CreateChannel(const VideoOptions& options, |
| 128 | VoiceMediaChannel* voice_channel); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 129 | |
| 130 | const std::vector<VideoCodec>& codecs() const; |
| 131 | const std::vector<RtpHeaderExtension>& rtp_header_extensions() const; |
| 132 | void SetLogging(int min_sev, const char* filter); |
| 133 | |
pbos@webrtc.org | 0a2087a | 2014-09-23 09:40:22 +0000 | [diff] [blame] | 134 | // Set a WebRtcVideoDecoderFactory for external decoding. Video engine does |
| 135 | // not take the ownership of |decoder_factory|. The caller needs to make sure |
| 136 | // that |decoder_factory| outlives the video engine. |
| 137 | void SetExternalDecoderFactory(WebRtcVideoDecoderFactory* decoder_factory); |
| 138 | // Set a WebRtcVideoEncoderFactory for external encoding. Video engine does |
| 139 | // not take the ownership of |encoder_factory|. The caller needs to make sure |
| 140 | // that |encoder_factory| outlives the video engine. |
| 141 | virtual void SetExternalEncoderFactory( |
| 142 | WebRtcVideoEncoderFactory* encoder_factory); |
| 143 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 144 | bool EnableTimedRender(); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 145 | // This is currently ignored. |
| 146 | sigslot::repeater2<VideoCapturer*, CaptureState> SignalCaptureStateChange; |
| 147 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 148 | bool FindCodec(const VideoCodec& in); |
| 149 | bool CanSendCodec(const VideoCodec& in, |
| 150 | const VideoCodec& current, |
| 151 | VideoCodec* out); |
| 152 | // Check whether the supplied trace should be ignored. |
| 153 | bool ShouldIgnoreTrace(const std::string& trace); |
| 154 | |
buildbot@webrtc.org | 992febb | 2014-09-05 16:39:08 +0000 | [diff] [blame] | 155 | VideoFormat GetStartCaptureFormat() const { return default_codec_format_; } |
| 156 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 157 | private: |
pbos@webrtc.org | 7fe1e03 | 2014-10-14 04:25:33 +0000 | [diff] [blame] | 158 | std::vector<VideoCodec> GetSupportedCodecs() const; |
| 159 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 160 | rtc::Thread* worker_thread_; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 161 | WebRtcVoiceEngine* voice_engine_; |
| 162 | std::vector<VideoCodec> video_codecs_; |
| 163 | std::vector<RtpHeaderExtension> rtp_header_extensions_; |
buildbot@webrtc.org | 992febb | 2014-09-05 16:39:08 +0000 | [diff] [blame] | 164 | VideoFormat default_codec_format_; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 165 | |
| 166 | bool initialized_; |
| 167 | |
pbos@webrtc.org | 42684be | 2014-10-03 11:25:45 +0000 | [diff] [blame] | 168 | WebRtcCallFactory default_call_factory_; |
| 169 | WebRtcCallFactory* call_factory_; |
| 170 | |
pbos@webrtc.org | 0a2087a | 2014-09-23 09:40:22 +0000 | [diff] [blame] | 171 | WebRtcVideoDecoderFactory* external_decoder_factory_; |
| 172 | WebRtcVideoEncoderFactory* external_encoder_factory_; |
pbos@webrtc.org | f18fba2 | 2015-01-14 16:26:23 +0000 | [diff] [blame] | 173 | rtc::scoped_ptr<WebRtcVideoEncoderFactory> simulcast_encoder_factory_; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 174 | }; |
| 175 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 176 | class WebRtcVideoChannel2 : public rtc::MessageHandler, |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 177 | public VideoMediaChannel, |
pbos@webrtc.org | 42684be | 2014-10-03 11:25:45 +0000 | [diff] [blame] | 178 | public webrtc::newapi::Transport, |
| 179 | public webrtc::LoadObserver { |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 180 | public: |
pbos@webrtc.org | 42684be | 2014-10-03 11:25:45 +0000 | [diff] [blame] | 181 | WebRtcVideoChannel2(WebRtcCallFactory* call_factory, |
pbos@webrtc.org | 3bf3d23 | 2014-10-31 12:59:34 +0000 | [diff] [blame] | 182 | WebRtcVoiceEngine* voice_engine, |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 183 | VoiceMediaChannel* voice_channel, |
pbos@webrtc.org | fa553ef | 2014-10-20 11:07:07 +0000 | [diff] [blame] | 184 | const VideoOptions& options, |
pbos@webrtc.org | 7fe1e03 | 2014-10-14 04:25:33 +0000 | [diff] [blame] | 185 | WebRtcVideoEncoderFactory* external_encoder_factory, |
pbos@webrtc.org | f1c8b90 | 2015-01-14 17:29:27 +0000 | [diff] [blame] | 186 | WebRtcVideoDecoderFactory* external_decoder_factory); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 187 | ~WebRtcVideoChannel2(); |
| 188 | bool Init(); |
| 189 | |
| 190 | // VideoMediaChannel implementation |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 191 | bool SetRecvCodecs(const std::vector<VideoCodec>& codecs) override; |
| 192 | bool SetSendCodecs(const std::vector<VideoCodec>& codecs) override; |
| 193 | bool GetSendCodec(VideoCodec* send_codec) override; |
| 194 | bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) override; |
| 195 | bool SetRender(bool render) override; |
| 196 | bool SetSend(bool send) override; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 197 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 198 | bool AddSendStream(const StreamParams& sp) override; |
| 199 | bool RemoveSendStream(uint32 ssrc) override; |
| 200 | bool AddRecvStream(const StreamParams& sp) override; |
pbos@webrtc.org | a2a6fe6 | 2015-03-06 15:35:19 +0000 | [diff] [blame] | 201 | bool AddRecvStream(const StreamParams& sp, bool default_stream); |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 202 | bool RemoveRecvStream(uint32 ssrc) override; |
| 203 | bool SetRenderer(uint32 ssrc, VideoRenderer* renderer) override; |
| 204 | bool GetStats(VideoMediaInfo* info) override; |
| 205 | bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) override; |
| 206 | bool SendIntraFrame() override; |
| 207 | bool RequestIntraFrame() override; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 208 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 209 | void OnPacketReceived(rtc::Buffer* packet, |
| 210 | const rtc::PacketTime& packet_time) override; |
| 211 | void OnRtcpReceived(rtc::Buffer* packet, |
| 212 | const rtc::PacketTime& packet_time) override; |
| 213 | void OnReadyToSend(bool ready) override; |
| 214 | bool MuteStream(uint32 ssrc, bool mute) override; |
pbos@webrtc.org | 587ef60 | 2014-06-16 17:32:02 +0000 | [diff] [blame] | 215 | |
| 216 | // Set send/receive RTP header extensions. This must be done before creating |
| 217 | // streams as it only has effect on future streams. |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 218 | bool SetRecvRtpHeaderExtensions( |
pbos@webrtc.org | 0d852d5 | 2015-02-09 15:14:36 +0000 | [diff] [blame] | 219 | const std::vector<RtpHeaderExtension>& extensions) override; |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 220 | bool SetSendRtpHeaderExtensions( |
pbos@webrtc.org | 0d852d5 | 2015-02-09 15:14:36 +0000 | [diff] [blame] | 221 | const std::vector<RtpHeaderExtension>& extensions) override; |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 222 | bool SetMaxSendBandwidth(int bps) override; |
| 223 | bool SetOptions(const VideoOptions& options) override; |
| 224 | bool GetOptions(VideoOptions* options) const override { |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 225 | *options = options_; |
| 226 | return true; |
| 227 | } |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 228 | void SetInterface(NetworkInterface* iface) override; |
| 229 | void UpdateAspectRatio(int ratio_w, int ratio_h) override; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 230 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 231 | void OnMessage(rtc::Message* msg) override; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 232 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 233 | void OnLoadUpdate(Load load) override; |
pbos@webrtc.org | 42684be | 2014-10-03 11:25:45 +0000 | [diff] [blame] | 234 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 235 | // Implemented for VideoMediaChannelTest. |
| 236 | bool sending() const { return sending_; } |
buildbot@webrtc.org | 2c0fb05 | 2014-08-13 16:47:12 +0000 | [diff] [blame] | 237 | uint32 GetDefaultSendChannelSsrc() { return default_send_ssrc_; } |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 238 | bool GetRenderer(uint32 ssrc, VideoRenderer** renderer); |
| 239 | |
| 240 | private: |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 241 | void ConfigureReceiverRtp(webrtc::VideoReceiveStream::Config* config, |
| 242 | const StreamParams& sp) const; |
pbos@webrtc.org | 96a9325 | 2014-11-03 14:46:44 +0000 | [diff] [blame] | 243 | bool CodecIsExternallySupported(const std::string& name) const; |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 244 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 245 | struct VideoCodecSettings { |
| 246 | VideoCodecSettings(); |
andrew@webrtc.org | 8f27fcc | 2015-01-09 20:22:46 +0000 | [diff] [blame] | 247 | |
pbos@webrtc.org | a2ef4fe | 2014-11-07 10:54:43 +0000 | [diff] [blame] | 248 | bool operator ==(const VideoCodecSettings& other) const; |
| 249 | |
pbos@webrtc.org | 6ae48c6 | 2014-06-06 10:49:19 +0000 | [diff] [blame] | 250 | VideoCodec codec; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 251 | webrtc::FecConfig fec; |
| 252 | int rtx_payload_type; |
| 253 | }; |
| 254 | |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 255 | // Wrapper for the sender part, this is where the capturer is connected and |
| 256 | // frames are then converted from cricket frames to webrtc frames. |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 257 | class WebRtcVideoSendStream : public sigslot::has_slots<> { |
| 258 | public: |
pbos@webrtc.org | 5301b0f | 2014-07-17 08:51:46 +0000 | [diff] [blame] | 259 | WebRtcVideoSendStream( |
| 260 | webrtc::Call* call, |
pbos@webrtc.org | 7fe1e03 | 2014-10-14 04:25:33 +0000 | [diff] [blame] | 261 | WebRtcVideoEncoderFactory* external_encoder_factory, |
pbos@webrtc.org | 5301b0f | 2014-07-17 08:51:46 +0000 | [diff] [blame] | 262 | const VideoOptions& options, |
| 263 | const Settable<VideoCodecSettings>& codec_settings, |
| 264 | const StreamParams& sp, |
| 265 | const std::vector<webrtc::RtpExtension>& rtp_extensions); |
| 266 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 267 | ~WebRtcVideoSendStream(); |
pbos@webrtc.org | 5301b0f | 2014-07-17 08:51:46 +0000 | [diff] [blame] | 268 | void SetOptions(const VideoOptions& options); |
| 269 | void SetCodec(const VideoCodecSettings& codec); |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 270 | void SetRtpExtensions( |
| 271 | const std::vector<webrtc::RtpExtension>& rtp_extensions); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 272 | |
| 273 | void InputFrame(VideoCapturer* capturer, const VideoFrame* frame); |
| 274 | bool SetCapturer(VideoCapturer* capturer); |
| 275 | bool SetVideoFormat(const VideoFormat& format); |
pbos@webrtc.org | ef8bb8d | 2014-08-13 21:36:18 +0000 | [diff] [blame] | 276 | void MuteStream(bool mute); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 277 | bool DisconnectCapturer(); |
| 278 | |
| 279 | void Start(); |
| 280 | void Stop(); |
| 281 | |
pbos@webrtc.org | e6f84ae | 2014-07-18 11:11:55 +0000 | [diff] [blame] | 282 | VideoSenderInfo GetVideoSenderInfo(); |
stefan@webrtc.org | 0bae1fa | 2014-11-05 14:05:29 +0000 | [diff] [blame] | 283 | void FillBandwidthEstimationInfo(BandwidthEstimationInfo* bwe_info); |
pbos@webrtc.org | e6f84ae | 2014-07-18 11:11:55 +0000 | [diff] [blame] | 284 | |
pbos@webrtc.org | 42684be | 2014-10-03 11:25:45 +0000 | [diff] [blame] | 285 | void OnCpuResolutionRequest( |
| 286 | CoordinatedVideoAdapter::AdaptRequest adapt_request); |
| 287 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 288 | private: |
pbos@webrtc.org | 6ae48c6 | 2014-06-06 10:49:19 +0000 | [diff] [blame] | 289 | // Parameters needed to reconstruct the underlying stream. |
| 290 | // webrtc::VideoSendStream doesn't support setting a lot of options on the |
| 291 | // fly, so when those need to be changed we tear down and reconstruct with |
| 292 | // similar parameters depending on which options changed etc. |
| 293 | struct VideoSendStreamParameters { |
| 294 | VideoSendStreamParameters( |
| 295 | const webrtc::VideoSendStream::Config& config, |
| 296 | const VideoOptions& options, |
pbos@webrtc.org | 5301b0f | 2014-07-17 08:51:46 +0000 | [diff] [blame] | 297 | const Settable<VideoCodecSettings>& codec_settings); |
pbos@webrtc.org | 6ae48c6 | 2014-06-06 10:49:19 +0000 | [diff] [blame] | 298 | webrtc::VideoSendStream::Config config; |
| 299 | VideoOptions options; |
pbos@webrtc.org | 5301b0f | 2014-07-17 08:51:46 +0000 | [diff] [blame] | 300 | Settable<VideoCodecSettings> codec_settings; |
pbos@webrtc.org | 6ae48c6 | 2014-06-06 10:49:19 +0000 | [diff] [blame] | 301 | // Sent resolutions + bitrates etc. by the underlying VideoSendStream, |
| 302 | // typically changes when setting a new resolution or reconfiguring |
| 303 | // bitrates. |
pbos@webrtc.org | bbe0a85 | 2014-09-19 12:30:25 +0000 | [diff] [blame] | 304 | webrtc::VideoEncoderConfig encoder_config; |
pbos@webrtc.org | 6ae48c6 | 2014-06-06 10:49:19 +0000 | [diff] [blame] | 305 | }; |
| 306 | |
pbos@webrtc.org | 7fe1e03 | 2014-10-14 04:25:33 +0000 | [diff] [blame] | 307 | struct AllocatedEncoder { |
| 308 | AllocatedEncoder(webrtc::VideoEncoder* encoder, |
| 309 | webrtc::VideoCodecType type, |
| 310 | bool external) |
| 311 | : encoder(encoder), type(type), external(external) {} |
| 312 | webrtc::VideoEncoder* encoder; |
| 313 | webrtc::VideoCodecType type; |
| 314 | bool external; |
| 315 | }; |
| 316 | |
pbos@webrtc.org | a2ef4fe | 2014-11-07 10:54:43 +0000 | [diff] [blame] | 317 | struct Dimensions { |
pbos@webrtc.org | b4987bf | 2015-02-18 10:13:09 +0000 | [diff] [blame] | 318 | // Initial encoder configuration (QCIF, 176x144) frame (to ensure that |
| 319 | // hardware encoders can be initialized). This gives us low memory usage |
| 320 | // but also makes it so configuration errors are discovered at the time we |
| 321 | // apply the settings rather than when we get the first frame (waiting for |
| 322 | // the first frame to know that you gave a bad codec parameter could make |
| 323 | // debugging hard). |
| 324 | // TODO(pbos): Consider setting up encoders lazily. |
| 325 | Dimensions() : width(176), height(144), is_screencast(false) {} |
pbos@webrtc.org | efc82c2 | 2014-10-27 13:58:00 +0000 | [diff] [blame] | 326 | int width; |
| 327 | int height; |
| 328 | bool is_screencast; |
| 329 | }; |
| 330 | |
pbos@webrtc.org | f1c8b90 | 2015-01-14 17:29:27 +0000 | [diff] [blame] | 331 | union VideoEncoderSettings { |
| 332 | webrtc::VideoCodecVP8 vp8; |
| 333 | webrtc::VideoCodecVP9 vp9; |
| 334 | }; |
| 335 | |
| 336 | static std::vector<webrtc::VideoStream> CreateVideoStreams( |
| 337 | const VideoCodec& codec, |
| 338 | const VideoOptions& options, |
| 339 | size_t num_streams); |
| 340 | static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams( |
| 341 | const VideoCodec& codec, |
| 342 | const VideoOptions& options, |
| 343 | size_t num_streams); |
| 344 | |
| 345 | void* ConfigureVideoEncoderSettings(const VideoCodec& codec, |
| 346 | const VideoOptions& options) |
| 347 | EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 348 | |
pbos@webrtc.org | 7fe1e03 | 2014-10-14 04:25:33 +0000 | [diff] [blame] | 349 | AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec) |
| 350 | EXCLUSIVE_LOCKS_REQUIRED(lock_); |
pbos@webrtc.org | a2ef4fe | 2014-11-07 10:54:43 +0000 | [diff] [blame] | 351 | void DestroyVideoEncoder(AllocatedEncoder* encoder) |
| 352 | EXCLUSIVE_LOCKS_REQUIRED(lock_); |
pbos@webrtc.org | 5301b0f | 2014-07-17 08:51:46 +0000 | [diff] [blame] | 353 | void SetCodecAndOptions(const VideoCodecSettings& codec, |
pbos@webrtc.org | d60d79a | 2014-09-24 07:10:57 +0000 | [diff] [blame] | 354 | const VideoOptions& options) |
| 355 | EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 356 | void RecreateWebRtcStream() EXCLUSIVE_LOCKS_REQUIRED(lock_); |
pbos@webrtc.org | a2ef4fe | 2014-11-07 10:54:43 +0000 | [diff] [blame] | 357 | webrtc::VideoEncoderConfig CreateVideoEncoderConfig( |
| 358 | const Dimensions& dimensions, |
| 359 | const VideoCodec& codec) const EXCLUSIVE_LOCKS_REQUIRED(lock_); |
pbos@webrtc.org | efc82c2 | 2014-10-27 13:58:00 +0000 | [diff] [blame] | 360 | void SetDimensions(int width, int height, bool is_screencast) |
pbos@webrtc.org | d60d79a | 2014-09-24 07:10:57 +0000 | [diff] [blame] | 361 | EXCLUSIVE_LOCKS_REQUIRED(lock_); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 362 | |
| 363 | webrtc::Call* const call_; |
pbos@webrtc.org | a2ef4fe | 2014-11-07 10:54:43 +0000 | [diff] [blame] | 364 | WebRtcVideoEncoderFactory* const external_encoder_factory_ |
| 365 | GUARDED_BY(lock_); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 366 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 367 | rtc::CriticalSection lock_; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 368 | webrtc::VideoSendStream* stream_ GUARDED_BY(lock_); |
pbos@webrtc.org | 6ae48c6 | 2014-06-06 10:49:19 +0000 | [diff] [blame] | 369 | VideoSendStreamParameters parameters_ GUARDED_BY(lock_); |
pbos@webrtc.org | f1c8b90 | 2015-01-14 17:29:27 +0000 | [diff] [blame] | 370 | VideoEncoderSettings encoder_settings_ GUARDED_BY(lock_); |
pbos@webrtc.org | 7fe1e03 | 2014-10-14 04:25:33 +0000 | [diff] [blame] | 371 | AllocatedEncoder allocated_encoder_ GUARDED_BY(lock_); |
pbos@webrtc.org | a2ef4fe | 2014-11-07 10:54:43 +0000 | [diff] [blame] | 372 | Dimensions last_dimensions_ GUARDED_BY(lock_); |
pbos@webrtc.org | 6ae48c6 | 2014-06-06 10:49:19 +0000 | [diff] [blame] | 373 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 374 | VideoCapturer* capturer_ GUARDED_BY(lock_); |
| 375 | bool sending_ GUARDED_BY(lock_); |
| 376 | bool muted_ GUARDED_BY(lock_); |
| 377 | VideoFormat format_ GUARDED_BY(lock_); |
pbos@webrtc.org | 9a4410e | 2015-02-26 10:03:39 +0000 | [diff] [blame] | 378 | int old_adapt_changes_ GUARDED_BY(lock_); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 379 | }; |
| 380 | |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 381 | // Wrapper for the receiver part, contains configs etc. that are needed to |
| 382 | // reconstruct the underlying VideoReceiveStream. Also serves as a wrapper |
| 383 | // between webrtc::VideoRenderer and cricket::VideoRenderer. |
| 384 | class WebRtcVideoReceiveStream : public webrtc::VideoRenderer { |
| 385 | public: |
| 386 | WebRtcVideoReceiveStream( |
| 387 | webrtc::Call*, |
pbos@webrtc.org | 776e6f2 | 2014-10-29 15:28:39 +0000 | [diff] [blame] | 388 | WebRtcVideoDecoderFactory* external_decoder_factory, |
pbos@webrtc.org | a2a6fe6 | 2015-03-06 15:35:19 +0000 | [diff] [blame] | 389 | bool default_stream, |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 390 | const webrtc::VideoReceiveStream::Config& config, |
| 391 | const std::vector<VideoCodecSettings>& recv_codecs); |
| 392 | ~WebRtcVideoReceiveStream(); |
| 393 | |
| 394 | void SetRecvCodecs(const std::vector<VideoCodecSettings>& recv_codecs); |
| 395 | void SetRtpExtensions(const std::vector<webrtc::RtpExtension>& extensions); |
| 396 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 397 | void RenderFrame(const webrtc::I420VideoFrame& frame, |
| 398 | int time_to_render_ms) override; |
| 399 | bool IsTextureSupported() const override; |
pbos@webrtc.org | a2a6fe6 | 2015-03-06 15:35:19 +0000 | [diff] [blame] | 400 | bool IsDefaultStream() const; |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 401 | |
| 402 | void SetRenderer(cricket::VideoRenderer* renderer); |
| 403 | cricket::VideoRenderer* GetRenderer(); |
| 404 | |
pbos@webrtc.org | e6f84ae | 2014-07-18 11:11:55 +0000 | [diff] [blame] | 405 | VideoReceiverInfo GetVideoReceiverInfo(); |
| 406 | |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 407 | private: |
pbos@webrtc.org | 776e6f2 | 2014-10-29 15:28:39 +0000 | [diff] [blame] | 408 | struct AllocatedDecoder { |
pbos@webrtc.org | 96a9325 | 2014-11-03 14:46:44 +0000 | [diff] [blame] | 409 | AllocatedDecoder(webrtc::VideoDecoder* decoder, |
| 410 | webrtc::VideoCodecType type, |
| 411 | bool external) |
| 412 | : decoder(decoder), type(type), external(external) {} |
pbos@webrtc.org | 776e6f2 | 2014-10-29 15:28:39 +0000 | [diff] [blame] | 413 | webrtc::VideoDecoder* decoder; |
pbos@webrtc.org | 96a9325 | 2014-11-03 14:46:44 +0000 | [diff] [blame] | 414 | webrtc::VideoCodecType type; |
pbos@webrtc.org | 776e6f2 | 2014-10-29 15:28:39 +0000 | [diff] [blame] | 415 | bool external; |
| 416 | }; |
| 417 | |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 418 | void SetSize(int width, int height); |
| 419 | void RecreateWebRtcStream(); |
| 420 | |
pbos@webrtc.org | 96a9325 | 2014-11-03 14:46:44 +0000 | [diff] [blame] | 421 | AllocatedDecoder CreateOrReuseVideoDecoder( |
| 422 | std::vector<AllocatedDecoder>* old_decoder, |
| 423 | const VideoCodec& codec); |
| 424 | void ClearDecoders(std::vector<AllocatedDecoder>* allocated_decoders); |
pbos@webrtc.org | 776e6f2 | 2014-10-29 15:28:39 +0000 | [diff] [blame] | 425 | |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 426 | webrtc::Call* const call_; |
| 427 | |
| 428 | webrtc::VideoReceiveStream* stream_; |
pbos@webrtc.org | a2a6fe6 | 2015-03-06 15:35:19 +0000 | [diff] [blame] | 429 | const bool default_stream_; |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 430 | webrtc::VideoReceiveStream::Config config_; |
| 431 | |
pbos@webrtc.org | 776e6f2 | 2014-10-29 15:28:39 +0000 | [diff] [blame] | 432 | WebRtcVideoDecoderFactory* const external_decoder_factory_; |
| 433 | std::vector<AllocatedDecoder> allocated_decoders_; |
| 434 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 435 | rtc::CriticalSection renderer_lock_; |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 436 | cricket::VideoRenderer* renderer_ GUARDED_BY(renderer_lock_); |
pbos@webrtc.org | e6f84ae | 2014-07-18 11:11:55 +0000 | [diff] [blame] | 437 | int last_width_ GUARDED_BY(renderer_lock_); |
| 438 | int last_height_ GUARDED_BY(renderer_lock_); |
magjed@webrtc.org | fc5ad95 | 2015-01-27 09:57:01 +0000 | [diff] [blame] | 439 | // Expands remote RTP timestamps to int64_t to be able to estimate how long |
| 440 | // the stream has been running. |
| 441 | rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ |
| 442 | GUARDED_BY(renderer_lock_); |
| 443 | int64_t first_frame_timestamp_ GUARDED_BY(renderer_lock_); |
| 444 | // Start NTP time is estimated as current remote NTP time (estimated from |
| 445 | // RTCP) minus the elapsed time, as soon as remote NTP time is available. |
| 446 | int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(renderer_lock_); |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 447 | }; |
| 448 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 449 | void Construct(webrtc::Call* call, WebRtcVideoEngine2* engine); |
pbos@webrtc.org | 6f48f1b | 2014-07-22 16:29:54 +0000 | [diff] [blame] | 450 | void SetDefaultOptions(); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 451 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 452 | bool SendRtp(const uint8_t* data, size_t len) override; |
| 453 | bool SendRtcp(const uint8_t* data, size_t len) override; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 454 | |
| 455 | void StartAllSendStreams(); |
| 456 | void StopAllSendStreams(); |
pbos@webrtc.org | d1ea06b | 2014-07-18 09:35:58 +0000 | [diff] [blame] | 457 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 458 | static std::vector<VideoCodecSettings> MapCodecs( |
| 459 | const std::vector<VideoCodec>& codecs); |
| 460 | std::vector<VideoCodecSettings> FilterSupportedCodecs( |
pbos@webrtc.org | 96a9325 | 2014-11-03 14:46:44 +0000 | [diff] [blame] | 461 | const std::vector<VideoCodecSettings>& mapped_codecs) const; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 462 | |
pbos@webrtc.org | e6f84ae | 2014-07-18 11:11:55 +0000 | [diff] [blame] | 463 | void FillSenderStats(VideoMediaInfo* info); |
| 464 | void FillReceiverStats(VideoMediaInfo* info); |
pbos@webrtc.org | 2b19f06 | 2014-12-11 13:26:09 +0000 | [diff] [blame] | 465 | void FillBandwidthEstimationStats(const webrtc::Call::Stats& stats, |
| 466 | VideoMediaInfo* info); |
pbos@webrtc.org | e6f84ae | 2014-07-18 11:11:55 +0000 | [diff] [blame] | 467 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 468 | uint32_t rtcp_receiver_report_ssrc_; |
| 469 | bool sending_; |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 470 | rtc::scoped_ptr<webrtc::Call> call_; |
pbos@webrtc.org | 42684be | 2014-10-03 11:25:45 +0000 | [diff] [blame] | 471 | WebRtcCallFactory* call_factory_; |
| 472 | |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 473 | uint32_t default_send_ssrc_; |
pbos@webrtc.org | afb554f4 | 2014-08-12 23:17:13 +0000 | [diff] [blame] | 474 | |
| 475 | DefaultUnsignalledSsrcHandler default_unsignalled_ssrc_handler_; |
| 476 | UnsignalledSsrcHandler* const unsignalled_ssrc_handler_; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 477 | |
pbos@webrtc.org | 575d126 | 2014-10-08 14:48:08 +0000 | [diff] [blame] | 478 | rtc::CriticalSection stream_crit_; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 479 | // Using primary-ssrc (first ssrc) as key. |
pbos@webrtc.org | 575d126 | 2014-10-08 14:48:08 +0000 | [diff] [blame] | 480 | std::map<uint32, WebRtcVideoSendStream*> send_streams_ |
| 481 | GUARDED_BY(stream_crit_); |
| 482 | std::map<uint32, WebRtcVideoReceiveStream*> receive_streams_ |
| 483 | GUARDED_BY(stream_crit_); |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 484 | |
| 485 | Settable<VideoCodecSettings> send_codec_; |
pbos@webrtc.org | 587ef60 | 2014-06-16 17:32:02 +0000 | [diff] [blame] | 486 | std::vector<webrtc::RtpExtension> send_rtp_extensions_; |
| 487 | |
pbos@webrtc.org | 8296ec5 | 2015-03-20 14:27:49 +0000 | [diff] [blame] | 488 | const int voice_channel_id_; |
pbos@webrtc.org | 7fe1e03 | 2014-10-14 04:25:33 +0000 | [diff] [blame] | 489 | WebRtcVideoEncoderFactory* const external_encoder_factory_; |
| 490 | WebRtcVideoDecoderFactory* const external_decoder_factory_; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 491 | std::vector<VideoCodecSettings> recv_codecs_; |
pbos@webrtc.org | 587ef60 | 2014-06-16 17:32:02 +0000 | [diff] [blame] | 492 | std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
pbos@webrtc.org | 0087318 | 2014-11-25 14:03:34 +0000 | [diff] [blame] | 493 | webrtc::Call::Config::BitrateConfig bitrate_config_; |
pbos@webrtc.org | b5a22b1 | 2014-05-13 11:07:01 +0000 | [diff] [blame] | 494 | VideoOptions options_; |
| 495 | }; |
| 496 | |
| 497 | } // namespace cricket |
| 498 | |
| 499 | #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ |