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

Side by Side Diff: webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc

Issue 2024633002: AudioDecoder: New method SampleRateHz, + implementations for our codecs (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 return decoder_->Decode(encoded, encoded_len, sample_rate_hz, 1004 return decoder_->Decode(encoded, encoded_len, sample_rate_hz,
1005 decoder_->PacketDuration(encoded, encoded_len) * 1005 decoder_->PacketDuration(encoded, encoded_len) *
1006 decoder_->Channels() * sizeof(int16_t), 1006 decoder_->Channels() * sizeof(int16_t),
1007 decoded, speech_type); 1007 decoded, speech_type);
1008 } 1008 }
1009 1009
1010 private: 1010 private:
1011 AudioDecoder* const decoder_; 1011 AudioDecoder* const decoder_;
1012 }; 1012 };
1013 1013
1014 AudioDecoderPcmU decoder(1); 1014 AudioDecoderPcmU decoder(8000, 1);
1015 DecodeForwarder decode_forwarder(&decoder); 1015 DecodeForwarder decode_forwarder(&decoder);
1016 MockAudioDecoder mock_decoder; 1016 MockAudioDecoder mock_decoder;
1017 // Set expectations on the mock decoder and also delegate the calls to the 1017 // Set expectations on the mock decoder and also delegate the calls to the
1018 // real decoder. 1018 // real decoder.
1019 EXPECT_CALL(mock_decoder, IncomingPacket(_, _, _, _, _)) 1019 EXPECT_CALL(mock_decoder, IncomingPacket(_, _, _, _, _))
1020 .Times(AtLeast(1)) 1020 .Times(AtLeast(1))
1021 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::IncomingPacket)); 1021 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::IncomingPacket));
1022 EXPECT_CALL(mock_decoder, Channels()) 1022 EXPECT_CALL(mock_decoder, Channels())
1023 .Times(AtLeast(1)) 1023 .Times(AtLeast(1))
1024 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::Channels)); 1024 .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::Channels));
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 Run(16000, 8000, 1000); 1794 Run(16000, 8000, 1000);
1795 } 1795 }
1796 1796
1797 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1797 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1798 Run(8000, 16000, 1000); 1798 Run(8000, 16000, 1000);
1799 } 1799 }
1800 1800
1801 #endif 1801 #endif
1802 1802
1803 } // namespace webrtc 1803 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/codecs/audio_decoder.h » ('j') | webrtc/modules/audio_coding/codecs/audio_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698