| 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 24 matching lines...) Expand all Loading... |
| 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 MediaStreamAudioSourceHandler final : public AudioHandler { | 42 class MediaStreamAudioSourceHandler final : public AudioHandler { |
| 43 public: | 43 public: |
| 44 static PassRefPtr<MediaStreamAudioSourceHandler> create(AudioNode&, MediaStr
eam&, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); | 44 static PassRefPtr<MediaStreamAudioSourceHandler> create(AudioNode&, MediaStr
eam&, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); |
| 45 virtual ~MediaStreamAudioSourceHandler(); | 45 ~MediaStreamAudioSourceHandler() override; |
| 46 | 46 |
| 47 MediaStream* mediaStream() { return m_mediaStream.get(); } | 47 MediaStream* mediaStream() { return m_mediaStream.get(); } |
| 48 | 48 |
| 49 // AudioHandler | 49 // AudioHandler |
| 50 virtual void process(size_t framesToProcess) override; | 50 void process(size_t framesToProcess) override; |
| 51 | 51 |
| 52 // A helper for AudioSourceProviderClient implementation of | 52 // A helper for AudioSourceProviderClient implementation of |
| 53 // MediaStreamAudioSourceNode. | 53 // MediaStreamAudioSourceNode. |
| 54 void setFormat(size_t numberOfChannels, float sampleRate); | 54 void setFormat(size_t numberOfChannels, float sampleRate); |
| 55 | 55 |
| 56 AudioSourceProvider* audioSourceProvider() const { return m_audioSourceProvi
der.get(); } | 56 AudioSourceProvider* audioSourceProvider() const { return m_audioSourceProvi
der.get(); } |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 MediaStreamAudioSourceHandler(AudioNode&, MediaStream&, MediaStreamTrack*, P
assOwnPtr<AudioSourceProvider>); | 59 MediaStreamAudioSourceHandler(AudioNode&, MediaStream&, MediaStreamTrack*, P
assOwnPtr<AudioSourceProvider>); |
| 60 // As an audio source, we will never propagate silence. | 60 // As an audio source, we will never propagate silence. |
| 61 virtual bool propagatesSilence() const override { return false; } | 61 bool propagatesSilence() const override { return false; } |
| 62 | 62 |
| 63 // These Persistents don't make reference cycles including the owner | 63 // These Persistents don't make reference cycles including the owner |
| 64 // MediaStreamAudioSourceNode. | 64 // MediaStreamAudioSourceNode. |
| 65 Persistent<MediaStream> m_mediaStream; | 65 Persistent<MediaStream> m_mediaStream; |
| 66 Persistent<MediaStreamTrack> m_audioTrack; | 66 Persistent<MediaStreamTrack> m_audioTrack; |
| 67 OwnPtr<AudioSourceProvider> m_audioSourceProvider; | 67 OwnPtr<AudioSourceProvider> m_audioSourceProvider; |
| 68 | 68 |
| 69 Mutex m_processLock; | 69 Mutex m_processLock; |
| 70 | 70 |
| 71 unsigned m_sourceNumberOfChannels; | 71 unsigned m_sourceNumberOfChannels; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 MediaStreamAudioSourceNode(AudioContext&, MediaStream&, MediaStreamTrack*, P
assOwnPtr<AudioSourceProvider>); | 88 MediaStreamAudioSourceNode(AudioContext&, MediaStream&, MediaStreamTrack*, P
assOwnPtr<AudioSourceProvider>); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| 92 | 92 |
| 93 #endif // ENABLE(WEB_AUDIO) | 93 #endif // ENABLE(WEB_AUDIO) |
| 94 | 94 |
| 95 #endif // MediaStreamAudioSourceNode_h | 95 #endif // MediaStreamAudioSourceNode_h |
| OLD | NEW |