OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 12 matching lines...) Expand all Loading... |
23 */ | 23 */ |
24 | 24 |
25 #ifndef AsyncAudioDecoder_h | 25 #ifndef AsyncAudioDecoder_h |
26 #define AsyncAudioDecoder_h | 26 #define AsyncAudioDecoder_h |
27 | 27 |
28 #include "platform/heap/Handle.h" | 28 #include "platform/heap/Handle.h" |
29 #include "public/platform/WebThread.h" | 29 #include "public/platform/WebThread.h" |
30 #include "wtf/OwnPtr.h" | 30 #include "wtf/OwnPtr.h" |
31 #include "wtf/build_config.h" | 31 #include "wtf/build_config.h" |
32 | 32 |
33 #if ENABLE(WEB_AUDIO) | |
34 | |
35 namespace blink { | 33 namespace blink { |
36 | 34 |
37 class AudioBuffer; | 35 class AudioBuffer; |
38 class AudioBufferCallback; | 36 class AudioBufferCallback; |
39 class AudioBus; | 37 class AudioBus; |
40 class DOMArrayBuffer; | 38 class DOMArrayBuffer; |
41 | 39 |
42 // AsyncAudioDecoder asynchronously decodes audio file data from a DOMArrayBuffe
r in a worker thread. | 40 // AsyncAudioDecoder asynchronously decodes audio file data from a DOMArrayBuffe
r in a worker thread. |
43 // Upon successful decoding, a completion callback will be invoked with the deco
ded PCM data in an AudioBuffer. | 41 // Upon successful decoding, a completion callback will be invoked with the deco
ded PCM data in an AudioBuffer. |
44 | 42 |
(...skipping 10 matching lines...) Expand all Loading... |
55 private: | 53 private: |
56 AudioBuffer* createAudioBufferFromAudioBus(AudioBus*); | 54 AudioBuffer* createAudioBufferFromAudioBus(AudioBus*); |
57 static void decode(DOMArrayBuffer* audioData, float sampleRate, AudioBufferC
allback* successCallback, AudioBufferCallback* errorCallback); | 55 static void decode(DOMArrayBuffer* audioData, float sampleRate, AudioBufferC
allback* successCallback, AudioBufferCallback* errorCallback); |
58 static void notifyComplete(DOMArrayBuffer* audioData, AudioBufferCallback* s
uccessCallback, AudioBufferCallback* errorCallback, AudioBus*); | 56 static void notifyComplete(DOMArrayBuffer* audioData, AudioBufferCallback* s
uccessCallback, AudioBufferCallback* errorCallback, AudioBus*); |
59 | 57 |
60 OwnPtr<WebThread> m_thread; | 58 OwnPtr<WebThread> m_thread; |
61 }; | 59 }; |
62 | 60 |
63 } // namespace blink | 61 } // namespace blink |
64 | 62 |
65 #endif // ENABLE(WEB_AUDIO) | |
66 | |
67 #endif // AsyncAudioDecoder_h | 63 #endif // AsyncAudioDecoder_h |
OLD | NEW |