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

Side by Side Diff: webrtc/modules/audio_coding/codecs/pcm16b/audio_encoder_pcm16b.cc

Issue 2904883002: AudioEncoderPcm16B: Number of bits/sample is 16, not 2 (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 AudioEncoderPcm16B::AudioEncoderPcm16B(int payload_type, 77 AudioEncoderPcm16B::AudioEncoderPcm16B(int payload_type,
78 const SdpAudioFormat& format) 78 const SdpAudioFormat& format)
79 : AudioEncoderPcm16B(CreateConfig(payload_type, format)) {} 79 : AudioEncoderPcm16B(CreateConfig(payload_type, format)) {}
80 80
81 rtc::Optional<AudioCodecInfo> AudioEncoderPcm16B::QueryAudioEncoder( 81 rtc::Optional<AudioCodecInfo> AudioEncoderPcm16B::QueryAudioEncoder(
82 const SdpAudioFormat& format) { 82 const SdpAudioFormat& format) {
83 if (STR_CASE_CMP(format.name.c_str(), GetPayloadName()) == 0 && 83 if (STR_CASE_CMP(format.name.c_str(), GetPayloadName()) == 0 &&
84 format.num_channels >= 1) { 84 format.num_channels >= 1) {
85 Config config = CreateConfig(0, format); 85 Config config = CreateConfig(0, format);
86 if (config.IsOk()) { 86 if (config.IsOk()) {
87 constexpr int bits_per_sample = 16;
87 return rtc::Optional<AudioCodecInfo>( 88 return rtc::Optional<AudioCodecInfo>(
88 {config.sample_rate_hz, config.num_channels, 89 {config.sample_rate_hz, config.num_channels,
89 config.sample_rate_hz * 2 * 90 config.sample_rate_hz * bits_per_sample *
90 rtc::dchecked_cast<int>(config.num_channels)}); 91 rtc::dchecked_cast<int>(config.num_channels)});
91 } 92 }
92 } 93 }
93 return rtc::Optional<AudioCodecInfo>(); 94 return rtc::Optional<AudioCodecInfo>();
94 } 95 }
95 96
96 } // namespace webrtc 97 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698