| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 // Sets important information about the audio stream format. | 48 // Sets important information about the audio stream format. |
| 49 // It must be called before any of the other methods. | 49 // It must be called before any of the other methods. |
| 50 virtual void Initialize(const AudioParameters& params, | 50 virtual void Initialize(const AudioParameters& params, |
| 51 RenderCallback* callback) = 0; | 51 RenderCallback* callback) = 0; |
| 52 | 52 |
| 53 // Starts audio playback. | 53 // Starts audio playback. |
| 54 virtual void Start() = 0; | 54 virtual void Start() = 0; |
| 55 | 55 |
| 56 // Stops audio playback. | 56 // Stops audio playback and performs cleanup. It must be called before |
| 57 // destruction. |
| 57 virtual void Stop() = 0; | 58 virtual void Stop() = 0; |
| 58 | 59 |
| 59 // Pauses playback. | 60 // Pauses playback. |
| 60 virtual void Pause() = 0; | 61 virtual void Pause() = 0; |
| 61 | 62 |
| 62 // Resumes playback after calling Pause(). | 63 // Resumes playback after calling Pause(). |
| 63 virtual void Play() = 0; | 64 virtual void Play() = 0; |
| 64 | 65 |
| 65 // Sets the playback volume, with range [0.0, 1.0] inclusive. | 66 // Sets the playback volume, with range [0.0, 1.0] inclusive. |
| 66 // Returns |true| on success. | 67 // Returns |true| on success. |
| 67 virtual bool SetVolume(double volume) = 0; | 68 virtual bool SetVolume(double volume) = 0; |
| 68 | 69 |
| 69 // Returns a pointer to the internal output device. | 70 // Returns a pointer to the internal output device. |
| 70 // This pointer is not to be owned by the caller and is valid only during | 71 // This pointer is not to be owned by the caller and is valid only during |
| 71 // the lifetime of the AudioRendererSink. | 72 // the lifetime of the AudioRendererSink. |
| 72 // It can be null, which means that access to the output device is not | 73 // It can be null, which means that access to the output device is not |
| 73 // supported. | 74 // supported. |
| 74 virtual OutputDevice* GetOutputDevice() = 0; | 75 virtual OutputDevice* GetOutputDevice() = 0; |
| 75 | 76 |
| 76 protected: | 77 protected: |
| 77 friend class base::RefCountedThreadSafe<AudioRendererSink>; | 78 friend class base::RefCountedThreadSafe<AudioRendererSink>; |
| 78 virtual ~AudioRendererSink() {} | 79 virtual ~AudioRendererSink() {} |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 } // namespace media | 82 } // namespace media |
| 82 | 83 |
| 83 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 84 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
| OLD | NEW |