Reland r8476 "Set decoder output frequency in AudioDecoder::Decode call"
This should be safe to land now that issue 4143 was resolved (in r8492). This change effectively reverts 8488. TBR=kwiberg@webrtc.org Original commit message: This CL changes the way the decoder sample rate is set and updated. In practice, it only concerns the iSAC (float) codec. One single iSAC decoder instance is used for both wideband and super-wideband decoding, and the instance must be told to switch output frequency if the payload type changes. This used to be done through a call to UpdateDecoderSampleRate, but is now instead done in the Decode call as an extra parameter. Review URL: https://webrtc-codereview.appspot.com/39289004 Cr-Commit-Position: refs/heads/master@{#8496} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8496 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -22,8 +22,9 @@ class MockAudioDecoder : public AudioDecoder {
|
||||
MockAudioDecoder() {}
|
||||
virtual ~MockAudioDecoder() { Die(); }
|
||||
MOCK_METHOD0(Die, void());
|
||||
MOCK_METHOD4(Decode, int(const uint8_t*, size_t, int16_t*,
|
||||
AudioDecoder::SpeechType*));
|
||||
MOCK_METHOD5(
|
||||
Decode,
|
||||
int(const uint8_t*, size_t, int, int16_t*, AudioDecoder::SpeechType*));
|
||||
MOCK_CONST_METHOD0(HasDecodePlc, bool());
|
||||
MOCK_METHOD2(DecodePlc, int(int, int16_t*));
|
||||
MOCK_METHOD0(Init, int());
|
||||
|
||||
@ -29,8 +29,11 @@ class ExternalPcm16B : public AudioDecoder {
|
||||
public:
|
||||
ExternalPcm16B() {}
|
||||
|
||||
virtual int Decode(const uint8_t* encoded, size_t encoded_len,
|
||||
int16_t* decoded, SpeechType* speech_type) {
|
||||
virtual int Decode(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
int16_t ret = WebRtcPcm16b_Decode(
|
||||
encoded, static_cast<int16_t>(encoded_len), decoded);
|
||||
*speech_type = ConvertSpeechType(1);
|
||||
@ -49,7 +52,7 @@ class MockExternalPcm16B : public ExternalPcm16B {
|
||||
public:
|
||||
MockExternalPcm16B() {
|
||||
// By default, all calls are delegated to the real object.
|
||||
ON_CALL(*this, Decode(_, _, _, _))
|
||||
ON_CALL(*this, Decode(_, _, _, _, _))
|
||||
.WillByDefault(Invoke(&real_, &ExternalPcm16B::Decode));
|
||||
ON_CALL(*this, HasDecodePlc())
|
||||
.WillByDefault(Invoke(&real_, &ExternalPcm16B::HasDecodePlc));
|
||||
@ -65,9 +68,12 @@ class MockExternalPcm16B : public ExternalPcm16B {
|
||||
virtual ~MockExternalPcm16B() { Die(); }
|
||||
|
||||
MOCK_METHOD0(Die, void());
|
||||
MOCK_METHOD4(Decode,
|
||||
int(const uint8_t* encoded, size_t encoded_len, int16_t* decoded,
|
||||
SpeechType* speech_type));
|
||||
MOCK_METHOD5(Decode,
|
||||
int(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type));
|
||||
MOCK_CONST_METHOD0(HasDecodePlc,
|
||||
bool());
|
||||
MOCK_METHOD2(DecodePlc,
|
||||
|
||||
Reference in New Issue
Block a user