Chromium Code Reviews| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 // Device configuration | 101 // Device configuration |
| 102 // Gets the current speaker volume, as a value between 0 and 255. | 102 // Gets the current speaker volume, as a value between 0 and 255. |
| 103 virtual bool GetOutputVolume(int* level) = 0; | 103 virtual bool GetOutputVolume(int* level) = 0; |
| 104 // Sets the current speaker volume, as a value between 0 and 255. | 104 // Sets the current speaker volume, as a value between 0 and 255. |
| 105 virtual bool SetOutputVolume(int level) = 0; | 105 virtual bool SetOutputVolume(int level) = 0; |
| 106 | 106 |
| 107 // Gets the current microphone level, as a value between 0 and 10. | 107 // Gets the current microphone level, as a value between 0 and 10. |
| 108 virtual int GetInputLevel() = 0; | 108 virtual int GetInputLevel() = 0; |
| 109 | 109 |
| 110 virtual const std::vector<AudioCodec>& audio_codecs() = 0; | 110 virtual const std::vector<AudioCodec>& audio_codecs() = 0; |
| 111 virtual const std::vector<RtpHeaderExtension>& | 111 virtual std::vector<RtpHeaderExtension> audio_rtp_header_extensions() = 0; |
|
pthatcher1
2015/12/01 18:40:46
This is only called in one place (channelmanager.c
stefan-webrtc
2015/12/04 14:06:11
Done.
| |
| 112 audio_rtp_header_extensions() = 0; | |
| 113 virtual const std::vector<VideoCodec>& video_codecs() = 0; | 112 virtual const std::vector<VideoCodec>& video_codecs() = 0; |
| 114 virtual const std::vector<RtpHeaderExtension>& | 113 virtual std::vector<RtpHeaderExtension> video_rtp_header_extensions() = 0; |
| 115 video_rtp_header_extensions() = 0; | |
| 116 | 114 |
| 117 // Starts AEC dump using existing file. | 115 // Starts AEC dump using existing file. |
| 118 virtual bool StartAecDump(rtc::PlatformFile file) = 0; | 116 virtual bool StartAecDump(rtc::PlatformFile file) = 0; |
| 119 | 117 |
| 120 // Stops recording AEC dump. | 118 // Stops recording AEC dump. |
| 121 virtual void StopAecDump() = 0; | 119 virtual void StopAecDump() = 0; |
| 122 | 120 |
| 123 // Starts RtcEventLog using existing file. | 121 // Starts RtcEventLog using existing file. |
| 124 virtual bool StartRtcEventLog(rtc::PlatformFile file) = 0; | 122 virtual bool StartRtcEventLog(rtc::PlatformFile file) = 0; |
| 125 | 123 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 virtual bool SetOutputVolume(int level) { | 193 virtual bool SetOutputVolume(int level) { |
| 196 return voice_.SetOutputVolume(level); | 194 return voice_.SetOutputVolume(level); |
| 197 } | 195 } |
| 198 | 196 |
| 199 virtual int GetInputLevel() { | 197 virtual int GetInputLevel() { |
| 200 return voice_.GetInputLevel(); | 198 return voice_.GetInputLevel(); |
| 201 } | 199 } |
| 202 virtual const std::vector<AudioCodec>& audio_codecs() { | 200 virtual const std::vector<AudioCodec>& audio_codecs() { |
| 203 return voice_.codecs(); | 201 return voice_.codecs(); |
| 204 } | 202 } |
| 205 virtual const std::vector<RtpHeaderExtension>& audio_rtp_header_extensions() { | 203 virtual std::vector<RtpHeaderExtension> audio_rtp_header_extensions() { |
| 206 return voice_.rtp_header_extensions(); | 204 return voice_.SupportedRtpHeaderExtensions(); |
| 207 } | 205 } |
| 208 virtual const std::vector<VideoCodec>& video_codecs() { | 206 virtual const std::vector<VideoCodec>& video_codecs() { |
| 209 return video_.codecs(); | 207 return video_.codecs(); |
| 210 } | 208 } |
| 211 virtual const std::vector<RtpHeaderExtension>& video_rtp_header_extensions() { | 209 virtual std::vector<RtpHeaderExtension> video_rtp_header_extensions() { |
| 212 return video_.rtp_header_extensions(); | 210 return video_.SupportedRtpHeaderExtensions(); |
| 213 } | 211 } |
| 214 | 212 |
| 215 virtual bool StartAecDump(rtc::PlatformFile file) { | 213 virtual bool StartAecDump(rtc::PlatformFile file) { |
| 216 return voice_.StartAecDump(file); | 214 return voice_.StartAecDump(file); |
| 217 } | 215 } |
| 218 | 216 |
| 219 virtual void StopAecDump() { | 217 virtual void StopAecDump() { |
| 220 voice_.StopAecDump(); | 218 voice_.StopAecDump(); |
| 221 } | 219 } |
| 222 | 220 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 246 bool SetDevices(const Device* in_device, const Device* out_device) { | 244 bool SetDevices(const Device* in_device, const Device* out_device) { |
| 247 return true; | 245 return true; |
| 248 } | 246 } |
| 249 bool GetOutputVolume(int* level) { | 247 bool GetOutputVolume(int* level) { |
| 250 *level = 0; | 248 *level = 0; |
| 251 return true; | 249 return true; |
| 252 } | 250 } |
| 253 bool SetOutputVolume(int level) { return true; } | 251 bool SetOutputVolume(int level) { return true; } |
| 254 int GetInputLevel() { return 0; } | 252 int GetInputLevel() { return 0; } |
| 255 const std::vector<AudioCodec>& codecs() { return codecs_; } | 253 const std::vector<AudioCodec>& codecs() { return codecs_; } |
| 256 const std::vector<RtpHeaderExtension>& rtp_header_extensions() { | 254 std::vector<RtpHeaderExtension> SupportedRtpHeaderExtensions() const { |
| 257 return rtp_header_extensions_; | 255 return rtp_header_extensions_; |
| 258 } | 256 } |
| 259 bool StartAecDump(rtc::PlatformFile file) { return false; } | 257 bool StartAecDump(rtc::PlatformFile file) { return false; } |
| 260 bool StartRtcEventLog(rtc::PlatformFile file) { return false; } | 258 bool StartRtcEventLog(rtc::PlatformFile file) { return false; } |
| 261 void StopRtcEventLog() {} | 259 void StopRtcEventLog() {} |
| 262 | 260 |
| 263 private: | 261 private: |
| 264 std::vector<AudioCodec> codecs_; | 262 std::vector<AudioCodec> codecs_; |
| 265 std::vector<RtpHeaderExtension> rtp_header_extensions_; | 263 std::vector<RtpHeaderExtension> rtp_header_extensions_; |
| 266 }; | 264 }; |
| 267 | 265 |
| 268 // NullVideoEngine can be used with CompositeMediaEngine in the case where only | 266 // NullVideoEngine can be used with CompositeMediaEngine in the case where only |
| 269 // a voice engine is desired. | 267 // a voice engine is desired. |
| 270 class NullVideoEngine { | 268 class NullVideoEngine { |
| 271 public: | 269 public: |
| 272 bool Init(rtc::Thread* worker_thread) { return true; } | 270 bool Init(rtc::Thread* worker_thread) { return true; } |
| 273 void Terminate() {} | 271 void Terminate() {} |
| 274 // If you need this to return an actual channel, use FakeMediaEngine instead. | 272 // If you need this to return an actual channel, use FakeMediaEngine instead. |
| 275 VideoMediaChannel* CreateChannel( | 273 VideoMediaChannel* CreateChannel( |
| 276 const VideoOptions& options, | 274 const VideoOptions& options, |
| 277 VoiceMediaChannel* voice_media_channel) { | 275 VoiceMediaChannel* voice_media_channel) { |
| 278 return NULL; | 276 return NULL; |
| 279 } | 277 } |
| 280 bool SetOptions(const VideoOptions& options) { return true; } | 278 bool SetOptions(const VideoOptions& options) { return true; } |
| 281 bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { | 279 bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { |
| 282 return true; | 280 return true; |
| 283 } | 281 } |
| 284 const std::vector<VideoCodec>& codecs() { return codecs_; } | 282 const std::vector<VideoCodec>& codecs() { return codecs_; } |
| 285 const std::vector<RtpHeaderExtension>& rtp_header_extensions() { | 283 std::vector<RtpHeaderExtension> SupportedRtpHeaderExtensions() const { |
| 286 return rtp_header_extensions_; | 284 return rtp_header_extensions_; |
| 287 } | 285 } |
| 288 | 286 |
| 289 private: | 287 private: |
| 290 std::vector<VideoCodec> codecs_; | 288 std::vector<VideoCodec> codecs_; |
| 291 std::vector<RtpHeaderExtension> rtp_header_extensions_; | 289 std::vector<RtpHeaderExtension> rtp_header_extensions_; |
| 292 }; | 290 }; |
| 293 | 291 |
| 294 typedef CompositeMediaEngine<NullVoiceEngine, NullVideoEngine> NullMediaEngine; | 292 typedef CompositeMediaEngine<NullVoiceEngine, NullVideoEngine> NullMediaEngine; |
| 295 | 293 |
| 296 enum DataChannelType { | 294 enum DataChannelType { |
| 297 DCT_NONE = 0, | 295 DCT_NONE = 0, |
| 298 DCT_RTP = 1, | 296 DCT_RTP = 1, |
| 299 DCT_SCTP = 2 | 297 DCT_SCTP = 2 |
| 300 }; | 298 }; |
| 301 | 299 |
| 302 class DataEngineInterface { | 300 class DataEngineInterface { |
| 303 public: | 301 public: |
| 304 virtual ~DataEngineInterface() {} | 302 virtual ~DataEngineInterface() {} |
| 305 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; | 303 virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; |
| 306 virtual const std::vector<DataCodec>& data_codecs() = 0; | 304 virtual const std::vector<DataCodec>& data_codecs() = 0; |
| 307 }; | 305 }; |
| 308 | 306 |
| 309 } // namespace cricket | 307 } // namespace cricket |
| 310 | 308 |
| 311 #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ | 309 #endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ |
| OLD | NEW |