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

Side by Side Diff: Source/modules/webaudio/AudioNode.h

Issue 1140723003: Implement suspend() and resume() for OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Bring ToT Created 5 years, 4 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
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | Source/modules/webaudio/AudioNode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 virtual void dispose(); 100 virtual void dispose();
101 101
102 // node() returns a valid object until dispose() is called. This returns 102 // node() returns a valid object until dispose() is called. This returns
103 // nullptr after dispose(). We must not call node() in an audio rendering 103 // nullptr after dispose(). We must not call node() in an audio rendering
104 // thread. 104 // thread.
105 AudioNode* node() const; 105 AudioNode* node() const;
106 // context() returns a valid object until the AbstractAudioContext dies, and returns 106 // context() returns a valid object until the AbstractAudioContext dies, and returns
107 // nullptr otherwise. This always returns a valid object in an audio 107 // nullptr otherwise. This always returns a valid object in an audio
108 // rendering thread, and inside dispose(). We must not call context() in 108 // rendering thread, and inside dispose(). We must not call context() in
109 // the destructor. 109 // the destructor.
110 AbstractAudioContext* context() const; 110 virtual AbstractAudioContext* context() const;
111 void clearContext() { m_context = nullptr; } 111 void clearContext() { m_context = nullptr; }
112 112
113 enum ChannelCountMode { 113 enum ChannelCountMode {
114 Max, 114 Max,
115 ClampedMax, 115 ClampedMax,
116 Explicit 116 Explicit
117 }; 117 };
118 118
119 NodeType nodeType() const { return m_nodeType; } 119 NodeType nodeType() const { return m_nodeType; }
120 String nodeTypeName() const; 120 String nodeTypeName() const;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 void addOutput(unsigned numberOfChannels); 222 void addOutput(unsigned numberOfChannels);
223 223
224 // Called by processIfNecessary() to cause all parts of the rendering graph connected to us to process. 224 // Called by processIfNecessary() to cause all parts of the rendering graph connected to us to process.
225 // Each rendering quantum, the audio data for each of the AudioNode's inputs will be available after this method is called. 225 // Each rendering quantum, the audio data for each of the AudioNode's inputs will be available after this method is called.
226 // Called from context's audio thread. 226 // Called from context's audio thread.
227 virtual void pullInputs(size_t framesToProcess); 227 virtual void pullInputs(size_t framesToProcess);
228 228
229 // Force all inputs to take any channel interpretation changes into account. 229 // Force all inputs to take any channel interpretation changes into account.
230 void updateChannelsForInputs(); 230 void updateChannelsForInputs();
231 231
232 // This raw pointer is safe because this is cleared for all of live
233 // AudioHandlers when the AbstractAudioContext dies. Do not access m_contex t
234 // directly, use context() instead.
235 GC_PLUGIN_IGNORE("http://crbug.com/404527")
236 AbstractAudioContext* m_context;
237
232 private: 238 private:
233 void setNodeType(NodeType); 239 void setNodeType(NodeType);
234 240
235 volatile bool m_isInitialized; 241 volatile bool m_isInitialized;
236 NodeType m_nodeType; 242 NodeType m_nodeType;
237 243
238 // The owner AudioNode. This raw pointer is safe because dispose() is 244 // The owner AudioNode. This raw pointer is safe because dispose() is
239 // called before the AudioNode death, and it clears m_node. Do not access 245 // called before the AudioNode death, and it clears m_node. Do not access
240 // m_node directly, use node() instead. 246 // m_node directly, use node() instead.
241 GC_PLUGIN_IGNORE("http://crbug.com/404527") 247 GC_PLUGIN_IGNORE("http://crbug.com/404527")
242 AudioNode* m_node; 248 AudioNode* m_node;
243 249
244 // This raw pointer is safe because this is cleared for all of live
245 // AudioHandlers when the AbstractAudioContext dies. Do not access m_contex t
246 // directly, use context() instead.
247 GC_PLUGIN_IGNORE("http://crbug.com/404527")
248 AbstractAudioContext* m_context;
249
250 float m_sampleRate; 250 float m_sampleRate;
251 Vector<OwnPtr<AudioNodeInput>> m_inputs; 251 Vector<OwnPtr<AudioNodeInput>> m_inputs;
252 Vector<OwnPtr<AudioNodeOutput>> m_outputs; 252 Vector<OwnPtr<AudioNodeOutput>> m_outputs;
253 253
254 double m_lastProcessingTime; 254 double m_lastProcessingTime;
255 double m_lastNonSilentTime; 255 double m_lastNonSilentTime;
256 256
257 volatile int m_connectionRefCount; 257 volatile int m_connectionRefCount;
258 258
259 bool m_isDisabled; 259 bool m_isDisabled;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 HeapVector<Member<HeapHashSet<Member<AudioNode>>>> m_connectedNodes; 330 HeapVector<Member<HeapHashSet<Member<AudioNode>>>> m_connectedNodes;
331 // Represents audio node graph with Oilpan references. N-th HeapHashSet 331 // Represents audio node graph with Oilpan references. N-th HeapHashSet
332 // represents a set of AudioParam objects connected to this AudioNode's N-th 332 // represents a set of AudioParam objects connected to this AudioNode's N-th
333 // output. 333 // output.
334 HeapVector<Member<HeapHashSet<Member<AudioParam>>>> m_connectedParams; 334 HeapVector<Member<HeapHashSet<Member<AudioParam>>>> m_connectedParams;
335 }; 335 };
336 336
337 } // namespace blink 337 } // namespace blink
338 338
339 #endif // AudioNode_h 339 #endif // AudioNode_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | Source/modules/webaudio/AudioNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698