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

Unified Diff: webrtc/modules/audio_coding/neteq/neteq_impl.cc

Issue 2355503002: Stopped using the NetEqDecoder enum internally in NetEq. (Closed)
Patch Set: Clarified comments. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/neteq_impl.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index 6b2fa4c9ecdfb880e52c69e37424310176661952..e21294aa384c6815b83eeff796959a81b0bfc9b1 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -457,16 +457,15 @@ rtc::Optional<CodecInst> NetEqImpl::GetDecoder(int payload_type) const {
return rtc::Optional<CodecInst>(ci);
}
-const SdpAudioFormat* NetEqImpl::GetDecoderFormat(int payload_type) const {
+rtc::Optional<SdpAudioFormat> NetEqImpl::GetDecoderFormat(
+ int payload_type) const {
rtc::CritScope lock(&crit_sect_);
const DecoderDatabase::DecoderInfo* const di =
decoder_database_->GetDecoderInfo(payload_type);
if (!di) {
- return nullptr; // Payload type not registered.
+ return rtc::Optional<SdpAudioFormat>(); // Payload type not registered.
}
- // This will return null if the payload type was registered without an
- // SdpAudioFormat.
- return di->GetFormat();
+ return rtc::Optional<SdpAudioFormat>(di->GetFormat());
}
int NetEqImpl::SetTargetNumberOfChannels() {
@@ -781,7 +780,8 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
const DecoderDatabase::DecoderInfo* dec_info =
decoder_database_->GetDecoderInfo(main_header.payloadType);
assert(dec_info); // Already checked that the payload type is known.
- delay_manager_->LastDecoderType(dec_info->codec_type);
+ delay_manager_->LastDecodedWasCngOrDtmf(dec_info->IsComfortNoise() ||
+ dec_info->IsDtmf());
if (delay_manager_->last_pack_cng_or_dtmf() == 0) {
// Calculate the total speech length carried in each packet.
const size_t buffer_length_after_insert =
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl.h ('k') | webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698