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/logging.h" | 10 #include "base/logging.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class AudioRendererSink | 22 class AudioRendererSink |
23 : public base::RefCountedThreadSafe<media::AudioRendererSink> { | 23 : public base::RefCountedThreadSafe<media::AudioRendererSink> { |
24 public: | 24 public: |
25 class RenderCallback { | 25 class RenderCallback { |
26 public: | 26 public: |
27 // Attempts to completely fill all channels of |dest|, returns actual | 27 // Attempts to completely fill all channels of |dest|, returns actual |
28 // number of frames filled. | 28 // number of frames filled. |
29 virtual int Render(AudioBus* dest, int audio_delay_milliseconds) = 0; | 29 virtual int Render(AudioBus* dest, int audio_delay_milliseconds) = 0; |
30 | 30 |
31 // Synchronized audio I/O - see InitializeIO() below. | |
32 virtual void RenderIO(AudioBus* source, | |
33 AudioBus* dest, | |
34 int audio_delay_milliseconds) {} | |
35 | |
36 // Signals an error has occurred. | 31 // Signals an error has occurred. |
37 virtual void OnRenderError() = 0; | 32 virtual void OnRenderError() = 0; |
38 | 33 |
39 protected: | 34 protected: |
40 virtual ~RenderCallback() {} | 35 virtual ~RenderCallback() {} |
41 }; | 36 }; |
42 | 37 |
43 // Sets important information about the audio stream format. | 38 // Sets important information about the audio stream format. |
44 // It must be called before any of the other methods. | 39 // It must be called before any of the other methods. |
45 virtual void Initialize(const AudioParameters& params, | 40 virtual void Initialize(const AudioParameters& params, |
(...skipping 16 matching lines...) Expand all Loading... |
62 virtual bool SetVolume(double volume) = 0; | 57 virtual bool SetVolume(double volume) = 0; |
63 | 58 |
64 protected: | 59 protected: |
65 friend class base::RefCountedThreadSafe<AudioRendererSink>; | 60 friend class base::RefCountedThreadSafe<AudioRendererSink>; |
66 virtual ~AudioRendererSink() {} | 61 virtual ~AudioRendererSink() {} |
67 }; | 62 }; |
68 | 63 |
69 } // namespace media | 64 } // namespace media |
70 | 65 |
71 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 66 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
OLD | NEW |