Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2669733002: Add 120ms frame ability to ANA (Closed)
Patch Set: Rebased Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 if (!packet_sizes_ms.empty()) { 1470 if (!packet_sizes_ms.empty()) {
1471 int max_packet_size_ms = 1471 int max_packet_size_ms =
1472 *std::max_element(packet_sizes_ms.begin(), packet_sizes_ms.end()); 1472 *std::max_element(packet_sizes_ms.begin(), packet_sizes_ms.end());
1473 int min_packet_size_ms = 1473 int min_packet_size_ms =
1474 *std::min_element(packet_sizes_ms.begin(), packet_sizes_ms.end()); 1474 *std::min_element(packet_sizes_ms.begin(), packet_sizes_ms.end());
1475 1475
1476 // Audio network adaptor will just use 20ms and 60ms frame lengths. 1476 // Audio network adaptor will just use 20ms and 60ms frame lengths.
1477 // The adaptor will only be active for the Opus encoder. 1477 // The adaptor will only be active for the Opus encoder.
1478 if (config_.audio_network_adaptor_config && 1478 if (config_.audio_network_adaptor_config &&
1479 IsCodec(config_.send_codec_spec.codec_inst, kOpusCodecName)) { 1479 IsCodec(config_.send_codec_spec.codec_inst, kOpusCodecName)) {
1480 #if WEBRTC_OPUS_SUPPORT_120MS_PTIME
1481 max_packet_size_ms = 120;
1482 #else
1480 max_packet_size_ms = 60; 1483 max_packet_size_ms = 60;
1484 #endif
1481 min_packet_size_ms = 20; 1485 min_packet_size_ms = 20;
1482 } 1486 }
1483 1487
1484 // OverheadPerPacket = Ipv4(20B) + UDP(8B) + SRTP(10B) + RTP(12) 1488 // OverheadPerPacket = Ipv4(20B) + UDP(8B) + SRTP(10B) + RTP(12)
1485 constexpr int kOverheadPerPacket = 20 + 8 + 10 + 12; 1489 constexpr int kOverheadPerPacket = 20 + 8 + 10 + 12;
1486 1490
1487 int min_overhead_bps = 1491 int min_overhead_bps =
1488 kOverheadPerPacket * 8 * 1000 / max_packet_size_ms; 1492 kOverheadPerPacket * 8 * 1000 / max_packet_size_ms;
1489 1493
1490 int max_overhead_bps = 1494 int max_overhead_bps =
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2709 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 2713 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
2710 const auto it = send_streams_.find(ssrc); 2714 const auto it = send_streams_.find(ssrc);
2711 if (it != send_streams_.end()) { 2715 if (it != send_streams_.end()) {
2712 return it->second->channel(); 2716 return it->second->channel();
2713 } 2717 }
2714 return -1; 2718 return -1;
2715 } 2719 }
2716 } // namespace cricket 2720 } // namespace cricket
2717 2721
2718 #endif // HAVE_WEBRTC_VOICE 2722 #endif // HAVE_WEBRTC_VOICE
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698