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

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.cc

Issue 1316523002: Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix compile Created 4 years, 11 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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
11 #include "webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.h" 11 #include "webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.h"
12 12
13 #include "webrtc/base/checks.h" 13 #include "webrtc/base/checks.h"
14 14
15 namespace webrtc { 15 namespace webrtc {
16 16
17 AudioDecoderOpus::AudioDecoderOpus(size_t num_channels) 17 AudioDecoderOpus::AudioDecoderOpus(size_t num_channels)
18 : channels_(num_channels) { 18 : channels_(num_channels) {
19 RTC_DCHECK(num_channels == 1 || num_channels == 2); 19 RTC_DCHECK(num_channels == 1 || num_channels == 2);
20 WebRtcOpus_DecoderCreate(&dec_state_, static_cast<int>(channels_)); 20 WebRtcOpus_DecoderCreate(&dec_state_, channels_);
21 WebRtcOpus_DecoderInit(dec_state_); 21 WebRtcOpus_DecoderInit(dec_state_);
22 } 22 }
23 23
24 AudioDecoderOpus::~AudioDecoderOpus() { 24 AudioDecoderOpus::~AudioDecoderOpus() {
25 WebRtcOpus_DecoderFree(dec_state_); 25 WebRtcOpus_DecoderFree(dec_state_);
26 } 26 }
27 27
28 int AudioDecoderOpus::DecodeInternal(const uint8_t* encoded, 28 int AudioDecoderOpus::DecodeInternal(const uint8_t* encoded,
29 size_t encoded_len, 29 size_t encoded_len,
30 int sample_rate_hz, 30 int sample_rate_hz,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 int fec; 85 int fec;
86 fec = WebRtcOpus_PacketHasFec(encoded, encoded_len); 86 fec = WebRtcOpus_PacketHasFec(encoded, encoded_len);
87 return (fec == 1); 87 return (fec == 1);
88 } 88 }
89 89
90 size_t AudioDecoderOpus::Channels() const { 90 size_t AudioDecoderOpus::Channels() const {
91 return channels_; 91 return channels_;
92 } 92 }
93 93
94 } // namespace webrtc 94 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698