AcmReceiver: Look up last decoder in NetEq's table of decoders

AcmReceiver::decoders_ is now one step closer to being unused.

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2339953002
Cr-Commit-Position: refs/heads/master@{#14274}
This commit is contained in:
kwiberg
2016-09-17 08:40:13 -07:00
committed by Commit bot
parent 1a7ef1f025
commit 1e4d8b574c
6 changed files with 65 additions and 66 deletions

View File

@ -39,15 +39,6 @@ namespace acm2 {
class AcmReceiver {
public:
struct Decoder {
int acm_codec_id;
uint8_t payload_type;
// This field is meaningful for codecs where both mono and
// stereo versions are registered under the same ID.
size_t channels;
int sample_rate_hz;
};
// Constructor of the class
explicit AcmReceiver(const AudioCodingModule::Config& config);
@ -262,14 +253,23 @@ class AcmReceiver {
void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const;
private:
const Decoder* RtpHeaderToDecoder(const RTPHeader& rtp_header,
uint8_t payload_type) const
struct Decoder {
int acm_codec_id;
uint8_t payload_type;
// This field is meaningful for codecs where both mono and
// stereo versions are registered under the same ID.
size_t channels;
int sample_rate_hz;
};
const rtc::Optional<CodecInst> RtpHeaderToDecoder(const RTPHeader& rtp_header,
uint8_t payload_type) const
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
uint32_t NowInTimestamp(int decoder_sampling_rate) const;
rtc::CriticalSection crit_sect_;
const Decoder* last_audio_decoder_ GUARDED_BY(crit_sect_);
rtc::Optional<CodecInst> last_audio_decoder_ GUARDED_BY(crit_sect_);
ACMResampler resampler_ GUARDED_BY(crit_sect_);
std::unique_ptr<int16_t[]> last_audio_buffer_ GUARDED_BY(crit_sect_);
CallStatistics call_stats_ GUARDED_BY(crit_sect_);