| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 int SampleRateHz() const override { return sample_rate_hz_; } | 43 int SampleRateHz() const override { return sample_rate_hz_; } |
| 44 | 44 |
| 45 size_t Channels() const override { return stereo_ ? 2 : 1; } | 45 size_t Channels() const override { return stereo_ ? 2 : 1; } |
| 46 | 46 |
| 47 int DecodeInternal(const uint8_t* encoded, | 47 int DecodeInternal(const uint8_t* encoded, |
| 48 size_t encoded_len, | 48 size_t encoded_len, |
| 49 int sample_rate_hz, | 49 int sample_rate_hz, |
| 50 int16_t* decoded, | 50 int16_t* decoded, |
| 51 SpeechType* speech_type) override; | 51 SpeechType* speech_type) override; |
| 52 | 52 |
| 53 // Helper method. Writes |timestamp| and |samples| to |encoded| in a format | 53 // Helper method. Writes |timestamp|, |samples| and |
| 54 // that the FakeDecpdeFromFile decoder will understand. |encoded| must be at | 54 // |original_payload_size_bytes| to |encoded| in a format that the |
| 55 // least 8 bytes long. | 55 // FakeDecodeFromFile decoder will understand. |encoded| must be at least 12 |
| 56 // bytes long. |
| 56 static void PrepareEncoded(uint32_t timestamp, | 57 static void PrepareEncoded(uint32_t timestamp, |
| 57 size_t samples, | 58 size_t samples, |
| 59 size_t original_payload_size_bytes, |
| 58 rtc::ArrayView<uint8_t> encoded); | 60 rtc::ArrayView<uint8_t> encoded); |
| 59 | 61 |
| 60 private: | 62 private: |
| 61 std::unique_ptr<InputAudioFile> input_; | 63 std::unique_ptr<InputAudioFile> input_; |
| 62 rtc::Optional<uint32_t> next_timestamp_from_input_; | 64 rtc::Optional<uint32_t> next_timestamp_from_input_; |
| 63 const int sample_rate_hz_; | 65 const int sample_rate_hz_; |
| 64 const bool stereo_; | 66 const bool stereo_; |
| 67 size_t last_decoded_length_ = 0; |
| 68 bool cng_mode_ = false; |
| 65 }; | 69 }; |
| 66 | 70 |
| 67 } // namespace test | 71 } // namespace test |
| 68 } // namespace webrtc | 72 } // namespace webrtc |
| 69 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_FAKE_DECODE_FROM_FILE_H_ | 73 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_FAKE_DECODE_FROM_FILE_H_ |
| OLD | NEW |