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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // Gets the current microphone level, as a value between 0 and 10. | 108 // Gets the current microphone level, as a value between 0 and 10. |
109 virtual int GetInputLevel() = 0; | 109 virtual int GetInputLevel() = 0; |
110 | 110 |
111 virtual const std::vector<AudioCodec>& audio_codecs() = 0; | 111 virtual const std::vector<AudioCodec>& audio_codecs() = 0; |
112 virtual const std::vector<RtpHeaderExtension>& | 112 virtual const std::vector<RtpHeaderExtension>& |
113 audio_rtp_header_extensions() = 0; | 113 audio_rtp_header_extensions() = 0; |
114 virtual const std::vector<VideoCodec>& video_codecs() = 0; | 114 virtual const std::vector<VideoCodec>& video_codecs() = 0; |
115 virtual const std::vector<RtpHeaderExtension>& | 115 virtual const std::vector<RtpHeaderExtension>& |
116 video_rtp_header_extensions() = 0; | 116 video_rtp_header_extensions() = 0; |
117 | 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 | |
122 // Starts AEC dump using existing file. | 118 // Starts AEC dump using existing file. |
123 virtual bool StartAecDump(rtc::PlatformFile file) = 0; | 119 virtual bool StartAecDump(rtc::PlatformFile file) = 0; |
124 | 120 |
125 // Stops recording AEC dump. | 121 // Stops recording AEC dump. |
126 virtual void StopAecDump() = 0; | 122 virtual void StopAecDump() = 0; |
127 | 123 |
128 // Starts RtcEventLog using existing file. | 124 // Starts RtcEventLog using existing file. |
129 virtual bool StartRtcEventLog(rtc::PlatformFile file) = 0; | 125 virtual bool StartRtcEventLog(rtc::PlatformFile file) = 0; |
130 | 126 |
131 // Stops recording an RtcEventLog. | 127 // Stops recording an RtcEventLog. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 virtual const std::vector<RtpHeaderExtension>& audio_rtp_header_extensions() { | 206 virtual const std::vector<RtpHeaderExtension>& audio_rtp_header_extensions() { |
211 return voice_.rtp_header_extensions(); | 207 return voice_.rtp_header_extensions(); |
212 } | 208 } |
213 virtual const std::vector<VideoCodec>& video_codecs() { | 209 virtual const std::vector<VideoCodec>& video_codecs() { |
214 return video_.codecs(); | 210 return video_.codecs(); |
215 } | 211 } |
216 virtual const std::vector<RtpHeaderExtension>& video_rtp_header_extensions() { | 212 virtual const std::vector<RtpHeaderExtension>& video_rtp_header_extensions() { |
217 return video_.rtp_header_extensions(); | 213 return video_.rtp_header_extensions(); |
218 } | 214 } |
219 | 215 |
220 virtual void SetVoiceLogging(int min_sev, const char* filter) { | |
221 voice_.SetLogging(min_sev, filter); | |
222 } | |
223 virtual void SetVideoLogging(int min_sev, const char* filter) { | |
224 video_.SetLogging(min_sev, filter); | |
225 } | |
226 | |
227 virtual bool StartAecDump(rtc::PlatformFile file) { | 216 virtual bool StartAecDump(rtc::PlatformFile file) { |
228 return voice_.StartAecDump(file); | 217 return voice_.StartAecDump(file); |
229 } | 218 } |
230 | 219 |
231 virtual void StopAecDump() { | 220 virtual void StopAecDump() { |
232 voice_.StopAecDump(); | 221 voice_.StopAecDump(); |
233 } | 222 } |
234 | 223 |
235 virtual bool StartRtcEventLog(rtc::PlatformFile file) { | 224 virtual bool StartRtcEventLog(rtc::PlatformFile file) { |
236 return voice_.StartRtcEventLog(file); | 225 return voice_.StartRtcEventLog(file); |
(...skipping 24 matching lines...) Expand all Loading... |
261 bool GetOutputVolume(int* level) { | 250 bool GetOutputVolume(int* level) { |
262 *level = 0; | 251 *level = 0; |
263 return true; | 252 return true; |
264 } | 253 } |
265 bool SetOutputVolume(int level) { return true; } | 254 bool SetOutputVolume(int level) { return true; } |
266 int GetInputLevel() { return 0; } | 255 int GetInputLevel() { return 0; } |
267 const std::vector<AudioCodec>& codecs() { return codecs_; } | 256 const std::vector<AudioCodec>& codecs() { return codecs_; } |
268 const std::vector<RtpHeaderExtension>& rtp_header_extensions() { | 257 const std::vector<RtpHeaderExtension>& rtp_header_extensions() { |
269 return rtp_header_extensions_; | 258 return rtp_header_extensions_; |
270 } | 259 } |
271 void SetLogging(int min_sev, const char* filter) {} | |
272 bool StartAecDump(rtc::PlatformFile file) { return false; } | 260 bool StartAecDump(rtc::PlatformFile file) { return false; } |
273 bool StartRtcEventLog(rtc::PlatformFile file) { return false; } | 261 bool StartRtcEventLog(rtc::PlatformFile file) { return false; } |
274 void StopRtcEventLog() {} | 262 void StopRtcEventLog() {} |
275 | 263 |
276 private: | 264 private: |
277 std::vector<AudioCodec> codecs_; | 265 std::vector<AudioCodec> codecs_; |
278 std::vector<RtpHeaderExtension> rtp_header_extensions_; | 266 std::vector<RtpHeaderExtension> rtp_header_extensions_; |
279 }; | 267 }; |
280 | 268 |
281 // NullVideoEngine can be used with CompositeMediaEngine in the case where only | 269 // NullVideoEngine can be used with CompositeMediaEngine in the case where only |
282 // a voice engine is desired. | 270 // a voice engine is desired. |
283 class NullVideoEngine { | 271 class NullVideoEngine { |
284 public: | 272 public: |
285 bool Init(rtc::Thread* worker_thread) { return true; } | 273 bool Init(rtc::Thread* worker_thread) { return true; } |
286 void Terminate() {} | 274 void Terminate() {} |
287 // If you need this to return an actual channel, use FakeMediaEngine instead. | 275 // If you need this to return an actual channel, use FakeMediaEngine instead. |
288 VideoMediaChannel* CreateChannel( | 276 VideoMediaChannel* CreateChannel( |
289 const VideoOptions& options, | 277 const VideoOptions& options, |
290 VoiceMediaChannel* voice_media_channel) { | 278 VoiceMediaChannel* voice_media_channel) { |
291 return NULL; | 279 return NULL; |
292 } | 280 } |
293 bool SetOptions(const VideoOptions& options) { return true; } | 281 bool SetOptions(const VideoOptions& options) { return true; } |
294 bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { | 282 bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { |
295 return true; | 283 return true; |
296 } | 284 } |
297 const std::vector<VideoCodec>& codecs() { return codecs_; } | 285 const std::vector<VideoCodec>& codecs() { return codecs_; } |
298 const std::vector<RtpHeaderExtension>& rtp_header_extensions() { | 286 const std::vector<RtpHeaderExtension>& rtp_header_extensions() { |
299 return rtp_header_extensions_; | 287 return rtp_header_extensions_; |
300 } | 288 } |
301 void SetLogging(int min_sev, const char* filter) {} | |
302 | 289 |
303 private: | 290 private: |
304 std::vector<VideoCodec> codecs_; | 291 std::vector<VideoCodec> codecs_; |
305 std::vector<RtpHeaderExtension> rtp_header_extensions_; | 292 std::vector<RtpHeaderExtension> rtp_header_extensions_; |
306 }; | 293 }; |
307 | 294 |
308 typedef CompositeMediaEngine<NullVoiceEngine, NullVideoEngine> NullMediaEngine; | 295 typedef CompositeMediaEngine<NullVoiceEngine, NullVideoEngine> NullMediaEngine; |
309 | 296 |
310 enum DataChannelType { | 297 enum DataChannelType { |
311 DCT_NONE = 0, | 298 DCT_NONE = 0, |
312 DCT_RTP = 1, | 299 DCT_RTP = 1, |
313 DCT_SCTP = 2 | 300 DCT_SCTP = 2 |
314 }; | 301 }; |
315 | 302 |
316 class DataEngineInterface { | 303 class DataEngineInterface { |
317 public: | 304 public: |
318 virtual ~DataEngineInterface() {} | 305 virtual ~DataEngineInterface() {} |
319 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; | 306 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; |
320 virtual const std::vector<DataCodec>& data_codecs() = 0; | 307 virtual const std::vector<DataCodec>& data_codecs() = 0; |
321 }; | 308 }; |
322 | 309 |
323 } // namespace cricket | 310 } // namespace cricket |
324 | 311 |
325 #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ | 312 #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ |
OLD | NEW |