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