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 blink { | 38 namespace blink { |
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 USING_GARBAGE_COLLECTED_MIXIN(MediaStreamAudioSourceNode); |
44 public: | 44 public: |
45 static PassRefPtrWillBeRawPtr<MediaStreamAudioSourceNode> create(AudioContex
t*, MediaStream*, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); | 45 static MediaStreamAudioSourceNode* create(AudioContext*, MediaStream*, Media
StreamTrack*, PassOwnPtr<AudioSourceProvider>); |
46 | 46 |
47 virtual ~MediaStreamAudioSourceNode(); | 47 virtual ~MediaStreamAudioSourceNode(); |
48 | 48 |
49 MediaStream* mediaStream() { return m_mediaStream.get(); } | 49 MediaStream* mediaStream() { return m_mediaStream.get(); } |
50 | 50 |
51 // AudioNode | 51 // AudioNode |
52 virtual void dispose() OVERRIDE; | 52 virtual void dispose() OVERRIDE; |
53 virtual void process(size_t framesToProcess) OVERRIDE; | 53 virtual void process(size_t framesToProcess) OVERRIDE; |
54 | 54 |
55 // AudioSourceProviderClient | 55 // AudioSourceProviderClient |
56 virtual void setFormat(size_t numberOfChannels, float sampleRate) OVERRIDE; | 56 virtual void setFormat(size_t numberOfChannels, float sampleRate) OVERRIDE; |
57 | 57 |
58 AudioSourceProvider* audioSourceProvider() const { return m_audioSourceProvi
der.get(); } | 58 AudioSourceProvider* audioSourceProvider() const { return m_audioSourceProvi
der.get(); } |
59 | 59 |
60 virtual void trace(Visitor*) OVERRIDE; | 60 virtual void trace(Visitor*) OVERRIDE; |
61 | 61 |
62 private: | 62 private: |
63 MediaStreamAudioSourceNode(AudioContext*, MediaStream*, MediaStreamTrack*, P
assOwnPtr<AudioSourceProvider>); | 63 MediaStreamAudioSourceNode(AudioContext*, MediaStream*, MediaStreamTrack*, P
assOwnPtr<AudioSourceProvider>); |
64 | 64 |
65 // As an audio source, we will never propagate silence. | 65 // As an audio source, we will never propagate silence. |
66 virtual bool propagatesSilence() const OVERRIDE { return false; } | 66 virtual bool propagatesSilence() const OVERRIDE { return false; } |
67 | 67 |
68 PersistentWillBeMember<MediaStream> m_mediaStream; | 68 Member<MediaStream> m_mediaStream; |
69 PersistentWillBeMember<MediaStreamTrack> m_audioTrack; | 69 Member<MediaStreamTrack> m_audioTrack; |
70 OwnPtr<AudioSourceProvider> m_audioSourceProvider; | 70 OwnPtr<AudioSourceProvider> m_audioSourceProvider; |
71 | 71 |
72 Mutex m_processLock; | 72 Mutex m_processLock; |
73 | 73 |
74 unsigned m_sourceNumberOfChannels; | 74 unsigned m_sourceNumberOfChannels; |
75 }; | 75 }; |
76 | 76 |
77 } // namespace blink | 77 } // namespace blink |
78 | 78 |
79 #endif // ENABLE(WEB_AUDIO) | 79 #endif // ENABLE(WEB_AUDIO) |
80 | 80 |
81 #endif // MediaStreamAudioSourceNode_h | 81 #endif // MediaStreamAudioSourceNode_h |
OLD | NEW |