| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_CAST_TEST_UTILITY_AUDIO_UTILITY_H_ | 5 #ifndef MEDIA_CAST_TEST_UTILITY_AUDIO_UTILITY_H_ |
| 6 #define MEDIA_CAST_TEST_UTILITY_AUDIO_UTILITY_H_ | 6 #define MEDIA_CAST_TEST_UTILITY_AUDIO_UTILITY_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class TestAudioBusFactory { | 27 class TestAudioBusFactory { |
| 28 public: | 28 public: |
| 29 TestAudioBusFactory(int num_channels, | 29 TestAudioBusFactory(int num_channels, |
| 30 int sample_rate, | 30 int sample_rate, |
| 31 float sine_wave_frequency, | 31 float sine_wave_frequency, |
| 32 float volume); | 32 float volume); |
| 33 ~TestAudioBusFactory(); | 33 ~TestAudioBusFactory(); |
| 34 | 34 |
| 35 // Creates a new AudioBus of the given |duration|, filled with the next batch | 35 // Creates a new AudioBus of the given |duration|, filled with the next batch |
| 36 // of sine wave samples. | 36 // of sine wave samples. |
| 37 scoped_ptr<AudioBus> NextAudioBus(const base::TimeDelta& duration); | 37 std::unique_ptr<AudioBus> NextAudioBus(const base::TimeDelta& duration); |
| 38 | 38 |
| 39 // A reasonable test tone. | 39 // A reasonable test tone. |
| 40 static const int kMiddleANoteFreq = 440; | 40 static const int kMiddleANoteFreq = 440; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 const int num_channels_; | 43 const int num_channels_; |
| 44 const int sample_rate_; | 44 const int sample_rate_; |
| 45 const float volume_; | 45 const float volume_; |
| 46 SineWaveAudioSource source_; | 46 SineWaveAudioSource source_; |
| 47 | 47 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 77 float* samples); | 77 float* samples); |
| 78 | 78 |
| 79 // Decode a timestamp encoded with EncodeTimestamp. Returns true if a | 79 // Decode a timestamp encoded with EncodeTimestamp. Returns true if a |
| 80 // timestamp was found in |samples|. | 80 // timestamp was found in |samples|. |
| 81 bool DecodeTimestamp(const float* samples, size_t length, uint16_t* timestamp); | 81 bool DecodeTimestamp(const float* samples, size_t length, uint16_t* timestamp); |
| 82 | 82 |
| 83 } // namespace cast | 83 } // namespace cast |
| 84 } // namespace media | 84 } // namespace media |
| 85 | 85 |
| 86 #endif // MEDIA_CAST_TEST_UTILITY_AUDIO_UTILITY_H_ | 86 #endif // MEDIA_CAST_TEST_UTILITY_AUDIO_UTILITY_H_ |
| OLD | NEW |