| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 class MediaStreamAudioDestinationHandler final : public AudioBasicInspectorHandl
er { | 40 class MediaStreamAudioDestinationHandler final : public AudioBasicInspectorHandl
er { |
| 41 public: | 41 public: |
| 42 static PassRefPtr<MediaStreamAudioDestinationHandler> create(AudioNode&, siz
e_t numberOfChannels); | 42 static PassRefPtr<MediaStreamAudioDestinationHandler> create(AudioNode&, siz
e_t numberOfChannels); |
| 43 ~MediaStreamAudioDestinationHandler() override; | 43 ~MediaStreamAudioDestinationHandler() override; |
| 44 | 44 |
| 45 MediaStream* stream() { return m_stream.get(); } | 45 MediaStream* stream() { return m_stream.get(); } |
| 46 | 46 |
| 47 // AudioHandler. | 47 // AudioHandler. |
| 48 void process(size_t framesToProcess) override; | 48 void process(size_t framesToProcess) override; |
| 49 void setChannelCount(unsigned long, ExceptionState&) override; |
| 50 |
| 51 unsigned long maxChannelCount() const; |
| 49 | 52 |
| 50 private: | 53 private: |
| 51 MediaStreamAudioDestinationHandler(AudioNode&, size_t numberOfChannels); | 54 MediaStreamAudioDestinationHandler(AudioNode&, size_t numberOfChannels); |
| 52 // As an audio source, we will never propagate silence. | 55 // As an audio source, we will never propagate silence. |
| 53 bool propagatesSilence() const override { return false; } | 56 bool propagatesSilence() const override { return false; } |
| 54 | 57 |
| 55 // This Persistent doesn't make a reference cycle. | 58 // This Persistent doesn't make a reference cycle. |
| 56 Persistent<MediaStream> m_stream; | 59 Persistent<MediaStream> m_stream; |
| 57 Persistent<MediaStreamSource> m_source; | 60 Persistent<MediaStreamSource> m_source; |
| 61 |
| 62 // This internal mix bus is for up/down mixing the input to the actual |
| 63 // number of channels in the destination. |
| 58 RefPtr<AudioBus> m_mixBus; | 64 RefPtr<AudioBus> m_mixBus; |
| 59 }; | 65 }; |
| 60 | 66 |
| 61 class MediaStreamAudioDestinationNode final : public AudioBasicInspectorNode { | 67 class MediaStreamAudioDestinationNode final : public AudioBasicInspectorNode { |
| 62 DEFINE_WRAPPERTYPEINFO(); | 68 DEFINE_WRAPPERTYPEINFO(); |
| 63 public: | 69 public: |
| 64 static MediaStreamAudioDestinationNode* create(AbstractAudioContext&, size_t
numberOfChannels); | 70 static MediaStreamAudioDestinationNode* create(AbstractAudioContext&, size_t
numberOfChannels); |
| 65 MediaStream* stream() const; | 71 MediaStream* stream() const; |
| 66 | 72 |
| 67 private: | 73 private: |
| 68 MediaStreamAudioDestinationNode(AbstractAudioContext&, size_t numberOfChanne
ls); | 74 MediaStreamAudioDestinationNode(AbstractAudioContext&, size_t numberOfChanne
ls); |
| 69 }; | 75 }; |
| 70 | 76 |
| 71 } // namespace blink | 77 } // namespace blink |
| 72 | 78 |
| 73 #endif // ENABLE(WEB_AUDIO) | 79 #endif // ENABLE(WEB_AUDIO) |
| 74 | 80 |
| 75 #endif // MediaStreamAudioDestinationNode_h | 81 #endif // MediaStreamAudioDestinationNode_h |
| OLD | NEW |