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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 return voice_.StartRtcEventLog(file); | 224 return voice_.StartRtcEventLog(file); |
225 } | 225 } |
226 | 226 |
227 virtual void StopRtcEventLog() { voice_.StopRtcEventLog(); } | 227 virtual void StopRtcEventLog() { voice_.StopRtcEventLog(); } |
228 | 228 |
229 protected: | 229 protected: |
230 VOICE voice_; | 230 VOICE voice_; |
231 VIDEO video_; | 231 VIDEO video_; |
232 }; | 232 }; |
233 | 233 |
234 // NullVoiceEngine can be used with CompositeMediaEngine in the case where only | |
235 // a video engine is desired. | |
236 class NullVoiceEngine { | |
237 public: | |
238 bool Init(rtc::Thread* worker_thread) { return true; } | |
239 void Terminate() {} | |
240 // If you need this to return an actual channel, use FakeMediaEngine instead. | |
241 VoiceMediaChannel* CreateChannel(const AudioOptions& options) { | |
242 return nullptr; | |
243 } | |
244 AudioOptions GetOptions() const { return AudioOptions(); } | |
245 bool SetOptions(const AudioOptions& options) { return true; } | |
246 bool SetDevices(const Device* in_device, const Device* out_device) { | |
247 return true; | |
248 } | |
249 bool GetOutputVolume(int* level) { | |
250 *level = 0; | |
251 return true; | |
252 } | |
253 bool SetOutputVolume(int level) { return true; } | |
254 int GetInputLevel() { return 0; } | |
255 const std::vector<AudioCodec>& codecs() { return codecs_; } | |
256 const std::vector<RtpHeaderExtension>& rtp_header_extensions() { | |
257 return rtp_header_extensions_; | |
258 } | |
259 bool StartAecDump(rtc::PlatformFile file) { return false; } | |
260 bool StartRtcEventLog(rtc::PlatformFile file) { return false; } | |
261 void StopRtcEventLog() {} | |
262 | |
263 private: | |
264 std::vector<AudioCodec> codecs_; | |
265 std::vector<RtpHeaderExtension> rtp_header_extensions_; | |
266 }; | |
267 | |
268 // NullVideoEngine can be used with CompositeMediaEngine in the case where only | |
269 // a voice engine is desired. | |
270 class NullVideoEngine { | |
271 public: | |
272 bool Init(rtc::Thread* worker_thread) { return true; } | |
273 void Terminate() {} | |
274 // If you need this to return an actual channel, use FakeMediaEngine instead. | |
275 VideoMediaChannel* CreateChannel( | |
276 const VideoOptions& options, | |
277 VoiceMediaChannel* voice_media_channel) { | |
278 return NULL; | |
279 } | |
280 bool SetOptions(const VideoOptions& options) { return true; } | |
281 bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { | |
282 return true; | |
283 } | |
284 const std::vector<VideoCodec>& codecs() { return codecs_; } | |
285 const std::vector<RtpHeaderExtension>& rtp_header_extensions() { | |
286 return rtp_header_extensions_; | |
287 } | |
288 | |
289 private: | |
290 std::vector<VideoCodec> codecs_; | |
291 std::vector<RtpHeaderExtension> rtp_header_extensions_; | |
292 }; | |
293 | |
294 typedef CompositeMediaEngine<NullVoiceEngine, NullVideoEngine> NullMediaEngine; | |
295 | |
296 enum DataChannelType { | 234 enum DataChannelType { |
297 DCT_NONE = 0, | 235 DCT_NONE = 0, |
298 DCT_RTP = 1, | 236 DCT_RTP = 1, |
299 DCT_SCTP = 2 | 237 DCT_SCTP = 2 |
300 }; | 238 }; |
301 | 239 |
302 class DataEngineInterface { | 240 class DataEngineInterface { |
303 public: | 241 public: |
304 virtual ~DataEngineInterface() {} | 242 virtual ~DataEngineInterface() {} |
305 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; | 243 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; |
306 virtual const std::vector<DataCodec>& data_codecs() = 0; | 244 virtual const std::vector<DataCodec>& data_codecs() = 0; |
307 }; | 245 }; |
308 | 246 |
309 } // namespace cricket | 247 } // namespace cricket |
310 | 248 |
311 #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ | 249 #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ |
OLD | NEW |