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