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