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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // Starts AEC dump using existing file. | 153 // Starts AEC dump using existing file. |
154 bool StartAecDump(rtc::PlatformFile file); | 154 bool StartAecDump(rtc::PlatformFile file); |
155 | 155 |
156 // Check whether the supplied trace should be ignored. | 156 // Check whether the supplied trace should be ignored. |
157 bool ShouldIgnoreTrace(const std::string& trace); | 157 bool ShouldIgnoreTrace(const std::string& trace); |
158 | 158 |
159 // Create a VoiceEngine Channel. | 159 // Create a VoiceEngine Channel. |
160 int CreateMediaVoiceChannel(); | 160 int CreateMediaVoiceChannel(); |
161 | 161 |
162 private: | 162 private: |
163 typedef std::vector<WebRtcVoiceMediaChannel *> ChannelList; | 163 typedef std::vector<WebRtcVoiceMediaChannel*> ChannelList; |
164 typedef sigslot:: | 164 typedef sigslot:: |
165 signal3<uint32, MediaProcessorDirection, AudioFrame*> FrameSignal; | 165 signal3<uint32, MediaProcessorDirection, AudioFrame*> FrameSignal; |
166 | 166 |
167 void Construct(); | 167 void Construct(); |
168 void ConstructCodecs(); | 168 void ConstructCodecs(); |
169 bool GetVoeCodec(int index, webrtc::CodecInst* codec); | 169 bool GetVoeCodec(int index, webrtc::CodecInst* codec); |
170 bool InitInternal(); | 170 bool InitInternal(); |
171 void SetTraceFilter(int filter); | 171 void SetTraceFilter(int filter); |
172 void SetTraceOptions(const std::string& options); | 172 void SetTraceOptions(const std::string& options); |
173 // Applies either options or overrides. Every option that is "set" | 173 // Applies either options or overrides. Every option that is "set" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 int SendRTCPPacket(int channel, const void* data, size_t len) override { | 350 int SendRTCPPacket(int channel, const void* data, size_t len) override { |
351 rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len, | 351 rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len, |
352 kMaxRtpPacketLen); | 352 kMaxRtpPacketLen); |
353 return VoiceMediaChannel::SendRtcp(&packet) ? static_cast<int>(len) : -1; | 353 return VoiceMediaChannel::SendRtcp(&packet) ? static_cast<int>(len) : -1; |
354 } | 354 } |
355 | 355 |
356 bool FindSsrc(int channel_num, uint32* ssrc); | 356 bool FindSsrc(int channel_num, uint32* ssrc); |
357 void OnError(uint32 ssrc, int error); | 357 void OnError(uint32 ssrc, int error); |
358 | 358 |
359 bool sending() const { return send_ != SEND_NOTHING; } | 359 bool sending() const { return send_ != SEND_NOTHING; } |
360 int GetReceiveChannelNum(uint32 ssrc); | 360 int GetReceiveChannelNum(uint32 ssrc) const; |
361 int GetSendChannelNum(uint32 ssrc); | 361 int GetSendChannelNum(uint32 ssrc) const; |
362 | 362 |
363 void SetCall(webrtc::Call* call); | 363 void SetCall(webrtc::Call* call); |
364 | 364 |
365 private: | 365 private: |
366 WebRtcVoiceEngine* engine() { return engine_; } | 366 WebRtcVoiceEngine* engine() { return engine_; } |
367 int GetLastEngineError() { return engine()->GetLastEngineError(); } | 367 int GetLastEngineError() { return engine()->GetLastEngineError(); } |
368 int GetOutputLevel(int channel); | 368 int GetOutputLevel(int channel); |
369 bool GetRedSendCodec(const AudioCodec& red_codec, | 369 bool GetRedSendCodec(const AudioCodec& red_codec, |
370 const std::vector<AudioCodec>& all_codecs, | 370 const std::vector<AudioCodec>& all_codecs, |
371 webrtc::CodecInst* send_codec); | 371 webrtc::CodecInst* send_codec); |
(...skipping 27 matching lines...) Expand all Loading... |
399 bool IsDefaultChannel(int channel_id) const { | 399 bool IsDefaultChannel(int channel_id) const { |
400 return channel_id == voe_channel(); | 400 return channel_id == voe_channel(); |
401 } | 401 } |
402 bool SetSendCodecs(int channel, const std::vector<AudioCodec>& codecs); | 402 bool SetSendCodecs(int channel, const std::vector<AudioCodec>& codecs); |
403 bool SetSendBitrateInternal(int bps); | 403 bool SetSendBitrateInternal(int bps); |
404 | 404 |
405 bool SetHeaderExtension(ExtensionSetterFunction setter, int channel_id, | 405 bool SetHeaderExtension(ExtensionSetterFunction setter, int channel_id, |
406 const RtpHeaderExtension* extension); | 406 const RtpHeaderExtension* extension); |
407 void TryAddAudioRecvStream(uint32 ssrc); | 407 void TryAddAudioRecvStream(uint32 ssrc); |
408 void TryRemoveAudioRecvStream(uint32 ssrc); | 408 void TryRemoveAudioRecvStream(uint32 ssrc); |
| 409 bool SetRecvCodecsInternal(const std::vector<AudioCodec>& new_codecs); |
409 | 410 |
410 bool SetChannelRecvRtpHeaderExtensions( | 411 bool SetChannelRecvRtpHeaderExtensions( |
411 int channel_id, | 412 int channel_id, |
412 const std::vector<RtpHeaderExtension>& extensions); | 413 const std::vector<RtpHeaderExtension>& extensions); |
413 bool SetChannelSendRtpHeaderExtensions( | 414 bool SetChannelSendRtpHeaderExtensions( |
414 int channel_id, | 415 int channel_id, |
415 const std::vector<RtpHeaderExtension>& extensions); | 416 const std::vector<RtpHeaderExtension>& extensions); |
416 | 417 |
417 rtc::ThreadChecker thread_checker_; | 418 rtc::ThreadChecker thread_checker_; |
418 | 419 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 455 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
455 | 456 |
456 // Do not lock this on the VoE media processor thread; potential for deadlock | 457 // Do not lock this on the VoE media processor thread; potential for deadlock |
457 // exists. | 458 // exists. |
458 mutable rtc::CriticalSection receive_channels_cs_; | 459 mutable rtc::CriticalSection receive_channels_cs_; |
459 }; | 460 }; |
460 | 461 |
461 } // namespace cricket | 462 } // namespace cricket |
462 | 463 |
463 #endif // TALK_MEDIA_WEBRTCVOICEENGINE_H_ | 464 #endif // TALK_MEDIA_WEBRTCVOICEENGINE_H_ |
OLD | NEW |