OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_ | 5 #ifndef MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_ |
6 #define MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_ | 6 #define MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_ |
7 | 7 |
8 #include "media/base/audio_converter.h" | 8 #include "media/base/audio_converter.h" |
9 #include "media/base/audio_renderer_sink.h" | 9 #include "media/base/audio_renderer_sink.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 base::TimeDelta buffer_delay) override; | 35 base::TimeDelta buffer_delay) override; |
36 | 36 |
37 // Toggles only filling half the requested amount during Render(). | 37 // Toggles only filling half the requested amount during Render(). |
38 void set_half_fill(bool half_fill) { half_fill_ = half_fill; } | 38 void set_half_fill(bool half_fill) { half_fill_ = half_fill; } |
39 | 39 |
40 // Reset the sine state to initial value. | 40 // Reset the sine state to initial value. |
41 void reset() { x_ = 0; } | 41 void reset() { x_ = 0; } |
42 | 42 |
43 // Returns the last |audio_delay_milliseconds| provided to Render() or -1 if | 43 // Returns the last |audio_delay_milliseconds| provided to Render() or -1 if |
44 // no Render() call occurred. | 44 // no Render() call occurred. |
45 int last_audio_delay_milliseconds() { return last_audio_delay_milliseconds_; } | 45 int last_audio_delay_milliseconds() const { |
| 46 return last_audio_delay_milliseconds_; |
| 47 } |
46 | 48 |
47 // Set volume information used by ProvideAudioTransformInput(). | 49 // Set volume information used by ProvideAudioTransformInput(). |
48 void set_volume(double volume) { volume_ = volume; } | 50 void set_volume(double volume) { volume_ = volume; } |
49 | 51 |
| 52 int last_channel_count() const { return last_channel_count_; } |
| 53 |
50 private: | 54 private: |
51 bool half_fill_; | 55 bool half_fill_; |
52 double x_; | 56 double x_; |
53 double step_; | 57 double step_; |
54 int last_audio_delay_milliseconds_; | 58 int last_audio_delay_milliseconds_; |
| 59 int last_channel_count_; |
55 double volume_; | 60 double volume_; |
56 | 61 |
57 DISALLOW_COPY_AND_ASSIGN(FakeAudioRenderCallback); | 62 DISALLOW_COPY_AND_ASSIGN(FakeAudioRenderCallback); |
58 }; | 63 }; |
59 | 64 |
60 } // namespace media | 65 } // namespace media |
61 | 66 |
62 #endif // MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_ | 67 #endif // MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_ |
OLD | NEW |