OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Default value to be used for SetAudioDelayOffset(). | 67 // Default value to be used for SetAudioDelayOffset(). |
68 static const int kDefaultAudioDelayOffset; | 68 static const int kDefaultAudioDelayOffset; |
69 | 69 |
70 virtual ~MediaEngineInterface() {} | 70 virtual ~MediaEngineInterface() {} |
71 | 71 |
72 // Initialization | 72 // Initialization |
73 // Starts the engine. | 73 // Starts the engine. |
74 virtual bool Init(rtc::Thread* worker_thread) = 0; | 74 virtual bool Init(rtc::Thread* worker_thread) = 0; |
75 // Shuts down the engine. | 75 // Shuts down the engine. |
76 virtual void Terminate() = 0; | 76 virtual void Terminate() = 0; |
77 // Returns what the engine is capable of, as a set of Capabilities, above. | |
78 virtual int GetCapabilities() = 0; | |
79 // TODO(solenberg): Remove once VoE API refactoring is done. | 77 // TODO(solenberg): Remove once VoE API refactoring is done. |
80 virtual webrtc::VoiceEngine* GetVoE() = 0; | 78 virtual webrtc::VoiceEngine* GetVoE() = 0; |
81 | 79 |
82 // MediaChannel creation | 80 // MediaChannel creation |
83 // Creates a voice media channel. Returns NULL on failure. | 81 // Creates a voice media channel. Returns NULL on failure. |
84 virtual VoiceMediaChannel* CreateChannel( | 82 virtual VoiceMediaChannel* CreateChannel( |
85 webrtc::Call* call, | 83 webrtc::Call* call, |
86 const AudioOptions& options) = 0; | 84 const AudioOptions& options) = 0; |
87 // Creates a video media channel, paired with the specified voice channel. | 85 // Creates a video media channel, paired with the specified voice channel. |
88 // Returns NULL on failure. | 86 // Returns NULL on failure. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 virtual bool Init(rtc::Thread* worker_thread) { | 157 virtual bool Init(rtc::Thread* worker_thread) { |
160 if (!voice_.Init(worker_thread)) | 158 if (!voice_.Init(worker_thread)) |
161 return false; | 159 return false; |
162 video_.Init(); | 160 video_.Init(); |
163 return true; | 161 return true; |
164 } | 162 } |
165 virtual void Terminate() { | 163 virtual void Terminate() { |
166 voice_.Terminate(); | 164 voice_.Terminate(); |
167 } | 165 } |
168 | 166 |
169 virtual int GetCapabilities() { | |
170 return (voice_.GetCapabilities() | video_.GetCapabilities()); | |
171 } | |
172 virtual webrtc::VoiceEngine* GetVoE() { | 167 virtual webrtc::VoiceEngine* GetVoE() { |
173 return voice_.GetVoE(); | 168 return voice_.GetVoE(); |
174 } | 169 } |
175 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 170 virtual VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
176 const AudioOptions& options) { | 171 const AudioOptions& options) { |
177 return voice_.CreateChannel(call, options); | 172 return voice_.CreateChannel(call, options); |
178 } | 173 } |
179 virtual VideoMediaChannel* CreateVideoChannel(webrtc::Call* call, | 174 virtual VideoMediaChannel* CreateVideoChannel(webrtc::Call* call, |
180 const VideoOptions& options) { | 175 const VideoOptions& options) { |
181 return video_.CreateChannel(call, options); | 176 return video_.CreateChannel(call, options); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 VOICE voice_; | 232 VOICE voice_; |
238 VIDEO video_; | 233 VIDEO video_; |
239 }; | 234 }; |
240 | 235 |
241 // NullVoiceEngine can be used with CompositeMediaEngine in the case where only | 236 // NullVoiceEngine can be used with CompositeMediaEngine in the case where only |
242 // a video engine is desired. | 237 // a video engine is desired. |
243 class NullVoiceEngine { | 238 class NullVoiceEngine { |
244 public: | 239 public: |
245 bool Init(rtc::Thread* worker_thread) { return true; } | 240 bool Init(rtc::Thread* worker_thread) { return true; } |
246 void Terminate() {} | 241 void Terminate() {} |
247 int GetCapabilities() { return 0; } | |
248 // If you need this to return an actual channel, use FakeMediaEngine instead. | 242 // If you need this to return an actual channel, use FakeMediaEngine instead. |
249 VoiceMediaChannel* CreateChannel(const AudioOptions& options) { | 243 VoiceMediaChannel* CreateChannel(const AudioOptions& options) { |
250 return nullptr; | 244 return nullptr; |
251 } | 245 } |
252 bool SetDelayOffset(int offset) { return true; } | 246 bool SetDelayOffset(int offset) { return true; } |
253 AudioOptions GetOptions() const { return AudioOptions(); } | 247 AudioOptions GetOptions() const { return AudioOptions(); } |
254 bool SetOptions(const AudioOptions& options) { return true; } | 248 bool SetOptions(const AudioOptions& options) { return true; } |
255 bool SetDevices(const Device* in_device, const Device* out_device) { | 249 bool SetDevices(const Device* in_device, const Device* out_device) { |
256 return true; | 250 return true; |
257 } | 251 } |
(...skipping 14 matching lines...) Expand all Loading... |
272 std::vector<AudioCodec> codecs_; | 266 std::vector<AudioCodec> codecs_; |
273 std::vector<RtpHeaderExtension> rtp_header_extensions_; | 267 std::vector<RtpHeaderExtension> rtp_header_extensions_; |
274 }; | 268 }; |
275 | 269 |
276 // NullVideoEngine can be used with CompositeMediaEngine in the case where only | 270 // NullVideoEngine can be used with CompositeMediaEngine in the case where only |
277 // a voice engine is desired. | 271 // a voice engine is desired. |
278 class NullVideoEngine { | 272 class NullVideoEngine { |
279 public: | 273 public: |
280 bool Init(rtc::Thread* worker_thread) { return true; } | 274 bool Init(rtc::Thread* worker_thread) { return true; } |
281 void Terminate() {} | 275 void Terminate() {} |
282 int GetCapabilities() { return 0; } | |
283 // If you need this to return an actual channel, use FakeMediaEngine instead. | 276 // If you need this to return an actual channel, use FakeMediaEngine instead. |
284 VideoMediaChannel* CreateChannel( | 277 VideoMediaChannel* CreateChannel( |
285 const VideoOptions& options, | 278 const VideoOptions& options, |
286 VoiceMediaChannel* voice_media_channel) { | 279 VoiceMediaChannel* voice_media_channel) { |
287 return NULL; | 280 return NULL; |
288 } | 281 } |
289 bool SetOptions(const VideoOptions& options) { return true; } | 282 bool SetOptions(const VideoOptions& options) { return true; } |
290 bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { | 283 bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { |
291 return true; | 284 return true; |
292 } | 285 } |
(...skipping 19 matching lines...) Expand all Loading... |
312 class DataEngineInterface { | 305 class DataEngineInterface { |
313 public: | 306 public: |
314 virtual ~DataEngineInterface() {} | 307 virtual ~DataEngineInterface() {} |
315 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; | 308 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; |
316 virtual const std::vector<DataCodec>& data_codecs() = 0; | 309 virtual const std::vector<DataCodec>& data_codecs() = 0; |
317 }; | 310 }; |
318 | 311 |
319 } // namespace cricket | 312 } // namespace cricket |
320 | 313 |
321 #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ | 314 #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ |
OLD | NEW |