| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "platform/wtf/HashSet.h" | 44 #include "platform/wtf/HashSet.h" |
| 45 #include "platform/wtf/RefPtr.h" | 45 #include "platform/wtf/RefPtr.h" |
| 46 #include "platform/wtf/Threading.h" | 46 #include "platform/wtf/Threading.h" |
| 47 #include "platform/wtf/Vector.h" | 47 #include "platform/wtf/Vector.h" |
| 48 #include "platform/wtf/build_config.h" | 48 #include "platform/wtf/build_config.h" |
| 49 | 49 |
| 50 namespace blink { | 50 namespace blink { |
| 51 | 51 |
| 52 class AnalyserNode; | 52 class AnalyserNode; |
| 53 class AudioBuffer; | 53 class AudioBuffer; |
| 54 class AudioBufferCallback; | |
| 55 class AudioBufferSourceNode; | 54 class AudioBufferSourceNode; |
| 56 class AudioContextOptions; | 55 class AudioContextOptions; |
| 57 class AudioListener; | 56 class AudioListener; |
| 58 class BaseAudioContextTest; | 57 class BaseAudioContextTest; |
| 59 class BiquadFilterNode; | 58 class BiquadFilterNode; |
| 60 class ChannelMergerNode; | 59 class ChannelMergerNode; |
| 61 class ChannelSplitterNode; | 60 class ChannelSplitterNode; |
| 62 class ConstantSourceNode; | 61 class ConstantSourceNode; |
| 63 class ConvolverNode; | 62 class ConvolverNode; |
| 64 class DelayNode; | 63 class DelayNode; |
| 64 class DecodeErrorCallback; |
| 65 class DecodeSuccessCallback; |
| 65 class Document; | 66 class Document; |
| 66 class DynamicsCompressorNode; | 67 class DynamicsCompressorNode; |
| 67 class ExceptionState; | 68 class ExceptionState; |
| 68 class GainNode; | 69 class GainNode; |
| 69 class HTMLMediaElement; | 70 class HTMLMediaElement; |
| 70 class IIRFilterNode; | 71 class IIRFilterNode; |
| 71 class MediaElementAudioSourceNode; | 72 class MediaElementAudioSourceNode; |
| 72 class MediaStream; | 73 class MediaStream; |
| 73 class MediaStreamAudioDestinationNode; | 74 class MediaStreamAudioDestinationNode; |
| 74 class MediaStreamAudioSourceNode; | 75 class MediaStreamAudioSourceNode; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 void ThrowExceptionForClosedState(ExceptionState&); | 163 void ThrowExceptionForClosedState(ExceptionState&); |
| 163 | 164 |
| 164 AudioBuffer* createBuffer(unsigned number_of_channels, | 165 AudioBuffer* createBuffer(unsigned number_of_channels, |
| 165 size_t number_of_frames, | 166 size_t number_of_frames, |
| 166 float sample_rate, | 167 float sample_rate, |
| 167 ExceptionState&); | 168 ExceptionState&); |
| 168 | 169 |
| 169 // Asynchronous audio file data decoding. | 170 // Asynchronous audio file data decoding. |
| 170 ScriptPromise decodeAudioData(ScriptState*, | 171 ScriptPromise decodeAudioData(ScriptState*, |
| 171 DOMArrayBuffer* audio_data, | 172 DOMArrayBuffer* audio_data, |
| 172 AudioBufferCallback* success_callback, | 173 DecodeSuccessCallback*, |
| 173 AudioBufferCallback* error_callback, | 174 DecodeErrorCallback*, |
| 175 ExceptionState&); |
| 176 |
| 177 ScriptPromise decodeAudioData(ScriptState*, |
| 178 DOMArrayBuffer* audio_data, |
| 179 ExceptionState&); |
| 180 |
| 181 ScriptPromise decodeAudioData(ScriptState*, |
| 182 DOMArrayBuffer* audio_data, |
| 183 DecodeSuccessCallback*, |
| 174 ExceptionState&); | 184 ExceptionState&); |
| 175 | 185 |
| 176 // Handles the promise and callbacks when |decodeAudioData| is finished | 186 // Handles the promise and callbacks when |decodeAudioData| is finished |
| 177 // decoding. | 187 // decoding. |
| 178 void HandleDecodeAudioData(AudioBuffer*, | 188 void HandleDecodeAudioData(AudioBuffer*, |
| 179 ScriptPromiseResolver*, | 189 ScriptPromiseResolver*, |
| 180 AudioBufferCallback* success_callback, | 190 DecodeSuccessCallback*, |
| 181 AudioBufferCallback* error_callback); | 191 DecodeErrorCallback*); |
| 182 | 192 |
| 183 AudioListener* listener() { return listener_; } | 193 AudioListener* listener() { return listener_; } |
| 184 | 194 |
| 185 virtual bool HasRealtimeConstraint() = 0; | 195 virtual bool HasRealtimeConstraint() = 0; |
| 186 | 196 |
| 187 // The AudioNode create methods are called on the main thread (from | 197 // The AudioNode create methods are called on the main thread (from |
| 188 // JavaScript). | 198 // JavaScript). |
| 189 AudioBufferSourceNode* createBufferSource(ExceptionState&); | 199 AudioBufferSourceNode* createBufferSource(ExceptionState&); |
| 190 ConstantSourceNode* createConstantSource(ExceptionState&); | 200 ConstantSourceNode* createConstantSource(ExceptionState&); |
| 191 MediaElementAudioSourceNode* createMediaElementSource(HTMLMediaElement*, | 201 MediaElementAudioSourceNode* createMediaElementSource(HTMLMediaElement*, |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 // It is somewhat arbitrary and could be increased if necessary. | 490 // It is somewhat arbitrary and could be increased if necessary. |
| 481 enum { kMaxNumberOfChannels = 32 }; | 491 enum { kMaxNumberOfChannels = 32 }; |
| 482 | 492 |
| 483 Optional<AutoplayStatus> autoplay_status_; | 493 Optional<AutoplayStatus> autoplay_status_; |
| 484 AudioIOPosition output_position_; | 494 AudioIOPosition output_position_; |
| 485 }; | 495 }; |
| 486 | 496 |
| 487 } // namespace blink | 497 } // namespace blink |
| 488 | 498 |
| 489 #endif // BaseAudioContext_h | 499 #endif // BaseAudioContext_h |
| OLD | NEW |