henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | /* |
| 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_BASE_MEDIAENGINE_H_ |
| 29 | #define TALK_MEDIA_BASE_MEDIAENGINE_H_ |
| 30 | |
| 31 | #ifdef OSX |
| 32 | #include <CoreAudio/CoreAudio.h> |
| 33 | #endif |
| 34 | |
pbos@webrtc.org | 371243d | 2014-03-07 15:22:04 +0000 | [diff] [blame] | 35 | #include <limits.h> |
| 36 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 37 | #include <string> |
| 38 | #include <vector> |
| 39 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 40 | #include "talk/media/base/codec.h" |
| 41 | #include "talk/media/base/mediachannel.h" |
| 42 | #include "talk/media/base/mediacommon.h" |
| 43 | #include "talk/media/base/videocapturer.h" |
| 44 | #include "talk/media/base/videocommon.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 45 | #include "talk/media/base/voiceprocessor.h" |
| 46 | #include "talk/media/devices/devicemanager.h" |
buildbot@webrtc.org | a09a999 | 2014-08-13 17:26:08 +0000 | [diff] [blame] | 47 | #include "webrtc/base/fileutils.h" |
| 48 | #include "webrtc/base/sigslotrepeater.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 49 | |
| 50 | #if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD) |
| 51 | #define DISABLE_MEDIA_ENGINE_FACTORY |
| 52 | #endif |
| 53 | |
| 54 | namespace cricket { |
| 55 | |
| 56 | class VideoCapturer; |
| 57 | |
| 58 | // MediaEngineInterface is an abstraction of a media engine which can be |
| 59 | // subclassed to support different media componentry backends. |
| 60 | // It supports voice and video operations in the same class to facilitate |
| 61 | // proper synchronization between both media types. |
| 62 | class MediaEngineInterface { |
| 63 | public: |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 64 | // Default value to be used for SetAudioDelayOffset(). |
| 65 | static const int kDefaultAudioDelayOffset; |
| 66 | |
| 67 | virtual ~MediaEngineInterface() {} |
| 68 | |
| 69 | // Initialization |
| 70 | // Starts the engine. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 71 | virtual bool Init(rtc::Thread* worker_thread) = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 72 | // Shuts down the engine. |
| 73 | virtual void Terminate() = 0; |
| 74 | // Returns what the engine is capable of, as a set of Capabilities, above. |
| 75 | virtual int GetCapabilities() = 0; |
| 76 | |
| 77 | // MediaChannel creation |
| 78 | // Creates a voice media channel. Returns NULL on failure. |
Jelena Marusic | c28a896 | 2015-05-29 15:05:44 +0200 | [diff] [blame] | 79 | virtual VoiceMediaChannel* CreateChannel(const AudioOptions& options) = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 80 | // Creates a video media channel, paired with the specified voice channel. |
| 81 | // Returns NULL on failure. |
buildbot@webrtc.org | 1ecbe45 | 2014-10-14 20:29:28 +0000 | [diff] [blame] | 82 | virtual VideoMediaChannel* CreateVideoChannel( |
| 83 | const VideoOptions& options, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 84 | VoiceMediaChannel* voice_media_channel) = 0; |
| 85 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 86 | // Configuration |
mallinath@webrtc.org | a27be8e | 2013-09-27 23:04:10 +0000 | [diff] [blame] | 87 | // Gets global audio options. |
| 88 | virtual AudioOptions GetAudioOptions() const = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 89 | // Sets global audio options. "options" are from AudioOptions, above. |
mallinath@webrtc.org | a27be8e | 2013-09-27 23:04:10 +0000 | [diff] [blame] | 90 | virtual bool SetAudioOptions(const AudioOptions& options) = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 91 | // Sets the value used by the echo canceller to offset delay values obtained |
| 92 | // from the OS. |
| 93 | virtual bool SetAudioDelayOffset(int offset) = 0; |
| 94 | // Sets the default (maximum) codec/resolution and encoder option to capture |
| 95 | // and encode video. |
| 96 | virtual bool SetDefaultVideoEncoderConfig(const VideoEncoderConfig& config) |
| 97 | = 0; |
| 98 | |
| 99 | // Device selection |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 100 | virtual bool SetSoundDevices(const Device* in_device, |
| 101 | const Device* out_device) = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 102 | |
| 103 | // Device configuration |
| 104 | // Gets the current speaker volume, as a value between 0 and 255. |
| 105 | virtual bool GetOutputVolume(int* level) = 0; |
| 106 | // Sets the current speaker volume, as a value between 0 and 255. |
| 107 | virtual bool SetOutputVolume(int level) = 0; |
| 108 | |
| 109 | // Local monitoring |
| 110 | // Gets the current microphone level, as a value between 0 and 10. |
| 111 | virtual int GetInputLevel() = 0; |
| 112 | // Starts or stops the local microphone. Useful if local mic info is needed |
| 113 | // prior to a call being connected; the mic will be started automatically |
| 114 | // when a VoiceMediaChannel starts sending. |
| 115 | virtual bool SetLocalMonitor(bool enable) = 0; |
| 116 | // Installs a callback for raw frames from the local camera. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 117 | |
| 118 | virtual const std::vector<AudioCodec>& audio_codecs() = 0; |
| 119 | virtual const std::vector<RtpHeaderExtension>& |
| 120 | audio_rtp_header_extensions() = 0; |
| 121 | virtual const std::vector<VideoCodec>& video_codecs() = 0; |
| 122 | virtual const std::vector<RtpHeaderExtension>& |
| 123 | video_rtp_header_extensions() = 0; |
| 124 | |
| 125 | // Logging control |
| 126 | virtual void SetVoiceLogging(int min_sev, const char* filter) = 0; |
| 127 | virtual void SetVideoLogging(int min_sev, const char* filter) = 0; |
| 128 | |
wu@webrtc.org | a989080 | 2013-12-13 00:21:03 +0000 | [diff] [blame] | 129 | // Starts AEC dump using existing file. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 130 | virtual bool StartAecDump(rtc::PlatformFile file) = 0; |
wu@webrtc.org | a989080 | 2013-12-13 00:21:03 +0000 | [diff] [blame] | 131 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 132 | // Voice processors for effects. |
| 133 | virtual bool RegisterVoiceProcessor(uint32 ssrc, |
| 134 | VoiceProcessor* video_processor, |
| 135 | MediaProcessorDirection direction) = 0; |
| 136 | virtual bool UnregisterVoiceProcessor(uint32 ssrc, |
| 137 | VoiceProcessor* video_processor, |
| 138 | MediaProcessorDirection direction) = 0; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 139 | }; |
| 140 | |
| 141 | |
| 142 | #if !defined(DISABLE_MEDIA_ENGINE_FACTORY) |
| 143 | class MediaEngineFactory { |
| 144 | public: |
henrike@webrtc.org | 40b3b68 | 2014-03-03 18:30:11 +0000 | [diff] [blame] | 145 | typedef cricket::MediaEngineInterface* (*MediaEngineCreateFunction)(); |
| 146 | // Creates a media engine, using either the compiled system default or the |
| 147 | // creation function specified in SetCreateFunction, if specified. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 148 | static MediaEngineInterface* Create(); |
henrike@webrtc.org | 40b3b68 | 2014-03-03 18:30:11 +0000 | [diff] [blame] | 149 | // Sets the function used when calling Create. If unset, the compiled system |
| 150 | // default will be used. Returns the old create function, or NULL if one |
| 151 | // wasn't set. Likewise, NULL can be used as the |function| parameter to |
| 152 | // reset to the default behavior. |
| 153 | static MediaEngineCreateFunction SetCreateFunction( |
| 154 | MediaEngineCreateFunction function); |
| 155 | private: |
| 156 | static MediaEngineCreateFunction create_function_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 157 | }; |
| 158 | #endif |
| 159 | |
| 160 | // CompositeMediaEngine constructs a MediaEngine from separate |
| 161 | // voice and video engine classes. |
| 162 | template<class VOICE, class VIDEO> |
| 163 | class CompositeMediaEngine : public MediaEngineInterface { |
| 164 | public: |
pbos@webrtc.org | f1f0d9a | 2015-03-02 13:30:15 +0000 | [diff] [blame] | 165 | CompositeMediaEngine() : video_(&voice_) {} |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 166 | virtual ~CompositeMediaEngine() {} |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 167 | virtual bool Init(rtc::Thread* worker_thread) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 168 | if (!voice_.Init(worker_thread)) |
| 169 | return false; |
Fredrik Solenberg | 9a416bd | 2015-05-22 09:04:09 +0200 | [diff] [blame] | 170 | video_.Init(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 171 | return true; |
| 172 | } |
| 173 | virtual void Terminate() { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 174 | voice_.Terminate(); |
| 175 | } |
| 176 | |
| 177 | virtual int GetCapabilities() { |
| 178 | return (voice_.GetCapabilities() | video_.GetCapabilities()); |
| 179 | } |
Jelena Marusic | c28a896 | 2015-05-29 15:05:44 +0200 | [diff] [blame] | 180 | virtual VoiceMediaChannel* CreateChannel(const AudioOptions& options) { |
| 181 | return voice_.CreateChannel(options); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 182 | } |
buildbot@webrtc.org | 1ecbe45 | 2014-10-14 20:29:28 +0000 | [diff] [blame] | 183 | virtual VideoMediaChannel* CreateVideoChannel(const VideoOptions& options, |
| 184 | VoiceMediaChannel* channel) { |
| 185 | return video_.CreateChannel(options, channel); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 186 | } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 187 | |
mallinath@webrtc.org | a27be8e | 2013-09-27 23:04:10 +0000 | [diff] [blame] | 188 | virtual AudioOptions GetAudioOptions() const { |
| 189 | return voice_.GetOptions(); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 190 | } |
mallinath@webrtc.org | a27be8e | 2013-09-27 23:04:10 +0000 | [diff] [blame] | 191 | virtual bool SetAudioOptions(const AudioOptions& options) { |
| 192 | return voice_.SetOptions(options); |
| 193 | } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 194 | virtual bool SetAudioDelayOffset(int offset) { |
| 195 | return voice_.SetDelayOffset(offset); |
| 196 | } |
| 197 | virtual bool SetDefaultVideoEncoderConfig(const VideoEncoderConfig& config) { |
| 198 | return video_.SetDefaultEncoderConfig(config); |
| 199 | } |
| 200 | |
| 201 | virtual bool SetSoundDevices(const Device* in_device, |
| 202 | const Device* out_device) { |
| 203 | return voice_.SetDevices(in_device, out_device); |
| 204 | } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 205 | |
| 206 | virtual bool GetOutputVolume(int* level) { |
| 207 | return voice_.GetOutputVolume(level); |
| 208 | } |
| 209 | virtual bool SetOutputVolume(int level) { |
| 210 | return voice_.SetOutputVolume(level); |
| 211 | } |
| 212 | |
| 213 | virtual int GetInputLevel() { |
| 214 | return voice_.GetInputLevel(); |
| 215 | } |
| 216 | virtual bool SetLocalMonitor(bool enable) { |
| 217 | return voice_.SetLocalMonitor(enable); |
| 218 | } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 219 | virtual const std::vector<AudioCodec>& audio_codecs() { |
| 220 | return voice_.codecs(); |
| 221 | } |
| 222 | virtual const std::vector<RtpHeaderExtension>& audio_rtp_header_extensions() { |
| 223 | return voice_.rtp_header_extensions(); |
| 224 | } |
| 225 | virtual const std::vector<VideoCodec>& video_codecs() { |
| 226 | return video_.codecs(); |
| 227 | } |
| 228 | virtual const std::vector<RtpHeaderExtension>& video_rtp_header_extensions() { |
| 229 | return video_.rtp_header_extensions(); |
| 230 | } |
| 231 | |
| 232 | virtual void SetVoiceLogging(int min_sev, const char* filter) { |
wu@webrtc.org | 967bfff | 2013-09-19 05:49:50 +0000 | [diff] [blame] | 233 | voice_.SetLogging(min_sev, filter); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 234 | } |
| 235 | virtual void SetVideoLogging(int min_sev, const char* filter) { |
wu@webrtc.org | 967bfff | 2013-09-19 05:49:50 +0000 | [diff] [blame] | 236 | video_.SetLogging(min_sev, filter); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 237 | } |
| 238 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 239 | virtual bool StartAecDump(rtc::PlatformFile file) { |
wu@webrtc.org | a989080 | 2013-12-13 00:21:03 +0000 | [diff] [blame] | 240 | return voice_.StartAecDump(file); |
| 241 | } |
| 242 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 243 | virtual bool RegisterVoiceProcessor(uint32 ssrc, |
| 244 | VoiceProcessor* processor, |
| 245 | MediaProcessorDirection direction) { |
| 246 | return voice_.RegisterProcessor(ssrc, processor, direction); |
| 247 | } |
| 248 | virtual bool UnregisterVoiceProcessor(uint32 ssrc, |
| 249 | VoiceProcessor* processor, |
| 250 | MediaProcessorDirection direction) { |
| 251 | return voice_.UnregisterProcessor(ssrc, processor, direction); |
| 252 | } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 253 | |
| 254 | protected: |
| 255 | VOICE voice_; |
| 256 | VIDEO video_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 257 | }; |
| 258 | |
| 259 | // NullVoiceEngine can be used with CompositeMediaEngine in the case where only |
| 260 | // a video engine is desired. |
| 261 | class NullVoiceEngine { |
| 262 | public: |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 263 | bool Init(rtc::Thread* worker_thread) { return true; } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 264 | void Terminate() {} |
| 265 | int GetCapabilities() { return 0; } |
| 266 | // If you need this to return an actual channel, use FakeMediaEngine instead. |
Jelena Marusic | c28a896 | 2015-05-29 15:05:44 +0200 | [diff] [blame] | 267 | VoiceMediaChannel* CreateChannel(const AudioOptions& options) { |
| 268 | return nullptr; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 269 | } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 270 | bool SetDelayOffset(int offset) { return true; } |
mallinath@webrtc.org | a27be8e | 2013-09-27 23:04:10 +0000 | [diff] [blame] | 271 | AudioOptions GetOptions() const { return AudioOptions(); } |
| 272 | bool SetOptions(const AudioOptions& options) { return true; } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 273 | bool SetDevices(const Device* in_device, const Device* out_device) { |
| 274 | return true; |
| 275 | } |
| 276 | bool GetOutputVolume(int* level) { |
| 277 | *level = 0; |
| 278 | return true; |
| 279 | } |
| 280 | bool SetOutputVolume(int level) { return true; } |
| 281 | int GetInputLevel() { return 0; } |
| 282 | bool SetLocalMonitor(bool enable) { return true; } |
| 283 | const std::vector<AudioCodec>& codecs() { return codecs_; } |
| 284 | const std::vector<RtpHeaderExtension>& rtp_header_extensions() { |
| 285 | return rtp_header_extensions_; |
| 286 | } |
| 287 | void SetLogging(int min_sev, const char* filter) {} |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 288 | bool StartAecDump(rtc::PlatformFile file) { return false; } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 289 | bool RegisterProcessor(uint32 ssrc, |
| 290 | VoiceProcessor* voice_processor, |
| 291 | MediaProcessorDirection direction) { return true; } |
| 292 | bool UnregisterProcessor(uint32 ssrc, |
| 293 | VoiceProcessor* voice_processor, |
| 294 | MediaProcessorDirection direction) { return true; } |
| 295 | |
| 296 | private: |
| 297 | std::vector<AudioCodec> codecs_; |
| 298 | std::vector<RtpHeaderExtension> rtp_header_extensions_; |
| 299 | }; |
| 300 | |
| 301 | // NullVideoEngine can be used with CompositeMediaEngine in the case where only |
| 302 | // a voice engine is desired. |
| 303 | class NullVideoEngine { |
| 304 | public: |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 305 | bool Init(rtc::Thread* worker_thread) { return true; } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 306 | void Terminate() {} |
| 307 | int GetCapabilities() { return 0; } |
| 308 | // If you need this to return an actual channel, use FakeMediaEngine instead. |
| 309 | VideoMediaChannel* CreateChannel( |
Noah Richards | 99c2fe5 | 2015-04-10 14:32:39 -0700 | [diff] [blame] | 310 | const VideoOptions& options, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 311 | VoiceMediaChannel* voice_media_channel) { |
| 312 | return NULL; |
| 313 | } |
mallinath@webrtc.org | a27be8e | 2013-09-27 23:04:10 +0000 | [diff] [blame] | 314 | bool SetOptions(const VideoOptions& options) { return true; } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 315 | bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { |
| 316 | return true; |
| 317 | } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 318 | const std::vector<VideoCodec>& codecs() { return codecs_; } |
| 319 | const std::vector<RtpHeaderExtension>& rtp_header_extensions() { |
| 320 | return rtp_header_extensions_; |
| 321 | } |
| 322 | void SetLogging(int min_sev, const char* filter) {} |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 323 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 324 | private: |
| 325 | std::vector<VideoCodec> codecs_; |
| 326 | std::vector<RtpHeaderExtension> rtp_header_extensions_; |
| 327 | }; |
| 328 | |
| 329 | typedef CompositeMediaEngine<NullVoiceEngine, NullVideoEngine> NullMediaEngine; |
| 330 | |
| 331 | enum DataChannelType { |
| 332 | DCT_NONE = 0, |
| 333 | DCT_RTP = 1, |
| 334 | DCT_SCTP = 2 |
| 335 | }; |
| 336 | |
| 337 | class DataEngineInterface { |
| 338 | public: |
| 339 | virtual ~DataEngineInterface() {} |
| 340 | virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; |
| 341 | virtual const std::vector<DataCodec>& data_codecs() = 0; |
| 342 | }; |
| 343 | |
| 344 | } // namespace cricket |
| 345 | |
| 346 | #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ |