Add encode/decode time tracing to audio_coding.

Also removes virtual from VideoDecoder::Decode and updated mocks and
tests accordingly to use VideoDecoder::DecodeInternal instead.

BUG=webrtc:5167
R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1512483003 .

Cr-Commit-Position: refs/heads/master@{#10935}
This commit is contained in:
Peter Boström
2015-12-08 13:41:35 +01:00
parent 9f45a45a62
commit d7b7ae8bda
8 changed files with 99 additions and 79 deletions

View File

@ -22,9 +22,8 @@ class MockAudioDecoder : public AudioDecoder {
MockAudioDecoder() {}
virtual ~MockAudioDecoder() { Die(); }
MOCK_METHOD0(Die, void());
MOCK_METHOD6(
Decode,
int(const uint8_t*, size_t, int, size_t, int16_t*, SpeechType*));
MOCK_METHOD5(DecodeInternal,
int(const uint8_t*, size_t, int, int16_t*, SpeechType*));
MOCK_CONST_METHOD0(HasDecodePlc, bool());
MOCK_METHOD2(DecodePlc, size_t(size_t, int16_t*));
MOCK_METHOD0(Reset, void());

View File

@ -30,7 +30,6 @@ class ExternalPcm16B : public AudioDecoder {
ExternalPcm16B() {}
void Reset() override {}
protected:
int DecodeInternal(const uint8_t* encoded,
size_t encoded_len,
int sample_rate_hz,
@ -52,8 +51,8 @@ class MockExternalPcm16B : public ExternalPcm16B {
public:
MockExternalPcm16B() {
// By default, all calls are delegated to the real object.
ON_CALL(*this, Decode(_, _, _, _, _, _))
.WillByDefault(Invoke(&real_, &ExternalPcm16B::Decode));
ON_CALL(*this, DecodeInternal(_, _, _, _, _))
.WillByDefault(Invoke(&real_, &ExternalPcm16B::DecodeInternal));
ON_CALL(*this, HasDecodePlc())
.WillByDefault(Invoke(&real_, &ExternalPcm16B::HasDecodePlc));
ON_CALL(*this, DecodePlc(_, _))
@ -68,11 +67,10 @@ class MockExternalPcm16B : public ExternalPcm16B {
virtual ~MockExternalPcm16B() { Die(); }
MOCK_METHOD0(Die, void());
MOCK_METHOD6(Decode,
MOCK_METHOD5(DecodeInternal,
int(const uint8_t* encoded,
size_t encoded_len,
int sample_rate_hz,
size_t max_decoded_bytes,
int16_t* decoded,
SpeechType* speech_type));
MOCK_CONST_METHOD0(HasDecodePlc,