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

Side by Side Diff: webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h

Issue 1319683002: AudioDecoder: Replace Init() with Reset() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@buffer
Patch Set: review fixes Created 5 years, 3 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) 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 template <typename T> 179 template <typename T>
180 AudioDecoderIsacT<T>::AudioDecoderIsacT() 180 AudioDecoderIsacT<T>::AudioDecoderIsacT()
181 : AudioDecoderIsacT(nullptr) { 181 : AudioDecoderIsacT(nullptr) {
182 } 182 }
183 183
184 template <typename T> 184 template <typename T>
185 AudioDecoderIsacT<T>::AudioDecoderIsacT(LockedIsacBandwidthInfo* bwinfo) 185 AudioDecoderIsacT<T>::AudioDecoderIsacT(LockedIsacBandwidthInfo* bwinfo)
186 : bwinfo_(bwinfo), decoder_sample_rate_hz_(-1) { 186 : bwinfo_(bwinfo), decoder_sample_rate_hz_(-1) {
187 CHECK_EQ(0, T::Create(&isac_state_)); 187 CHECK_EQ(0, T::Create(&isac_state_));
188 CHECK_EQ(0, T::DecoderInit(isac_state_)); 188 T::DecoderInit(isac_state_);
189 if (bwinfo_) { 189 if (bwinfo_) {
190 IsacBandwidthInfo bwinfo; 190 IsacBandwidthInfo bwinfo;
191 T::GetBandwidthInfo(isac_state_, &bwinfo); 191 T::GetBandwidthInfo(isac_state_, &bwinfo);
192 bwinfo_->Set(bwinfo); 192 bwinfo_->Set(bwinfo);
193 } 193 }
194 } 194 }
195 195
196 template <typename T> 196 template <typename T>
197 AudioDecoderIsacT<T>::~AudioDecoderIsacT() { 197 AudioDecoderIsacT<T>::~AudioDecoderIsacT() {
198 CHECK_EQ(0, T::Free(isac_state_)); 198 CHECK_EQ(0, T::Free(isac_state_));
(...skipping 26 matching lines...) Expand all
225 bool AudioDecoderIsacT<T>::HasDecodePlc() const { 225 bool AudioDecoderIsacT<T>::HasDecodePlc() const {
226 return false; 226 return false;
227 } 227 }
228 228
229 template <typename T> 229 template <typename T>
230 size_t AudioDecoderIsacT<T>::DecodePlc(size_t num_frames, int16_t* decoded) { 230 size_t AudioDecoderIsacT<T>::DecodePlc(size_t num_frames, int16_t* decoded) {
231 return T::DecodePlc(isac_state_, decoded, num_frames); 231 return T::DecodePlc(isac_state_, decoded, num_frames);
232 } 232 }
233 233
234 template <typename T> 234 template <typename T>
235 int AudioDecoderIsacT<T>::Init() { 235 void AudioDecoderIsacT<T>::Reset() {
236 return T::DecoderInit(isac_state_); 236 T::DecoderInit(isac_state_);
237 } 237 }
238 238
239 template <typename T> 239 template <typename T>
240 int AudioDecoderIsacT<T>::IncomingPacket(const uint8_t* payload, 240 int AudioDecoderIsacT<T>::IncomingPacket(const uint8_t* payload,
241 size_t payload_len, 241 size_t payload_len,
242 uint16_t rtp_sequence_number, 242 uint16_t rtp_sequence_number,
243 uint32_t rtp_timestamp, 243 uint32_t rtp_timestamp,
244 uint32_t arrival_timestamp) { 244 uint32_t arrival_timestamp) {
245 int ret = T::UpdateBwEstimate( 245 int ret = T::UpdateBwEstimate(
246 isac_state_, payload, payload_len, 246 isac_state_, payload, payload_len,
(...skipping 12 matching lines...) Expand all
259 } 259 }
260 260
261 template <typename T> 261 template <typename T>
262 size_t AudioDecoderIsacT<T>::Channels() const { 262 size_t AudioDecoderIsacT<T>::Channels() const {
263 return 1; 263 return 1;
264 } 264 }
265 265
266 } // namespace webrtc 266 } // namespace webrtc
267 267
268 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_IMPL_H_ 268 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698