Chromium Code Reviews| 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 2387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2398 | 2398 |
| 2399 int WebRtcVoiceMediaChannel::GetOutputLevel() { | 2399 int WebRtcVoiceMediaChannel::GetOutputLevel() { |
| 2400 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2400 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 2401 int highest = 0; | 2401 int highest = 0; |
| 2402 for (const auto& ch : recv_streams_) { | 2402 for (const auto& ch : recv_streams_) { |
| 2403 highest = std::max(GetOutputLevel(ch.second->channel()), highest); | 2403 highest = std::max(GetOutputLevel(ch.second->channel()), highest); |
| 2404 } | 2404 } |
| 2405 return highest; | 2405 return highest; |
| 2406 } | 2406 } |
| 2407 | 2407 |
| 2408 int WebRtcVoiceMediaChannel::GetTimeSinceLastTyping() { | |
| 2409 int ret; | |
| 2410 if (engine()->voe()->processing()->TimeSinceLastTyping(ret) == -1) { | |
| 2411 // In case of error, log the info and continue | |
| 2412 LOG_RTCERR0(TimeSinceLastTyping); | |
| 2413 ret = -1; | |
| 2414 } else { | |
| 2415 ret *= 1000; // We return ms, webrtc returns seconds. | |
|
ossu
2017/02/09 15:49:03
This is the most confusing comment I've seen in a
| |
| 2416 } | |
| 2417 return ret; | |
| 2418 } | |
| 2419 | |
| 2420 void WebRtcVoiceMediaChannel::SetTypingDetectionParameters(int time_window, | |
| 2421 int cost_per_typing, int reporting_threshold, int penalty_decay, | |
| 2422 int type_event_delay) { | |
| 2423 if (engine()->voe()->processing()->SetTypingDetectionParameters( | |
| 2424 time_window, cost_per_typing, | |
| 2425 reporting_threshold, penalty_decay, type_event_delay) == -1) { | |
| 2426 // In case of error, log the info and continue | |
| 2427 LOG_RTCERR5(SetTypingDetectionParameters, time_window, | |
| 2428 cost_per_typing, reporting_threshold, penalty_decay, | |
| 2429 type_event_delay); | |
| 2430 } | |
| 2431 } | |
| 2432 | |
| 2433 bool WebRtcVoiceMediaChannel::SetOutputVolume(uint32_t ssrc, double volume) { | 2408 bool WebRtcVoiceMediaChannel::SetOutputVolume(uint32_t ssrc, double volume) { |
| 2434 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2409 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 2435 if (ssrc == 0) { | 2410 if (ssrc == 0) { |
| 2436 default_recv_volume_ = volume; | 2411 default_recv_volume_ = volume; |
| 2437 if (default_recv_ssrc_ == -1) { | 2412 if (default_recv_ssrc_ == -1) { |
| 2438 return true; | 2413 return true; |
| 2439 } | 2414 } |
| 2440 ssrc = static_cast<uint32_t>(default_recv_ssrc_); | 2415 ssrc = static_cast<uint32_t>(default_recv_ssrc_); |
| 2441 } | 2416 } |
| 2442 const auto it = recv_streams_.find(ssrc); | 2417 const auto it = recv_streams_.find(ssrc); |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2725 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2700 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 2726 const auto it = send_streams_.find(ssrc); | 2701 const auto it = send_streams_.find(ssrc); |
| 2727 if (it != send_streams_.end()) { | 2702 if (it != send_streams_.end()) { |
| 2728 return it->second->channel(); | 2703 return it->second->channel(); |
| 2729 } | 2704 } |
| 2730 return -1; | 2705 return -1; |
| 2731 } | 2706 } |
| 2732 } // namespace cricket | 2707 } // namespace cricket |
| 2733 | 2708 |
| 2734 #endif // HAVE_WEBRTC_VOICE | 2709 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |