| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "modules/webaudio/AudioSourceNode.h" | 30 #include "modules/webaudio/AudioSourceNode.h" |
| 31 #include "platform/audio/AudioSourceProviderClient.h" | 31 #include "platform/audio/AudioSourceProviderClient.h" |
| 32 #include "platform/audio/MultiChannelResampler.h" | 32 #include "platform/audio/MultiChannelResampler.h" |
| 33 #include "wtf/OwnPtr.h" | 33 #include "wtf/OwnPtr.h" |
| 34 #include "wtf/PassRefPtr.h" | 34 #include "wtf/PassRefPtr.h" |
| 35 #include "wtf/ThreadingPrimitives.h" | 35 #include "wtf/ThreadingPrimitives.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class AudioContext; | 39 class AbstractAudioContext; |
| 40 class HTMLMediaElement; | 40 class HTMLMediaElement; |
| 41 | 41 |
| 42 class MediaElementAudioSourceHandler final : public AudioHandler { | 42 class MediaElementAudioSourceHandler final : public AudioHandler { |
| 43 public: | 43 public: |
| 44 static PassRefPtr<MediaElementAudioSourceHandler> create(AudioNode&, HTMLMed
iaElement&); | 44 static PassRefPtr<MediaElementAudioSourceHandler> create(AudioNode&, HTMLMed
iaElement&); |
| 45 ~MediaElementAudioSourceHandler() override; | 45 ~MediaElementAudioSourceHandler() override; |
| 46 | 46 |
| 47 HTMLMediaElement* mediaElement() { return m_mediaElement.get(); } | 47 HTMLMediaElement* mediaElement() { return m_mediaElement.get(); } |
| 48 | 48 |
| 49 // AudioHandler | 49 // AudioHandler |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 // The value of mediaElement()->currentSrc().string() in the ctor and onCurr
entSrcChanged(). | 96 // The value of mediaElement()->currentSrc().string() in the ctor and onCurr
entSrcChanged(). |
| 97 // Protected by |m_processLock|. | 97 // Protected by |m_processLock|. |
| 98 String m_currentSrcString; | 98 String m_currentSrcString; |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 class MediaElementAudioSourceNode final : public AudioSourceNode, public AudioSo
urceProviderClient { | 101 class MediaElementAudioSourceNode final : public AudioSourceNode, public AudioSo
urceProviderClient { |
| 102 DEFINE_WRAPPERTYPEINFO(); | 102 DEFINE_WRAPPERTYPEINFO(); |
| 103 USING_GARBAGE_COLLECTED_MIXIN(MediaElementAudioSourceNode); | 103 USING_GARBAGE_COLLECTED_MIXIN(MediaElementAudioSourceNode); |
| 104 public: | 104 public: |
| 105 static MediaElementAudioSourceNode* create(AudioContext&, HTMLMediaElement&)
; | 105 static MediaElementAudioSourceNode* create(AbstractAudioContext&, HTMLMediaE
lement&); |
| 106 DECLARE_VIRTUAL_TRACE(); | 106 DECLARE_VIRTUAL_TRACE(); |
| 107 MediaElementAudioSourceHandler& mediaElementAudioSourceHandler() const; | 107 MediaElementAudioSourceHandler& mediaElementAudioSourceHandler() const; |
| 108 | 108 |
| 109 HTMLMediaElement* mediaElement() const; | 109 HTMLMediaElement* mediaElement() const; |
| 110 | 110 |
| 111 // AudioSourceProviderClient functions: | 111 // AudioSourceProviderClient functions: |
| 112 void setFormat(size_t numberOfChannels, float sampleRate) override; | 112 void setFormat(size_t numberOfChannels, float sampleRate) override; |
| 113 void onCurrentSrcChanged(const KURL& currentSrc) override; | 113 void onCurrentSrcChanged(const KURL& currentSrc) override; |
| 114 void lock() override; | 114 void lock() override; |
| 115 void unlock() override; | 115 void unlock() override; |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 MediaElementAudioSourceNode(AudioContext&, HTMLMediaElement&); | 118 MediaElementAudioSourceNode(AbstractAudioContext&, HTMLMediaElement&); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace blink | 121 } // namespace blink |
| 122 | 122 |
| 123 #endif // ENABLE(WEB_AUDIO) | 123 #endif // ENABLE(WEB_AUDIO) |
| 124 | 124 |
| 125 #endif // MediaElementAudioSourceNode_h | 125 #endif // MediaElementAudioSourceNode_h |
| OLD | NEW |