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

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

Issue 2651883010: Adding C++ versions of currently spec'd "RtpParameters" structs. (Closed)
Patch Set: Update unit tests (due to switch from special-case values to rtc::Optional) 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 {kPcmaCodecName, 8000, 1, 8, false, {10, 20, 30, 40, 50, 60}}, 513 {kPcmaCodecName, 8000, 1, 8, false, {10, 20, 30, 40, 50, 60}},
514 {kCnCodecName, 32000, 1, 106, false, {}}, 514 {kCnCodecName, 32000, 1, 106, false, {}},
515 {kCnCodecName, 16000, 1, 105, false, {}}, 515 {kCnCodecName, 16000, 1, 105, false, {}},
516 {kCnCodecName, 8000, 1, 13, false, {}}, 516 {kCnCodecName, 8000, 1, 13, false, {}},
517 {kDtmfCodecName, 48000, 1, 110, false, {}}, 517 {kDtmfCodecName, 48000, 1, 110, false, {}},
518 {kDtmfCodecName, 32000, 1, 112, false, {}}, 518 {kDtmfCodecName, 32000, 1, 112, false, {}},
519 {kDtmfCodecName, 16000, 1, 113, false, {}}, 519 {kDtmfCodecName, 16000, 1, 113, false, {}},
520 {kDtmfCodecName, 8000, 1, 126, false, {}} 520 {kDtmfCodecName, 8000, 1, 126, false, {}}
521 }; 521 };
522 522
523 // |max_send_bitrate_bps| is the bitrate from "b=" in SDP.
524 // |rtp_max_bitrate_bps| is the bitrate from RtpSender::SetParameters.
523 rtc::Optional<int> ComputeSendBitrate(int max_send_bitrate_bps, 525 rtc::Optional<int> ComputeSendBitrate(int max_send_bitrate_bps,
524 int rtp_max_bitrate_bps, 526 rtc::Optional<int> rtp_max_bitrate_bps,
525 const webrtc::CodecInst& codec_inst) { 527 const webrtc::CodecInst& codec_inst) {
526 const int bps = MinPositive(max_send_bitrate_bps, rtp_max_bitrate_bps); 528 // If application-configured bitrate is set, take minimum of that and SDP
529 // bitrate.
530 const int bps = rtp_max_bitrate_bps
531 ? MinPositive(max_send_bitrate_bps, *rtp_max_bitrate_bps)
532 : max_send_bitrate_bps;
527 const int codec_rate = codec_inst.rate; 533 const int codec_rate = codec_inst.rate;
528 534
529 if (bps <= 0) { 535 if (bps <= 0) {
530 return rtc::Optional<int>(codec_rate); 536 return rtc::Optional<int>(codec_rate);
531 } 537 }
532 538
533 if (codec_inst.pltype == -1) { 539 if (codec_inst.pltype == -1) {
534 return rtc::Optional<int>(codec_rate); 540 return rtc::Optional<int>(codec_rate);
535 ; 541 ;
536 } 542 }
(...skipping 2177 matching lines...) Expand 10 before | Expand all | Expand 10 after
2714 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 2720 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
2715 const auto it = send_streams_.find(ssrc); 2721 const auto it = send_streams_.find(ssrc);
2716 if (it != send_streams_.end()) { 2722 if (it != send_streams_.end()) {
2717 return it->second->channel(); 2723 return it->second->channel();
2718 } 2724 }
2719 return -1; 2725 return -1;
2720 } 2726 }
2721 } // namespace cricket 2727 } // namespace cricket
2722 2728
2723 #endif // HAVE_WEBRTC_VOICE 2729 #endif // HAVE_WEBRTC_VOICE
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2_unittest.cc ('k') | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698