| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 double currentTime() const { | 60 double currentTime() const { |
| 61 return currentSampleFrame() / static_cast<double>(sampleRate()); | 61 return currentSampleFrame() / static_cast<double>(sampleRate()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 virtual unsigned long maxChannelCount() const { return 0; } | 64 virtual unsigned long maxChannelCount() const { return 0; } |
| 65 | 65 |
| 66 virtual void startRendering() = 0; | 66 virtual void startRendering() = 0; |
| 67 virtual void stopRendering() = 0; | 67 virtual void stopRendering() = 0; |
| 68 | 68 |
| 69 // Returns the rendering callback buffer size. |
| 70 virtual size_t callbackBufferSize() const = 0; |
| 71 |
| 69 protected: | 72 protected: |
| 70 // LocalAudioInputProvider allows us to expose an AudioSourceProvider for | 73 // LocalAudioInputProvider allows us to expose an AudioSourceProvider for |
| 71 // local/live audio input. If there is local/live audio input, we call set() | 74 // local/live audio input. If there is local/live audio input, we call set() |
| 72 // with the audio input data every render quantum. | 75 // with the audio input data every render quantum. |
| 73 class LocalAudioInputProvider final : public AudioSourceProvider { | 76 class LocalAudioInputProvider final : public AudioSourceProvider { |
| 74 public: | 77 public: |
| 75 LocalAudioInputProvider() | 78 LocalAudioInputProvider() |
| 76 : m_sourceBus(AudioBus::create( | 79 : m_sourceBus(AudioBus::create( |
| 77 2, | 80 2, |
| 78 AudioUtilities::kRenderQuantumFrames)) // FIXME: handle | 81 AudioUtilities::kRenderQuantumFrames)) // FIXME: handle |
| (...skipping 26 matching lines...) Expand all Loading... |
| 105 LocalAudioInputProvider m_localAudioInputProvider; | 108 LocalAudioInputProvider m_localAudioInputProvider; |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 class AudioDestinationNode : public AudioNode { | 111 class AudioDestinationNode : public AudioNode { |
| 109 DEFINE_WRAPPERTYPEINFO(); | 112 DEFINE_WRAPPERTYPEINFO(); |
| 110 | 113 |
| 111 public: | 114 public: |
| 112 AudioDestinationHandler& audioDestinationHandler() const; | 115 AudioDestinationHandler& audioDestinationHandler() const; |
| 113 | 116 |
| 114 unsigned long maxChannelCount() const; | 117 unsigned long maxChannelCount() const; |
| 118 size_t callbackBufferSize() const { return handler().callbackBufferSize(); } |
| 115 | 119 |
| 116 protected: | 120 protected: |
| 117 AudioDestinationNode(BaseAudioContext&); | 121 AudioDestinationNode(BaseAudioContext&); |
| 118 }; | 122 }; |
| 119 | 123 |
| 120 } // namespace blink | 124 } // namespace blink |
| 121 | 125 |
| 122 #endif // AudioDestinationNode_h | 126 #endif // AudioDestinationNode_h |
| OLD | NEW |