| 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 17 matching lines...) Expand all Loading... |
| 28 virtual int Render(AudioBus* dest, int audio_delay_milliseconds) = 0; | 28 virtual int Render(AudioBus* dest, int audio_delay_milliseconds) = 0; |
| 29 | 29 |
| 30 // Synchronized audio I/O - see InitializeIO() below. | 30 // Synchronized audio I/O - see InitializeIO() below. |
| 31 virtual void RenderIO(AudioBus* source, | 31 virtual void RenderIO(AudioBus* source, |
| 32 AudioBus* dest, | 32 AudioBus* dest, |
| 33 int audio_delay_milliseconds) {} | 33 int audio_delay_milliseconds) {} |
| 34 | 34 |
| 35 // Signals an error has occurred. | 35 // Signals an error has occurred. |
| 36 virtual void OnRenderError() = 0; | 36 virtual void OnRenderError() = 0; |
| 37 | 37 |
| 38 // Optional method for handling device change notifications from the |
| 39 // browser. |
| 40 virtual void OnDeviceChange() {}; |
| 41 |
| 38 protected: | 42 protected: |
| 39 virtual ~RenderCallback() {} | 43 virtual ~RenderCallback() {} |
| 40 }; | 44 }; |
| 41 | 45 |
| 42 // Sets important information about the audio stream format. | 46 // Sets important information about the audio stream format. |
| 43 // It must be called before any of the other methods. | 47 // It must be called before any of the other methods. |
| 44 virtual void Initialize(const AudioParameters& params, | 48 virtual void Initialize(const AudioParameters& params, |
| 45 RenderCallback* callback) = 0; | 49 RenderCallback* callback) = 0; |
| 46 | 50 |
| 47 // InitializeIO() may be called instead of Initialize() for clients who wish | 51 // InitializeIO() may be called instead of Initialize() for clients who wish |
| (...skipping 24 matching lines...) Expand all Loading... |
| 72 virtual bool SetVolume(double volume) = 0; | 76 virtual bool SetVolume(double volume) = 0; |
| 73 | 77 |
| 74 protected: | 78 protected: |
| 75 friend class base::RefCountedThreadSafe<AudioRendererSink>; | 79 friend class base::RefCountedThreadSafe<AudioRendererSink>; |
| 76 virtual ~AudioRendererSink() {} | 80 virtual ~AudioRendererSink() {} |
| 77 }; | 81 }; |
| 78 | 82 |
| 79 } // namespace media | 83 } // namespace media |
| 80 | 84 |
| 81 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 85 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
| OLD | NEW |