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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioNode.cpp

Issue 1361233004: Implement IIRFilter node for WebAudio. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test issue by printing fewer digits. Created 4 years, 11 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) 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 // AudioNodeInput::disable() where we want to disable outputs when there's o nly one connection 405 // AudioNodeInput::disable() where we want to disable outputs when there's o nly one connection
406 // left because we're ready to go away, but can't quite yet. 406 // left because we're ready to go away, but can't quite yet.
407 if (m_connectionRefCount <= 1 && !m_isDisabled) { 407 if (m_connectionRefCount <= 1 && !m_isDisabled) {
408 // Still may have JavaScript references, but no more "active" connection references, so put all of our outputs in a "dormant" disabled state. 408 // Still may have JavaScript references, but no more "active" connection references, so put all of our outputs in a "dormant" disabled state.
409 // Garbage collection may take a very long time after this time, so the "dormant" disabled nodes should not bog down the rendering... 409 // Garbage collection may take a very long time after this time, so the "dormant" disabled nodes should not bog down the rendering...
410 410
411 // As far as JavaScript is concerned, our outputs must still appear to b e connected. 411 // As far as JavaScript is concerned, our outputs must still appear to b e connected.
412 // But internally our outputs should be disabled from the inputs they're connected to. 412 // But internally our outputs should be disabled from the inputs they're connected to.
413 // disable() can recursively deref connections (and call disable()) down a whole chain of connected nodes. 413 // disable() can recursively deref connections (and call disable()) down a whole chain of connected nodes.
414 414
415 // TODO(rtoy,hongchan): we special case the convolver, delay, and biquad since they have a 415 // TODO(rtoy,hongchan): we need special cases the convolver, delay, biqu ad, and IIR since
416 // significant tail-time and shouldn't be disconnected simply because th ey no longer have 416 // they have a significant tail-time and shouldn't be disconnected simpl y because they no
417 // any input connections. This needs to be handled more generally where AudioNodes have a 417 // longer have any input connections. This needs to be handled more gene rally where
418 // tailTime attribute. Then the AudioNode only needs to remain "active" for tailTime seconds 418 // AudioNodes have a tailTime attribute. Then the AudioNode only needs t o remain "active"
419 // after there are no longer any active connections. 419 // for tailTime seconds after there are no longer any active connections .
420 if (nodeType() != NodeTypeConvolver 420 if (nodeType() != NodeTypeConvolver
421 && nodeType() != NodeTypeDelay 421 && nodeType() != NodeTypeDelay
422 && nodeType() != NodeTypeBiquadFilter) { 422 && nodeType() != NodeTypeBiquadFilter
423 && nodeType() != NodeTypeIIRFilter) {
423 m_isDisabled = true; 424 m_isDisabled = true;
424 clearInternalStateWhenDisabled(); 425 clearInternalStateWhenDisabled();
425 for (auto& output : m_outputs) 426 for (auto& output : m_outputs)
426 output->disable(); 427 output->disable();
427 } 428 }
428 } 429 }
429 } 430 }
430 431
431 void AudioHandler::makeConnection() 432 void AudioHandler::makeConnection()
432 { 433 {
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 void AudioNode::didAddOutput(unsigned numberOfOutputs) 934 void AudioNode::didAddOutput(unsigned numberOfOutputs)
934 { 935 {
935 m_connectedNodes.append(nullptr); 936 m_connectedNodes.append(nullptr);
936 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedNodes.size()); 937 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedNodes.size());
937 m_connectedParams.append(nullptr); 938 m_connectedParams.append(nullptr);
938 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedParams.size()); 939 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedParams.size());
939 } 940 }
940 941
941 } // namespace blink 942 } // namespace blink
942 943
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/AudioNode.h ('k') | third_party/WebKit/Source/modules/webaudio/IIRDSPKernel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698