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

Side by Side Diff: webrtc/modules/audio_coding/acm2/acm_receiver.cc

Issue 2355503002: Stopped using the NetEqDecoder enum internally in NetEq. (Closed)
Patch Set: Clarified comments. Created 4 years, 2 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 | webrtc/modules/audio_coding/acm2/rent_a_codec.cc » ('j') | 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 const rtc::Optional<NetEqDecoder> ned = 195 const rtc::Optional<NetEqDecoder> ned =
196 RentACodec::NetEqDecoderFromCodecId(*cid, channels); 196 RentACodec::NetEqDecoderFromCodecId(*cid, channels);
197 RTC_DCHECK(ned) << "Invalid codec ID: " << static_cast<int>(*cid); 197 RTC_DCHECK(ned) << "Invalid codec ID: " << static_cast<int>(*cid);
198 return *ned; 198 return *ned;
199 }(); 199 }();
200 const rtc::Optional<SdpAudioFormat> new_format = 200 const rtc::Optional<SdpAudioFormat> new_format =
201 RentACodec::NetEqDecoderToSdpAudioFormat(neteq_decoder); 201 RentACodec::NetEqDecoderToSdpAudioFormat(neteq_decoder);
202 202
203 rtc::CritScope lock(&crit_sect_); 203 rtc::CritScope lock(&crit_sect_);
204 204
205 const SdpAudioFormat* const old_format = 205 const auto old_format = neteq_->GetDecoderFormat(payload_type);
206 neteq_->GetDecoderFormat(payload_type);
207 if (old_format && new_format && *old_format == *new_format) { 206 if (old_format && new_format && *old_format == *new_format) {
208 // Re-registering the same codec. Do nothing and return. 207 // Re-registering the same codec. Do nothing and return.
209 return 0; 208 return 0;
210 } 209 }
211 210
212 if (neteq_->RemovePayloadType(payload_type) != NetEq::kOK && 211 if (neteq_->RemovePayloadType(payload_type) != NetEq::kOK &&
213 neteq_->LastError() != NetEq::kDecoderNotFound) { 212 neteq_->LastError() != NetEq::kDecoderNotFound) {
214 LOG(LERROR) << "Cannot remove payload " << static_cast<int>(payload_type); 213 LOG(LERROR) << "Cannot remove payload " << static_cast<int>(payload_type);
215 return -1; 214 return -1;
216 } 215 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 354
356 void AcmReceiver::GetDecodingCallStatistics( 355 void AcmReceiver::GetDecodingCallStatistics(
357 AudioDecodingCallStats* stats) const { 356 AudioDecodingCallStats* stats) const {
358 rtc::CritScope lock(&crit_sect_); 357 rtc::CritScope lock(&crit_sect_);
359 *stats = call_stats_.GetDecodingStatistics(); 358 *stats = call_stats_.GetDecodingStatistics();
360 } 359 }
361 360
362 } // namespace acm2 361 } // namespace acm2
363 362
364 } // namespace webrtc 363 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/acm2/rent_a_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698