| 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 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 if (!packet_sizes_ms.empty()) { | 1471 if (!packet_sizes_ms.empty()) { |
| 1472 int max_packet_size_ms = | 1472 int max_packet_size_ms = |
| 1473 *std::max_element(packet_sizes_ms.begin(), packet_sizes_ms.end()); | 1473 *std::max_element(packet_sizes_ms.begin(), packet_sizes_ms.end()); |
| 1474 int min_packet_size_ms = | 1474 int min_packet_size_ms = |
| 1475 *std::min_element(packet_sizes_ms.begin(), packet_sizes_ms.end()); | 1475 *std::min_element(packet_sizes_ms.begin(), packet_sizes_ms.end()); |
| 1476 | 1476 |
| 1477 // Audio network adaptor will just use 20ms and 60ms frame lengths. | 1477 // Audio network adaptor will just use 20ms and 60ms frame lengths. |
| 1478 // The adaptor will only be active for the Opus encoder. | 1478 // The adaptor will only be active for the Opus encoder. |
| 1479 if (config_.audio_network_adaptor_config && | 1479 if (config_.audio_network_adaptor_config && |
| 1480 IsCodec(config_.send_codec_spec.codec_inst, kOpusCodecName)) { | 1480 IsCodec(config_.send_codec_spec.codec_inst, kOpusCodecName)) { |
| 1481 #if WEBRTC_OPUS_SUPPORT_120MS_PTIME |
| 1482 max_packet_size_ms = 120; |
| 1483 #else |
| 1481 max_packet_size_ms = 60; | 1484 max_packet_size_ms = 60; |
| 1485 #endif |
| 1482 min_packet_size_ms = 20; | 1486 min_packet_size_ms = 20; |
| 1483 } | 1487 } |
| 1484 | 1488 |
| 1485 // OverheadPerPacket = Ipv4(20B) + UDP(8B) + SRTP(10B) + RTP(12) | 1489 // OverheadPerPacket = Ipv4(20B) + UDP(8B) + SRTP(10B) + RTP(12) |
| 1486 constexpr int kOverheadPerPacket = 20 + 8 + 10 + 12; | 1490 constexpr int kOverheadPerPacket = 20 + 8 + 10 + 12; |
| 1487 | 1491 |
| 1488 int min_overhead_bps = | 1492 int min_overhead_bps = |
| 1489 kOverheadPerPacket * 8 * 1000 / max_packet_size_ms; | 1493 kOverheadPerPacket * 8 * 1000 / max_packet_size_ms; |
| 1490 | 1494 |
| 1491 int max_overhead_bps = | 1495 int max_overhead_bps = |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2710 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2714 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 2711 const auto it = send_streams_.find(ssrc); | 2715 const auto it = send_streams_.find(ssrc); |
| 2712 if (it != send_streams_.end()) { | 2716 if (it != send_streams_.end()) { |
| 2713 return it->second->channel(); | 2717 return it->second->channel(); |
| 2714 } | 2718 } |
| 2715 return -1; | 2719 return -1; |
| 2716 } | 2720 } |
| 2717 } // namespace cricket | 2721 } // namespace cricket |
| 2718 | 2722 |
| 2719 #endif // HAVE_WEBRTC_VOICE | 2723 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |