OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. All rights reserved. | 2 * Copyright 2014 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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef MediaStreamWebAudioSource_h | 31 #ifndef MediaStreamWebAudioSource_h |
32 #define MediaStreamWebAudioSource_h | 32 #define MediaStreamWebAudioSource_h |
33 | 33 |
| 34 #include <memory> |
34 #include "platform/audio/AudioSourceProvider.h" | 35 #include "platform/audio/AudioSourceProvider.h" |
35 #include "wtf/Noncopyable.h" | 36 #include "wtf/Noncopyable.h" |
36 #include "wtf/PtrUtil.h" | 37 #include "wtf/PtrUtil.h" |
37 #include "wtf/ThreadingPrimitives.h" | 38 #include "wtf/ThreadingPrimitives.h" |
38 #include "wtf/build_config.h" | 39 #include "wtf/build_config.h" |
39 #include <memory> | |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 class WebAudioSourceProvider; | 43 class WebAudioSourceProvider; |
44 | 44 |
45 class MediaStreamWebAudioSource : public AudioSourceProvider { | 45 class MediaStreamWebAudioSource : public AudioSourceProvider { |
46 WTF_MAKE_NONCOPYABLE(MediaStreamWebAudioSource); | 46 WTF_MAKE_NONCOPYABLE(MediaStreamWebAudioSource); |
47 | 47 |
48 public: | 48 public: |
49 static std::unique_ptr<MediaStreamWebAudioSource> create( | 49 static std::unique_ptr<MediaStreamWebAudioSource> create( |
50 std::unique_ptr<WebAudioSourceProvider> provider) { | 50 std::unique_ptr<WebAudioSourceProvider> provider) { |
51 return WTF::wrapUnique(new MediaStreamWebAudioSource(std::move(provider))); | 51 return WTF::wrapUnique(new MediaStreamWebAudioSource(std::move(provider))); |
52 } | 52 } |
53 | 53 |
54 ~MediaStreamWebAudioSource() override; | 54 ~MediaStreamWebAudioSource() override; |
55 | 55 |
56 private: | 56 private: |
57 explicit MediaStreamWebAudioSource(std::unique_ptr<WebAudioSourceProvider>); | 57 explicit MediaStreamWebAudioSource(std::unique_ptr<WebAudioSourceProvider>); |
58 | 58 |
59 // blink::AudioSourceProvider implementation. | 59 // blink::AudioSourceProvider implementation. |
60 void provideInput(AudioBus*, size_t framesToProcess) override; | 60 void provideInput(AudioBus*, size_t framesToProcess) override; |
61 | 61 |
62 std::unique_ptr<WebAudioSourceProvider> m_webAudioSourceProvider; | 62 std::unique_ptr<WebAudioSourceProvider> m_webAudioSourceProvider; |
63 }; | 63 }; |
64 | 64 |
65 } // namespace blink | 65 } // namespace blink |
66 | 66 |
67 #endif // MediaStreamWebAudioSource_h | 67 #endif // MediaStreamWebAudioSource_h |
OLD | NEW |