Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.h

Issue 1865583002: Implement BaseAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 14 matching lines...) Expand all
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 namespace blink { 33 namespace blink {
34 34
35 class AbstractAudioContext; 35 class BaseAudioContext;
36 class AudioBuffer; 36 class AudioBuffer;
37 class AudioBufferCallback; 37 class AudioBufferCallback;
38 class AudioBus; 38 class AudioBus;
39 class DOMArrayBuffer; 39 class DOMArrayBuffer;
40 class ScriptPromiseResolver; 40 class ScriptPromiseResolver;
41 41
42 // AsyncAudioDecoder asynchronously decodes audio file data from a DOMArrayBuffe r in a worker thread. 42 // 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. 43 // Upon successful decoding, a completion callback will be invoked with the deco ded PCM data in an AudioBuffer.
44 44
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* , AbstractAudioContext*); 55 void decodeAsync(DOMArrayBuffer* audioData, float sampleRate, AudioBufferCal lback* successCallback, AudioBufferCallback* errorCallback, ScriptPromiseResolve r* , 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*, AbstractAudioContext*); 59 static void decode(DOMArrayBuffer* audioData, float sampleRate, AudioBufferC allback* successCallback, AudioBufferCallback* errorCallback, ScriptPromiseResol ver*, BaseAudioContext*);
60 static void notifyComplete(DOMArrayBuffer* audioData, AudioBufferCallback* s uccessCallback, AudioBufferCallback* errorCallback, AudioBus*, ScriptPromiseReso lver*, AbstractAudioContext*); 60 static void notifyComplete(DOMArrayBuffer* audioData, AudioBufferCallback* s uccessCallback, AudioBufferCallback* errorCallback, AudioBus*, ScriptPromiseReso lver*, BaseAudioContext*);
61 61
62 OwnPtr<WebThread> m_thread; 62 OwnPtr<WebThread> m_thread;
63 }; 63 };
64 64
65 } // namespace blink 65 } // namespace blink
66 66
67 #endif // AsyncAudioDecoder_h 67 #endif // AsyncAudioDecoder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698