OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #ifndef AudioSourceProvider_h | 29 #ifndef AudioSourceProvider_h |
30 #define AudioSourceProvider_h | 30 #define AudioSourceProvider_h |
31 | 31 |
| 32 #include <cstddef> |
32 #include "platform/PlatformExport.h" | 33 #include "platform/PlatformExport.h" |
33 #include "wtf/Allocator.h" | 34 #include "wtf/Allocator.h" |
34 #include <cstddef> | |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 class AudioBus; | 38 class AudioBus; |
39 class AudioSourceProviderClient; | 39 class AudioSourceProviderClient; |
40 | 40 |
41 // Abstract base-class for a pull-model client. | 41 // Abstract base-class for a pull-model client. |
42 class PLATFORM_EXPORT AudioSourceProvider { | 42 class PLATFORM_EXPORT AudioSourceProvider { |
43 USING_FAST_MALLOC(AudioSourceProvider); | 43 USING_FAST_MALLOC(AudioSourceProvider); |
44 WTF_MAKE_NONCOPYABLE(AudioSourceProvider); | 44 WTF_MAKE_NONCOPYABLE(AudioSourceProvider); |
45 | 45 |
46 public: | 46 public: |
47 AudioSourceProvider() {} | 47 AudioSourceProvider() {} |
48 | 48 |
49 // provideInput() gets called repeatedly to render time-slices of a continuous | 49 // provideInput() gets called repeatedly to render time-slices of a continuous |
50 // audio stream. | 50 // audio stream. |
51 virtual void provideInput(AudioBus* bus, size_t framesToProcess) = 0; | 51 virtual void provideInput(AudioBus* bus, size_t framesToProcess) = 0; |
52 | 52 |
53 // If a client is set, we call it back when the audio format is available or | 53 // If a client is set, we call it back when the audio format is available or |
54 // changes. | 54 // changes. |
55 virtual void setClient(AudioSourceProviderClient*){}; | 55 virtual void setClient(AudioSourceProviderClient*){}; |
56 | 56 |
57 virtual ~AudioSourceProvider() {} | 57 virtual ~AudioSourceProvider() {} |
58 }; | 58 }; |
59 | 59 |
60 } // namespace blink | 60 } // namespace blink |
61 | 61 |
62 #endif // AudioSourceProvider_h | 62 #endif // AudioSourceProvider_h |
OLD | NEW |