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

Unified Diff: webrtc/modules/audio_coding/acm2/acm_receiver.cc

Issue 2355483003: Voe::Channel: Turned GetPlayoutFrequency into GetRtpTimestampRateHz. (Closed)
Patch Set: Handle zero clockrate, make better comments, fix bad spel 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/acm2/acm_receiver.cc
diff --git a/webrtc/modules/audio_coding/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
index 89eee00fc37edc10d715f1720ff193688d863b8d..2589bb8d25c2c1d0c247d3b8ee930d22a4a3114a 100644
--- a/webrtc/modules/audio_coding/acm2/acm_receiver.cc
+++ b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
@@ -98,6 +98,8 @@ int AcmReceiver::InsertPacket(const WebRtcRTPHeader& rtp_header,
}
} else {
last_audio_decoder_ = ci;
+ last_audio_format_ = neteq_->GetDecoderFormat(ci->pltype);
+ RTC_DCHECK(last_audio_format_);
last_packet_sample_rate_hz_ = rtc::Optional<int>(ci->plfreq);
}
@@ -238,6 +240,7 @@ void AcmReceiver::RemoveAllCodecs() {
rtc::CritScope lock(&crit_sect_);
neteq_->RemoveAllPayloadTypes();
last_audio_decoder_ = rtc::Optional<CodecInst>();
+ last_audio_format_ = rtc::Optional<SdpAudioFormat>();
last_packet_sample_rate_hz_ = rtc::Optional<int>();
}
@@ -250,6 +253,7 @@ int AcmReceiver::RemoveCodec(uint8_t payload_type) {
}
if (last_audio_decoder_ && payload_type == last_audio_decoder_->pltype) {
last_audio_decoder_ = rtc::Optional<CodecInst>();
+ last_audio_format_ = rtc::Optional<SdpAudioFormat>();
last_packet_sample_rate_hz_ = rtc::Optional<int>();
}
return 0;
@@ -272,6 +276,11 @@ int AcmReceiver::LastAudioCodec(CodecInst* codec) const {
return 0;
}
+rtc::Optional<SdpAudioFormat> AcmReceiver::LastAudioFormat() const {
+ rtc::CritScope lock(&crit_sect_);
+ return last_audio_format_;
+}
+
void AcmReceiver::GetNetworkStatistics(NetworkStatistics* acm_stat) {
NetEqNetworkStatistics neteq_stat;
// NetEq function always returns zero, so we don't check the return value.
« no previous file with comments | « webrtc/modules/audio_coding/acm2/acm_receiver.h ('k') | webrtc/modules/audio_coding/acm2/audio_coding_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698