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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 289 |
290 // Called at the start of each render quantum. | 290 // Called at the start of each render quantum. |
291 void handlePreRenderTasks(); | 291 void handlePreRenderTasks(); |
292 | 292 |
293 // Called at the end of each render quantum. | 293 // Called at the end of each render quantum. |
294 void handlePostRenderTasks(); | 294 void handlePostRenderTasks(); |
295 | 295 |
296 // Called periodically at the end of each render quantum to dereference fini
shed source nodes. | 296 // Called periodically at the end of each render quantum to dereference fini
shed source nodes. |
297 void derefFinishedSourceNodes(); | 297 void derefFinishedSourceNodes(); |
298 | 298 |
299 void registerLiveAudioSummingJunction(AudioSummingJunction&); | |
300 void registerLiveNode(AudioNode&); | 299 void registerLiveNode(AudioNode&); |
301 | 300 |
302 // Keeps track of the number of connections made. | 301 // Keeps track of the number of connections made. |
303 void incrementConnectionCount() | 302 void incrementConnectionCount() |
304 { | 303 { |
305 ASSERT(isMainThread()); | 304 ASSERT(isMainThread()); |
306 m_connectionCount++; | 305 m_connectionCount++; |
307 } | 306 } |
308 | 307 |
309 unsigned connectionCount() const { return m_connectionCount; } | 308 unsigned connectionCount() const { return m_connectionCount; } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 class AudioNodeDisposer { | 420 class AudioNodeDisposer { |
422 public: | 421 public: |
423 explicit AudioNodeDisposer(AudioNode& node) : m_node(node) { } | 422 explicit AudioNodeDisposer(AudioNode& node) : m_node(node) { } |
424 ~AudioNodeDisposer(); | 423 ~AudioNodeDisposer(); |
425 | 424 |
426 private: | 425 private: |
427 AudioNode& m_node; | 426 AudioNode& m_node; |
428 }; | 427 }; |
429 HeapHashMap<WeakMember<AudioNode>, OwnPtr<AudioNodeDisposer>> m_liveNodes; | 428 HeapHashMap<WeakMember<AudioNode>, OwnPtr<AudioNodeDisposer>> m_liveNodes; |
430 | 429 |
431 class AudioSummingJunctionDisposer { | |
432 public: | |
433 explicit AudioSummingJunctionDisposer(AudioSummingJunction& junction) :
m_junction(junction) { } | |
434 ~AudioSummingJunctionDisposer(); | |
435 | |
436 private: | |
437 AudioSummingJunction& m_junction; | |
438 }; | |
439 // The purpose of m_liveAudioSummingJunctions is to remove a dying | |
440 // AudioSummingJunction from m_dirtySummingJunctions. However we put all of | |
441 // AudioSummingJunction objects to m_liveAudioSummingJunctions to avoid | |
442 // concurrent access to m_liveAudioSummingJunctions. | |
443 HeapHashMap<WeakMember<AudioSummingJunction>, OwnPtr<AudioSummingJunctionDis
poser>> m_liveAudioSummingJunctions; | |
444 | |
445 unsigned m_connectionCount; | 430 unsigned m_connectionCount; |
446 | 431 |
447 // Graph locking. | 432 // Graph locking. |
448 bool m_didInitializeContextGraphMutex; | 433 bool m_didInitializeContextGraphMutex; |
449 RefPtr<DeferredTaskHandler> m_deferredTaskHandler; | 434 RefPtr<DeferredTaskHandler> m_deferredTaskHandler; |
450 | 435 |
451 Member<AudioBuffer> m_renderTarget; | 436 Member<AudioBuffer> m_renderTarget; |
452 | 437 |
453 bool m_isOfflineContext; | 438 bool m_isOfflineContext; |
454 | 439 |
(...skipping 17 matching lines...) Expand all Loading... |
472 // This is considering 32 is large enough for multiple channels audio. | 457 // This is considering 32 is large enough for multiple channels audio. |
473 // It is somewhat arbitrary and could be increased if necessary. | 458 // It is somewhat arbitrary and could be increased if necessary. |
474 enum { MaxNumberOfChannels = 32 }; | 459 enum { MaxNumberOfChannels = 32 }; |
475 | 460 |
476 unsigned m_contextId; | 461 unsigned m_contextId; |
477 }; | 462 }; |
478 | 463 |
479 } // namespace blink | 464 } // namespace blink |
480 | 465 |
481 #endif // AudioContext_h | 466 #endif // AudioContext_h |
OLD | NEW |