| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 |
| 11 #include "webrtc/voice_engine/channel_proxy.h" | 11 #include "webrtc/voice_engine/channel_proxy.h" |
| 12 | 12 |
| 13 #include <utility> | 13 #include <utility> |
| 14 | 14 |
| 15 #include "webrtc/api/call/audio_sink.h" | 15 #include "webrtc/api/call/audio_sink.h" |
| 16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
| 17 #include "webrtc/base/logging.h" |
| 17 #include "webrtc/voice_engine/channel.h" | 18 #include "webrtc/voice_engine/channel.h" |
| 18 | 19 |
| 19 namespace webrtc { | 20 namespace webrtc { |
| 20 namespace voe { | 21 namespace voe { |
| 21 ChannelProxy::ChannelProxy() : channel_owner_(nullptr) {} | 22 ChannelProxy::ChannelProxy() : channel_owner_(nullptr) {} |
| 22 | 23 |
| 23 ChannelProxy::ChannelProxy(const ChannelOwner& channel_owner) : | 24 ChannelProxy::ChannelProxy(const ChannelOwner& channel_owner) : |
| 24 channel_owner_(channel_owner) { | 25 channel_owner_(channel_owner) { |
| 25 RTC_CHECK(channel_owner_.channel()); | 26 RTC_CHECK(channel_owner_.channel()); |
| 26 module_process_thread_checker_.DetachFromThread(); | 27 module_process_thread_checker_.DetachFromThread(); |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 RTC_DCHECK(!error || timestamp == 0); | 278 RTC_DCHECK(!error || timestamp == 0); |
| 278 return timestamp; | 279 return timestamp; |
| 279 } | 280 } |
| 280 | 281 |
| 281 void ChannelProxy::SetMinimumPlayoutDelay(int delay_ms) { | 282 void ChannelProxy::SetMinimumPlayoutDelay(int delay_ms) { |
| 282 RTC_DCHECK(module_process_thread_checker_.CalledOnValidThread()); | 283 RTC_DCHECK(module_process_thread_checker_.CalledOnValidThread()); |
| 283 // Limit to range accepted by both VoE and ACM, so we're at least getting as | 284 // Limit to range accepted by both VoE and ACM, so we're at least getting as |
| 284 // close as possible, instead of failing. | 285 // close as possible, instead of failing. |
| 285 delay_ms = std::max(0, std::min(delay_ms, 10000)); | 286 delay_ms = std::max(0, std::min(delay_ms, 10000)); |
| 286 int error = channel()->SetMinimumPlayoutDelay(delay_ms); | 287 int error = channel()->SetMinimumPlayoutDelay(delay_ms); |
| 287 RTC_DCHECK_EQ(0, error); | 288 if (0 != error) { |
| 289 LOG(LS_WARNING) << "Error setting minimum playout delay."; |
| 290 } |
| 288 } | 291 } |
| 289 | 292 |
| 290 void ChannelProxy::SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) { | 293 void ChannelProxy::SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) { |
| 291 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 294 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 292 channel()->SetRtcpRttStats(rtcp_rtt_stats); | 295 channel()->SetRtcpRttStats(rtcp_rtt_stats); |
| 293 } | 296 } |
| 294 | 297 |
| 295 bool ChannelProxy::GetRecCodec(CodecInst* codec_inst) const { | 298 bool ChannelProxy::GetRecCodec(CodecInst* codec_inst) const { |
| 296 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 299 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 297 return channel()->GetRecCodec(*codec_inst) == 0; | 300 return channel()->GetRecCodec(*codec_inst) == 0; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 return channel()->SetSendCNPayloadType(type, frequency) == 0; | 363 return channel()->SetSendCNPayloadType(type, frequency) == 0; |
| 361 } | 364 } |
| 362 | 365 |
| 363 Channel* ChannelProxy::channel() const { | 366 Channel* ChannelProxy::channel() const { |
| 364 RTC_DCHECK(channel_owner_.channel()); | 367 RTC_DCHECK(channel_owner_.channel()); |
| 365 return channel_owner_.channel(); | 368 return channel_owner_.channel(); |
| 366 } | 369 } |
| 367 | 370 |
| 368 } // namespace voe | 371 } // namespace voe |
| 369 } // namespace webrtc | 372 } // namespace webrtc |
| OLD | NEW |