blob: 968d2c0d4da206c9685a4cd7a8f5045d84366559 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
2 * libjingle
3 * Copyright 2004 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_WEBRTCVIDEOENGINE_H_
29#define TALK_MEDIA_WEBRTCVIDEOENGINE_H_
30
31#include <map>
32#include <vector>
33
34#include "talk/base/scoped_ptr.h"
35#include "talk/media/base/codec.h"
36#include "talk/media/base/videocommon.h"
37#include "talk/media/webrtc/webrtccommon.h"
38#include "talk/media/webrtc/webrtcexport.h"
39#include "talk/media/webrtc/webrtcvideoencoderfactory.h"
40#include "talk/session/media/channel.h"
41#include "webrtc/video_engine/include/vie_base.h"
42
43#if !defined(LIBPEERCONNECTION_LIB) && \
44 !defined(LIBPEERCONNECTION_IMPLEMENTATION)
45#error "Bogus include."
46#endif
47
henrike@webrtc.orgf45a5502014-03-13 18:51:34 +000048
henrike@webrtc.org28e20752013-07-10 00:45:36 +000049namespace webrtc {
50class VideoCaptureModule;
51class VideoDecoder;
52class VideoEncoder;
53class VideoRender;
54class ViEExternalCapture;
55class ViERTP_RTCP;
56}
57
58namespace talk_base {
59class CpuMonitor;
60} // namespace talk_base
61
62namespace cricket {
63
mallinath@webrtc.org67ee6b92014-02-03 16:57:16 +000064class CoordinatedVideoAdapter;
65class ViETraceWrapper;
66class ViEWrapper;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000067class VideoCapturer;
68class VideoFrame;
69class VideoProcessor;
70class VideoRenderer;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000071class VoiceMediaChannel;
72class WebRtcDecoderObserver;
73class WebRtcEncoderObserver;
74class WebRtcLocalStreamInfo;
75class WebRtcRenderAdapter;
76class WebRtcVideoChannelRecvInfo;
77class WebRtcVideoChannelSendInfo;
78class WebRtcVideoDecoderFactory;
79class WebRtcVideoEncoderFactory;
80class WebRtcVideoMediaChannel;
81class WebRtcVoiceEngine;
82
83struct CapturedFrame;
84struct Device;
85
86class WebRtcVideoEngine : public sigslot::has_slots<>,
87 public webrtc::TraceCallback,
88 public WebRtcVideoEncoderFactory::Observer {
89 public:
90 // Creates the WebRtcVideoEngine with internal VideoCaptureModule.
91 WebRtcVideoEngine();
92 // For testing purposes. Allows the WebRtcVoiceEngine,
93 // ViEWrapper and CpuMonitor to be mocks.
94 // TODO(juberti): Remove the 3-arg ctor once fake tracing is implemented.
95 WebRtcVideoEngine(WebRtcVoiceEngine* voice_engine,
96 ViEWrapper* vie_wrapper,
97 talk_base::CpuMonitor* cpu_monitor);
98 WebRtcVideoEngine(WebRtcVoiceEngine* voice_engine,
99 ViEWrapper* vie_wrapper,
100 ViETraceWrapper* tracing,
101 talk_base::CpuMonitor* cpu_monitor);
102 ~WebRtcVideoEngine();
103
104 // Basic video engine implementation.
105 bool Init(talk_base::Thread* worker_thread);
106 void Terminate();
107
108 int GetCapabilities();
mallinath@webrtc.orga27be8e2013-09-27 23:04:10 +0000109 bool SetOptions(const VideoOptions &options);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000110 bool SetDefaultEncoderConfig(const VideoEncoderConfig& config);
wu@webrtc.org78187522013-10-07 23:32:02 +0000111 VideoEncoderConfig GetDefaultEncoderConfig() const;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000112
113 WebRtcVideoMediaChannel* CreateChannel(VoiceMediaChannel* voice_channel);
114
115 const std::vector<VideoCodec>& codecs() const;
116 const std::vector<RtpHeaderExtension>& rtp_header_extensions() const;
117 void SetLogging(int min_sev, const char* filter);
118
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000119 bool SetLocalRenderer(VideoRenderer* renderer);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000120 sigslot::repeater2<VideoCapturer*, CaptureState> SignalCaptureStateChange;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000121
122 // Set the VoiceEngine for A/V sync. This can only be called before Init.
123 bool SetVoiceEngine(WebRtcVoiceEngine* voice_engine);
124 // Set a WebRtcVideoDecoderFactory for external decoding. Video engine does
125 // not take the ownership of |decoder_factory|. The caller needs to make sure
126 // that |decoder_factory| outlives the video engine.
127 void SetExternalDecoderFactory(WebRtcVideoDecoderFactory* decoder_factory);
128 // Set a WebRtcVideoEncoderFactory for external encoding. Video engine does
129 // not take the ownership of |encoder_factory|. The caller needs to make sure
130 // that |encoder_factory| outlives the video engine.
131 void SetExternalEncoderFactory(WebRtcVideoEncoderFactory* encoder_factory);
132 // Enable the render module with timing control.
133 bool EnableTimedRender();
134
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000135 // Returns an external decoder for the given codec type. The return value
136 // can be NULL if decoder factory is not given or it does not support the
137 // codec type. The caller takes the ownership of the returned object.
138 webrtc::VideoDecoder* CreateExternalDecoder(webrtc::VideoCodecType type);
139 // Releases the decoder instance created by CreateExternalDecoder().
140 void DestroyExternalDecoder(webrtc::VideoDecoder* decoder);
141
142 // Returns an external encoder for the given codec type. The return value
143 // can be NULL if encoder factory is not given or it does not support the
144 // codec type. The caller takes the ownership of the returned object.
145 webrtc::VideoEncoder* CreateExternalEncoder(webrtc::VideoCodecType type);
146 // Releases the encoder instance created by CreateExternalEncoder().
147 void DestroyExternalEncoder(webrtc::VideoEncoder* encoder);
148
149 // Returns true if the codec type is supported by the external encoder.
150 bool IsExternalEncoderCodecType(webrtc::VideoCodecType type) const;
151
152 // Functions called by WebRtcVideoMediaChannel.
153 talk_base::Thread* worker_thread() { return worker_thread_; }
154 ViEWrapper* vie() { return vie_wrapper_.get(); }
155 const VideoFormat& default_codec_format() const {
156 return default_codec_format_;
157 }
158 int GetLastEngineError();
159 bool FindCodec(const VideoCodec& in);
160 bool CanSendCodec(const VideoCodec& in, const VideoCodec& current,
161 VideoCodec* out);
162 void RegisterChannel(WebRtcVideoMediaChannel* channel);
163 void UnregisterChannel(WebRtcVideoMediaChannel* channel);
164 bool ConvertFromCricketVideoCodec(const VideoCodec& in_codec,
165 webrtc::VideoCodec* out_codec);
166 // Check whether the supplied trace should be ignored.
167 bool ShouldIgnoreTrace(const std::string& trace);
168 int GetNumOfChannels();
169
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000170 VideoFormat GetStartCaptureFormat() const { return default_codec_format_; }
171
172 talk_base::CpuMonitor* cpu_monitor() { return cpu_monitor_.get(); }
173
174 protected:
175 // When a video processor registers with the engine.
176 // SignalMediaFrame will be invoked for every video frame.
177 // See videoprocessor.h for param reference.
178 sigslot::signal3<uint32, VideoFrame*, bool*> SignalMediaFrame;
179
180 private:
181 typedef std::vector<WebRtcVideoMediaChannel*> VideoChannels;
182 struct VideoCodecPref {
183 const char* name;
184 int payload_type;
sergeyu@chromium.org5bc25c42013-12-05 00:24:06 +0000185 // For RTX, this field is the payload-type that RTX applies to.
186 // For other codecs, it should be set to -1.
187 int associated_payload_type;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000188 int pref;
189 };
190
191 static const VideoCodecPref kVideoCodecPrefs[];
192 static const VideoFormatPod kVideoFormats[];
193 static const VideoFormatPod kDefaultVideoFormat;
194
195 void Construct(ViEWrapper* vie_wrapper,
196 ViETraceWrapper* tracing,
197 WebRtcVoiceEngine* voice_engine,
198 talk_base::CpuMonitor* cpu_monitor);
199 bool SetDefaultCodec(const VideoCodec& codec);
200 bool RebuildCodecList(const VideoCodec& max_codec);
201 void SetTraceFilter(int filter);
202 void SetTraceOptions(const std::string& options);
203 bool InitVideoEngine();
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000204
205 // webrtc::TraceCallback implementation.
206 virtual void Print(webrtc::TraceLevel level, const char* trace, int length);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000207
208 // WebRtcVideoEncoderFactory::Observer implementation.
209 virtual void OnCodecsAvailable();
210
211 talk_base::Thread* worker_thread_;
212 talk_base::scoped_ptr<ViEWrapper> vie_wrapper_;
213 bool vie_wrapper_base_initialized_;
214 talk_base::scoped_ptr<ViETraceWrapper> tracing_;
215 WebRtcVoiceEngine* voice_engine_;
216 talk_base::scoped_ptr<webrtc::VideoRender> render_module_;
217 WebRtcVideoEncoderFactory* encoder_factory_;
218 WebRtcVideoDecoderFactory* decoder_factory_;
219 std::vector<VideoCodec> video_codecs_;
220 std::vector<RtpHeaderExtension> rtp_header_extensions_;
221 VideoFormat default_codec_format_;
222
223 bool initialized_;
224 talk_base::CriticalSection channels_crit_;
225 VideoChannels channels_;
226
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000227 bool capture_started_;
228 int local_renderer_w_;
229 int local_renderer_h_;
230 VideoRenderer* local_renderer_;
231
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000232 talk_base::scoped_ptr<talk_base::CpuMonitor> cpu_monitor_;
233};
234
235class WebRtcVideoMediaChannel : public talk_base::MessageHandler,
236 public VideoMediaChannel,
237 public webrtc::Transport {
238 public:
239 WebRtcVideoMediaChannel(WebRtcVideoEngine* engine,
240 VoiceMediaChannel* voice_channel);
241 ~WebRtcVideoMediaChannel();
242 bool Init();
243
244 WebRtcVideoEngine* engine() { return engine_; }
245 VoiceMediaChannel* voice_channel() { return voice_channel_; }
246 int video_channel() const { return vie_channel_; }
247 bool sending() const { return sending_; }
248
henrike@webrtc.org6e3dbc22014-03-25 17:09:47 +0000249 // Public for testing purpose.
250 uint32 GetDefaultChannelSsrc();
251
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000252 // VideoMediaChannel implementation
253 virtual bool SetRecvCodecs(const std::vector<VideoCodec> &codecs);
254 virtual bool SetSendCodecs(const std::vector<VideoCodec> &codecs);
255 virtual bool GetSendCodec(VideoCodec* send_codec);
256 virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format);
257 virtual bool SetRender(bool render);
258 virtual bool SetSend(bool send);
259
260 virtual bool AddSendStream(const StreamParams& sp);
261 virtual bool RemoveSendStream(uint32 ssrc);
262 virtual bool AddRecvStream(const StreamParams& sp);
263 virtual bool RemoveRecvStream(uint32 ssrc);
264 virtual bool SetRenderer(uint32 ssrc, VideoRenderer* renderer);
wu@webrtc.orgb9a088b2014-02-13 23:18:49 +0000265 virtual bool GetStats(const StatsOptions& options, VideoMediaInfo* info);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000266 virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer);
267 virtual bool SendIntraFrame();
268 virtual bool RequestIntraFrame();
269
wu@webrtc.orga9890802013-12-13 00:21:03 +0000270 virtual void OnPacketReceived(talk_base::Buffer* packet,
271 const talk_base::PacketTime& packet_time);
272 virtual void OnRtcpReceived(talk_base::Buffer* packet,
273 const talk_base::PacketTime& packet_time);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000274 virtual void OnReadyToSend(bool ready);
275 virtual bool MuteStream(uint32 ssrc, bool on);
276 virtual bool SetRecvRtpHeaderExtensions(
277 const std::vector<RtpHeaderExtension>& extensions);
278 virtual bool SetSendRtpHeaderExtensions(
279 const std::vector<RtpHeaderExtension>& extensions);
mallinath@webrtc.org92fdfeb2014-02-17 18:49:41 +0000280 virtual int GetRtpSendTimeExtnId() const;
sergeyu@chromium.org4b26e2e2014-01-15 23:15:54 +0000281 virtual bool SetStartSendBandwidth(int bps);
282 virtual bool SetMaxSendBandwidth(int bps);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000283 virtual bool SetOptions(const VideoOptions &options);
284 virtual bool GetOptions(VideoOptions *options) const {
285 *options = options_;
286 return true;
287 }
288 virtual void SetInterface(NetworkInterface* iface);
289 virtual void UpdateAspectRatio(int ratio_w, int ratio_h);
290
291 // Public functions for use by tests and other specialized code.
292 uint32 send_ssrc() const { return 0; }
293 bool GetRenderer(uint32 ssrc, VideoRenderer** renderer);
mallinath@webrtc.org67ee6b92014-02-03 16:57:16 +0000294 bool GetVideoAdapter(uint32 ssrc, CoordinatedVideoAdapter** video_adapter);
wu@webrtc.orgcfe5e9c2014-03-27 17:03:58 +0000295 void OnFrameFromCapturer(VideoCapturer* capturer, const VideoFrame* frame);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000296
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000297 // Thunk functions for use with HybridVideoEngine
298 void OnLocalFrame(VideoCapturer* capturer, const VideoFrame* frame) {
299 SendFrame(0u, frame, capturer->IsScreencast());
300 }
301 void OnLocalFrameFormat(VideoCapturer* capturer, const VideoFormat* format) {
302 }
303
304 virtual void OnMessage(talk_base::Message* msg);
305
306 protected:
307 int GetLastEngineError() { return engine()->GetLastEngineError(); }
308 virtual int SendPacket(int channel, const void* data, int len);
309 virtual int SendRTCPPacket(int channel, const void* data, int len);
310
311 private:
312 typedef std::map<uint32, WebRtcVideoChannelRecvInfo*> RecvChannelMap;
313 typedef std::map<uint32, WebRtcVideoChannelSendInfo*> SendChannelMap;
314 typedef int (webrtc::ViERTP_RTCP::* ExtensionSetterFunction)(int, bool, int);
315
316 enum MediaDirection { MD_RECV, MD_SEND, MD_SENDRECV };
317
318 // Creates and initializes a ViE channel. When successful |channel_id| will
319 // contain the new channel's ID. If |receiving| is true |ssrc| is the
320 // remote ssrc. If |sending| is true the ssrc is local ssrc. If both
321 // |receiving| and |sending| is true the ssrc must be 0 and the channel will
322 // be created as a default channel. The ssrc must be different for receive
323 // channels and it must be different for send channels. If the same SSRC is
324 // being used for creating channel more than once, this function will fail
325 // returning false.
326 bool CreateChannel(uint32 ssrc_key, MediaDirection direction,
327 int* channel_id);
henrike@webrtc.org704bf9e2014-02-27 17:52:04 +0000328 bool CreateUnsignalledRecvChannel(uint32 ssrc_key, int* channel_id);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000329 bool ConfigureChannel(int channel_id, MediaDirection direction,
330 uint32 ssrc_key);
331 bool ConfigureReceiving(int channel_id, uint32 remote_ssrc_key);
332 bool ConfigureSending(int channel_id, uint32 local_ssrc_key);
333 bool SetNackFec(int channel_id, int red_payload_type, int fec_payload_type,
334 bool nack_enabled);
335 bool SetSendCodec(const webrtc::VideoCodec& codec, int min_bitrate,
336 int start_bitrate, int max_bitrate);
337 bool SetSendCodec(WebRtcVideoChannelSendInfo* send_channel,
338 const webrtc::VideoCodec& codec, int min_bitrate,
339 int start_bitrate, int max_bitrate);
340 void LogSendCodecChange(const std::string& reason);
341 // Prepares the channel with channel id |info->channel_id()| to receive all
342 // codecs in |receive_codecs_| and start receive packets.
343 bool SetReceiveCodecs(WebRtcVideoChannelRecvInfo* info);
344 // Returns the channel number that receives the stream with SSRC |ssrc|.
345 int GetRecvChannelNum(uint32 ssrc);
346 // Given captured video frame size, checks if we need to reset vie send codec.
347 // |reset| is set to whether resetting has happened on vie or not.
348 // Returns false on error.
349 bool MaybeResetVieSendCodec(WebRtcVideoChannelSendInfo* send_channel,
350 int new_width, int new_height, bool is_screencast,
351 bool* reset);
352 // Checks the current bitrate estimate and modifies the start bitrate
353 // accordingly.
354 void MaybeChangeStartBitrate(int channel_id, webrtc::VideoCodec* video_codec);
355 // Helper function for starting the sending of media on all channels or
356 // |channel_id|. Note that these two function do not change |sending_|.
357 bool StartSend();
358 bool StartSend(WebRtcVideoChannelSendInfo* send_channel);
359 // Helper function for stop the sending of media on all channels or
360 // |channel_id|. Note that these two function do not change |sending_|.
361 bool StopSend();
362 bool StopSend(WebRtcVideoChannelSendInfo* send_channel);
363 bool SendIntraFrame(int channel_id);
364
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000365 bool HasReadySendChannels();
366
367 // Send channel key returns the key corresponding to the provided local SSRC
368 // in |key|. The return value is true upon success.
369 // If the local ssrc correspond to that of the default channel the key is 0.
370 // For all other channels the returned key will be the same as the local ssrc.
371 bool GetSendChannelKey(uint32 local_ssrc, uint32* key);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000372 WebRtcVideoChannelSendInfo* GetSendChannel(uint32 local_ssrc);
373 // Creates a new unique key that can be used for inserting a new send channel
374 // into |send_channels_|
375 bool CreateSendChannelKey(uint32 local_ssrc, uint32* key);
wu@webrtc.org24301a62013-12-13 19:17:43 +0000376 // Get the number of the send channels |capturer| registered with.
377 int GetSendChannelNum(VideoCapturer* capturer);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000378
379 bool IsDefaultChannel(int channel_id) const {
380 return channel_id == vie_channel_;
381 }
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000382
383 bool DeleteSendChannel(uint32 ssrc_key);
384
385 bool InConferenceMode() const {
386 return options_.conference_mode.GetWithDefaultIfUnset(false);
387 }
388 bool RemoveCapturer(uint32 ssrc);
389
390
391 talk_base::MessageQueue* worker_thread() { return engine_->worker_thread(); }
392 void QueueBlackFrame(uint32 ssrc, int64 timestamp, int framerate);
393 void FlushBlackFrame(uint32 ssrc, int64 timestamp);
394
395 void SetNetworkTransmissionState(bool is_transmitting);
396
397 bool SetHeaderExtension(ExtensionSetterFunction setter, int channel_id,
398 const RtpHeaderExtension* extension);
399 bool SetHeaderExtension(ExtensionSetterFunction setter, int channel_id,
400 const std::vector<RtpHeaderExtension>& extensions,
401 const char header_extension_uri[]);
402
wu@webrtc.orgd64719d2013-08-01 00:00:07 +0000403 // Signal when cpu adaptation has no further scope to adapt.
404 void OnCpuAdaptationUnable();
405
sergeyu@chromium.org5bc25c42013-12-05 00:24:06 +0000406 // Set the local (send-side) RTX SSRC corresponding to primary_ssrc.
407 bool SetLocalRtxSsrc(int channel_id, const StreamParams& send_params,
408 uint32 primary_ssrc, int stream_idx);
409
wu@webrtc.org24301a62013-12-13 19:17:43 +0000410 // Connect |capturer| to WebRtcVideoMediaChannel if it is only registered
411 // to one send channel, i.e. the first send channel.
412 void MaybeConnectCapturer(VideoCapturer* capturer);
413 // Disconnect |capturer| from WebRtcVideoMediaChannel if it is only registered
414 // to one send channel, i.e. the last send channel.
415 void MaybeDisconnectCapturer(VideoCapturer* capturer);
416
wu@webrtc.orgcfe5e9c2014-03-27 17:03:58 +0000417 void SendFrame(VideoCapturer* capturer, const VideoFrame* frame);
418 bool SendFrame(WebRtcVideoChannelSendInfo* channel_info,
419 const VideoFrame* frame, bool is_screencast);
henrike@webrtc.org6e3dbc22014-03-25 17:09:47 +0000420 bool RemoveRecvStreamInternal(uint32 ssrc);
421
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000422 // Global state.
423 WebRtcVideoEngine* engine_;
424 VoiceMediaChannel* voice_channel_;
425 int vie_channel_;
426 bool nack_enabled_;
427 // Receiver Estimated Max Bitrate
428 bool remb_enabled_;
429 VideoOptions options_;
430
431 // Global recv side state.
432 // Note the default channel (vie_channel_), i.e. the send channel
433 // corresponding to all the receive channels (this must be done for REMB to
434 // work properly), resides in both recv_channels_ and send_channels_ with the
435 // ssrc key 0.
436 RecvChannelMap recv_channels_; // Contains all receive channels.
437 std::vector<webrtc::VideoCodec> receive_codecs_;
438 bool render_started_;
439 uint32 first_receive_ssrc_;
440 std::vector<RtpHeaderExtension> receive_extensions_;
henrike@webrtc.org704bf9e2014-02-27 17:52:04 +0000441 int num_unsignalled_recv_channels_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000442
443 // Global send side state.
444 SendChannelMap send_channels_;
445 talk_base::scoped_ptr<webrtc::VideoCodec> send_codec_;
sergeyu@chromium.org5bc25c42013-12-05 00:24:06 +0000446 int send_rtx_type_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000447 int send_red_type_;
448 int send_fec_type_;
449 int send_min_bitrate_;
450 int send_start_bitrate_;
451 int send_max_bitrate_;
452 bool sending_;
453 std::vector<RtpHeaderExtension> send_extensions_;
454
455 // The aspect ratio that the channel desires. 0 means there is no desired
456 // aspect ratio
457 int ratio_w_;
458 int ratio_h_;
459};
460
461} // namespace cricket
462
463#endif // TALK_MEDIA_WEBRTCVIDEOENGINE_H_