| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 bool IsCodec(const webrtc::CodecInst& codec, const char* ref_name) { | 152 bool IsCodec(const webrtc::CodecInst& codec, const char* ref_name) { |
| 153 return (_stricmp(codec.plname, ref_name) == 0); | 153 return (_stricmp(codec.plname, ref_name) == 0); |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool FindCodec(const std::vector<AudioCodec>& codecs, | 156 bool FindCodec(const std::vector<AudioCodec>& codecs, |
| 157 const AudioCodec& codec, | 157 const AudioCodec& codec, |
| 158 AudioCodec* found_codec) { | 158 AudioCodec* found_codec) { |
| 159 for (const AudioCodec& c : codecs) { | 159 for (const AudioCodec& c : codecs) { |
| 160 if (c.Matches(codec)) { | 160 if (c.Matches(codec)) { |
| 161 if (found_codec != NULL) { | 161 if (found_codec != nullptr) { |
| 162 *found_codec = c; | 162 *found_codec = c; |
| 163 } | 163 } |
| 164 return true; | 164 return true; |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 return false; | 167 return false; |
| 168 } | 168 } |
| 169 | 169 |
| 170 bool VerifyUniquePayloadTypes(const std::vector<AudioCodec>& codecs) { | 170 bool VerifyUniquePayloadTypes(const std::vector<AudioCodec>& codecs) { |
| 171 if (codecs.empty()) { | 171 if (codecs.empty()) { |
| (...skipping 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2654 } | 2654 } |
| 2655 | 2655 |
| 2656 return true; | 2656 return true; |
| 2657 } | 2657 } |
| 2658 | 2658 |
| 2659 void WebRtcVoiceMediaChannel::SetRawAudioSink( | 2659 void WebRtcVoiceMediaChannel::SetRawAudioSink( |
| 2660 uint32_t ssrc, | 2660 uint32_t ssrc, |
| 2661 std::unique_ptr<webrtc::AudioSinkInterface> sink) { | 2661 std::unique_ptr<webrtc::AudioSinkInterface> sink) { |
| 2662 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2662 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 2663 LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::SetRawAudioSink: ssrc:" << ssrc | 2663 LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::SetRawAudioSink: ssrc:" << ssrc |
| 2664 << " " << (sink ? "(ptr)" : "NULL"); | 2664 << " " << (sink ? "(ptr)" : "null"); |
| 2665 if (ssrc == 0) { | 2665 if (ssrc == 0) { |
| 2666 if (default_recv_ssrc_ != -1) { | 2666 if (default_recv_ssrc_ != -1) { |
| 2667 std::unique_ptr<webrtc::AudioSinkInterface> proxy_sink( | 2667 std::unique_ptr<webrtc::AudioSinkInterface> proxy_sink( |
| 2668 sink ? new ProxySink(sink.get()) : nullptr); | 2668 sink ? new ProxySink(sink.get()) : nullptr); |
| 2669 SetRawAudioSink(default_recv_ssrc_, std::move(proxy_sink)); | 2669 SetRawAudioSink(default_recv_ssrc_, std::move(proxy_sink)); |
| 2670 } | 2670 } |
| 2671 default_sink_ = std::move(sink); | 2671 default_sink_ = std::move(sink); |
| 2672 return; | 2672 return; |
| 2673 } | 2673 } |
| 2674 const auto it = recv_streams_.find(ssrc); | 2674 const auto it = recv_streams_.find(ssrc); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2698 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2698 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 2699 const auto it = send_streams_.find(ssrc); | 2699 const auto it = send_streams_.find(ssrc); |
| 2700 if (it != send_streams_.end()) { | 2700 if (it != send_streams_.end()) { |
| 2701 return it->second->channel(); | 2701 return it->second->channel(); |
| 2702 } | 2702 } |
| 2703 return -1; | 2703 return -1; |
| 2704 } | 2704 } |
| 2705 } // namespace cricket | 2705 } // namespace cricket |
| 2706 | 2706 |
| 2707 #endif // HAVE_WEBRTC_VOICE | 2707 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |