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_AUDIO_RENDERER_SINK_H_ | 5 #ifndef MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 virtual void OnRenderError() = 0; | 36 virtual void OnRenderError() = 0; |
37 | 37 |
38 protected: | 38 protected: |
39 virtual ~RenderCallback() {} | 39 virtual ~RenderCallback() {} |
40 }; | 40 }; |
41 | 41 |
42 virtual ~AudioRendererSink() {} | 42 virtual ~AudioRendererSink() {} |
43 | 43 |
44 // Sets important information about the audio stream format. | 44 // Sets important information about the audio stream format. |
45 // It must be called before any of the other methods. | 45 // It must be called before any of the other methods. |
46 virtual void Initialize(size_t buffer_size, | 46 virtual void Initialize(const AudioParameters& params, |
47 int channels, | |
48 double sample_rate, | |
49 AudioParameters::Format latency_format, | |
50 RenderCallback* callback) = 0; | 47 RenderCallback* callback) = 0; |
51 | 48 |
52 // Starts audio playback. | 49 // Starts audio playback. |
53 virtual void Start() = 0; | 50 virtual void Start() = 0; |
54 | 51 |
55 // Stops audio playback. | 52 // Stops audio playback. |
56 virtual void Stop() = 0; | 53 virtual void Stop() = 0; |
57 | 54 |
58 // Pauses playback. | 55 // Pauses playback. |
59 virtual void Pause(bool flush) = 0; | 56 virtual void Pause(bool flush) = 0; |
60 | 57 |
61 // Resumes playback after calling Pause(). | 58 // Resumes playback after calling Pause(). |
62 virtual void Play() = 0; | 59 virtual void Play() = 0; |
63 | 60 |
64 // Sets the playback volume, with range [0.0, 1.0] inclusive. | 61 // Sets the playback volume, with range [0.0, 1.0] inclusive. |
65 // Returns |true| on success. | 62 // Returns |true| on success. |
66 virtual bool SetVolume(double volume) = 0; | 63 virtual bool SetVolume(double volume) = 0; |
67 | 64 |
68 // Gets the playback volume, with range [0.0, 1.0] inclusive. | 65 // Gets the playback volume, with range [0.0, 1.0] inclusive. |
69 virtual void GetVolume(double* volume) = 0; | 66 virtual void GetVolume(double* volume) = 0; |
70 }; | 67 }; |
71 | 68 |
72 } // namespace media | 69 } // namespace media |
73 | 70 |
74 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 71 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
OLD | NEW |