| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 22 matching lines...) Expand all Loading... |
| 33 #include "modules/webaudio/AudioSourceNode.h" | 33 #include "modules/webaudio/AudioSourceNode.h" |
| 34 #include "wtf/OwnPtr.h" | 34 #include "wtf/OwnPtr.h" |
| 35 #include "wtf/PassRefPtr.h" | 35 #include "wtf/PassRefPtr.h" |
| 36 #include "wtf/Threading.h" | 36 #include "wtf/Threading.h" |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace WebCore { |
| 39 | 39 |
| 40 class AudioContext; | 40 class AudioContext; |
| 41 | 41 |
| 42 class MediaStreamAudioSourceNode FINAL : public AudioSourceNode, public AudioSou
rceProviderClient { | 42 class MediaStreamAudioSourceNode FINAL : public AudioSourceNode, public AudioSou
rceProviderClient { |
| 43 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaStreamAudioSourceNode); |
| 43 public: | 44 public: |
| 44 static PassRefPtrWillBeRawPtr<MediaStreamAudioSourceNode> create(AudioContex
t*, MediaStream*, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); | 45 static PassRefPtrWillBeRawPtr<MediaStreamAudioSourceNode> create(AudioContex
t*, MediaStream*, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); |
| 45 | 46 |
| 46 virtual ~MediaStreamAudioSourceNode(); | 47 virtual ~MediaStreamAudioSourceNode(); |
| 47 | 48 |
| 48 MediaStream* mediaStream() { return m_mediaStream.get(); } | 49 MediaStream* mediaStream() { return m_mediaStream.get(); } |
| 49 | 50 |
| 50 // AudioNode | 51 // AudioNode |
| 51 virtual void process(size_t framesToProcess) OVERRIDE; | 52 virtual void process(size_t framesToProcess) OVERRIDE; |
| 52 | 53 |
| 53 // AudioSourceProviderClient | 54 // AudioSourceProviderClient |
| 54 virtual void setFormat(size_t numberOfChannels, float sampleRate) OVERRIDE; | 55 virtual void setFormat(size_t numberOfChannels, float sampleRate) OVERRIDE; |
| 55 | 56 |
| 56 AudioSourceProvider* audioSourceProvider() const { return m_audioSourceProvi
der.get(); } | 57 AudioSourceProvider* audioSourceProvider() const { return m_audioSourceProvi
der.get(); } |
| 57 | 58 |
| 59 virtual void trace(Visitor*) OVERRIDE; |
| 60 |
| 58 private: | 61 private: |
| 59 MediaStreamAudioSourceNode(AudioContext*, MediaStream*, MediaStreamTrack*, P
assOwnPtr<AudioSourceProvider>); | 62 MediaStreamAudioSourceNode(AudioContext*, MediaStream*, MediaStreamTrack*, P
assOwnPtr<AudioSourceProvider>); |
| 60 | 63 |
| 61 // As an audio source, we will never propagate silence. | 64 // As an audio source, we will never propagate silence. |
| 62 virtual bool propagatesSilence() const OVERRIDE { return false; } | 65 virtual bool propagatesSilence() const OVERRIDE { return false; } |
| 63 | 66 |
| 64 RefPtr<MediaStream> m_mediaStream; | 67 RefPtr<MediaStream> m_mediaStream; |
| 65 RefPtr<MediaStreamTrack> m_audioTrack; | 68 RefPtr<MediaStreamTrack> m_audioTrack; |
| 66 OwnPtr<AudioSourceProvider> m_audioSourceProvider; | 69 OwnPtr<AudioSourceProvider> m_audioSourceProvider; |
| 67 | 70 |
| 68 Mutex m_processLock; | 71 Mutex m_processLock; |
| 69 | 72 |
| 70 unsigned m_sourceNumberOfChannels; | 73 unsigned m_sourceNumberOfChannels; |
| 71 }; | 74 }; |
| 72 | 75 |
| 73 } // namespace WebCore | 76 } // namespace WebCore |
| 74 | 77 |
| 75 #endif // ENABLE(WEB_AUDIO) | 78 #endif // ENABLE(WEB_AUDIO) |
| 76 | 79 |
| 77 #endif // MediaStreamAudioSourceNode_h | 80 #endif // MediaStreamAudioSourceNode_h |
| OLD | NEW |