| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 virtual void InitEncoder() { } | 134 virtual void InitEncoder() { } |
| 135 | 135 |
| 136 // TODO(henrik.lundin) Change return type to size_t once most/all overriding | 136 // TODO(henrik.lundin) Change return type to size_t once most/all overriding |
| 137 // implementations are gone. | 137 // implementations are gone. |
| 138 virtual int EncodeFrame(const int16_t* input, | 138 virtual int EncodeFrame(const int16_t* input, |
| 139 size_t input_len_samples, | 139 size_t input_len_samples, |
| 140 uint8_t* output) { | 140 uint8_t* output) { |
| 141 encoded_info_.encoded_bytes = 0; | 141 encoded_info_.encoded_bytes = 0; |
| 142 const size_t samples_per_10ms = audio_encoder_->SampleRateHz() / 100; | 142 const size_t samples_per_10ms = audio_encoder_->SampleRateHz() / 100; |
| 143 CHECK_EQ(samples_per_10ms * audio_encoder_->Num10MsFramesInNextPacket(), | 143 RTC_CHECK_EQ(samples_per_10ms * audio_encoder_->Num10MsFramesInNextPacket(), |
| 144 input_len_samples); | 144 input_len_samples); |
| 145 rtc::scoped_ptr<int16_t[]> interleaved_input( | 145 rtc::scoped_ptr<int16_t[]> interleaved_input( |
| 146 new int16_t[channels_ * samples_per_10ms]); | 146 new int16_t[channels_ * samples_per_10ms]); |
| 147 for (size_t i = 0; i < audio_encoder_->Num10MsFramesInNextPacket(); ++i) { | 147 for (size_t i = 0; i < audio_encoder_->Num10MsFramesInNextPacket(); ++i) { |
| 148 EXPECT_EQ(0u, encoded_info_.encoded_bytes); | 148 EXPECT_EQ(0u, encoded_info_.encoded_bytes); |
| 149 | 149 |
| 150 // Duplicate the mono input signal to however many channels the test | 150 // Duplicate the mono input signal to however many channels the test |
| 151 // wants. | 151 // wants. |
| 152 test::InputAudioFile::DuplicateInterleaved(input + i * samples_per_10ms, | 152 test::InputAudioFile::DuplicateInterleaved(input + i * samples_per_10ms, |
| 153 samples_per_10ms, channels_, | 153 samples_per_10ms, channels_, |
| 154 interleaved_input.get()); | 154 interleaved_input.get()); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 EXPECT_TRUE(CodecSupported(kDecoderCNGnb)); | 722 EXPECT_TRUE(CodecSupported(kDecoderCNGnb)); |
| 723 EXPECT_TRUE(CodecSupported(kDecoderCNGwb)); | 723 EXPECT_TRUE(CodecSupported(kDecoderCNGwb)); |
| 724 EXPECT_TRUE(CodecSupported(kDecoderCNGswb32kHz)); | 724 EXPECT_TRUE(CodecSupported(kDecoderCNGswb32kHz)); |
| 725 EXPECT_TRUE(CodecSupported(kDecoderCNGswb48kHz)); | 725 EXPECT_TRUE(CodecSupported(kDecoderCNGswb48kHz)); |
| 726 EXPECT_TRUE(CodecSupported(kDecoderArbitrary)); | 726 EXPECT_TRUE(CodecSupported(kDecoderArbitrary)); |
| 727 EXPECT_TRUE(CodecSupported(kDecoderOpus)); | 727 EXPECT_TRUE(CodecSupported(kDecoderOpus)); |
| 728 EXPECT_TRUE(CodecSupported(kDecoderOpus_2ch)); | 728 EXPECT_TRUE(CodecSupported(kDecoderOpus_2ch)); |
| 729 } | 729 } |
| 730 | 730 |
| 731 } // namespace webrtc | 731 } // namespace webrtc |
| OLD | NEW |