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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 class AsyncAudioDecoder { | 45 class AsyncAudioDecoder { |
46 DISALLOW_NEW(); | 46 DISALLOW_NEW(); |
47 WTF_MAKE_NONCOPYABLE(AsyncAudioDecoder); | 47 WTF_MAKE_NONCOPYABLE(AsyncAudioDecoder); |
48 public: | 48 public: |
49 AsyncAudioDecoder(); | 49 AsyncAudioDecoder(); |
50 ~AsyncAudioDecoder(); | 50 ~AsyncAudioDecoder(); |
51 | 51 |
52 // Must be called on the main thread. |decodeAsync| and callees must not mo
dify any of the | 52 // Must be called on the main thread. |decodeAsync| and callees must not mo
dify any of the |
53 // parameters except |audioData|. They are used to associate this decoding
instance with the | 53 // parameters except |audioData|. They are used to associate this decoding
instance with the |
54 // caller to process the decoding appropriately when finished. | 54 // caller to process the decoding appropriately when finished. |
55 void decodeAsync(DOMArrayBuffer* audioData, float sampleRate, AudioBufferCal
lback* successCallback, AudioBufferCallback* errorCallback, ScriptPromiseResolve
r* , BaseAudioContext*); | 55 void decodeAsync(DOMArrayBuffer* audioData, float sampleRate, bool disableRe
sampling, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallba
ck, ScriptPromiseResolver* , BaseAudioContext*); |
56 | 56 |
57 private: | 57 private: |
58 AudioBuffer* createAudioBufferFromAudioBus(AudioBus*); | 58 AudioBuffer* createAudioBufferFromAudioBus(AudioBus*); |
59 static void decode(DOMArrayBuffer* audioData, float sampleRate, AudioBufferC
allback* successCallback, AudioBufferCallback* errorCallback, ScriptPromiseResol
ver*, BaseAudioContext*); | 59 static void decode(DOMArrayBuffer* audioData, float sampleRate, bool disable
Resampling, AudioBufferCallback* successCallback, AudioBufferCallback* errorCall
back, ScriptPromiseResolver*, BaseAudioContext*); |
60 static void notifyComplete(DOMArrayBuffer* audioData, AudioBufferCallback* s
uccessCallback, AudioBufferCallback* errorCallback, AudioBus*, ScriptPromiseReso
lver*, BaseAudioContext*); | 60 static void notifyComplete(DOMArrayBuffer* audioData, AudioBufferCallback* s
uccessCallback, AudioBufferCallback* errorCallback, AudioBus*, ScriptPromiseReso
lver*, BaseAudioContext*); |
61 | 61 |
62 std::unique_ptr<WebThread> m_thread; | 62 std::unique_ptr<WebThread> m_thread; |
63 }; | 63 }; |
64 | 64 |
65 } // namespace blink | 65 } // namespace blink |
66 | 66 |
67 #endif // AsyncAudioDecoder_h | 67 #endif // AsyncAudioDecoder_h |
OLD | NEW |