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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // FIXME: we special case the convolver and delay since they have a sign ificant tail-time and shouldn't be disconnected simply | 415 // FIXME: we special case the convolver, delay, and biquad since they ha ve a significant |
hongchan
2015/08/17 20:25:40
While we're at this, it would be better for us to
Raymond Toy
2015/08/17 20:44:59
Done.
| |
416 // because they no longer have any input connections. This needs to be h andled more generally where AudioNodes have | 416 // tail-time and shouldn't be disconnected simply because they no longer have any input |
417 // a tailTime attribute. Then the AudioNode only needs to remain "active " for tailTime seconds after there are no | 417 // connections. This needs to be handled more generally where AudioNodes have a tailTime |
418 // longer any active connections. | 418 // attribute. Then the AudioNode only needs to remain "active" for tailT ime seconds after |
419 if (nodeType() != NodeTypeConvolver && nodeType() != NodeTypeDelay) { | 419 // there are no longer any active connections. |
420 if (nodeType() != NodeTypeConvolver | |
421 && nodeType() != NodeTypeDelay | |
422 && nodeType() != NodeTypeBiquadFilter) { | |
420 m_isDisabled = true; | 423 m_isDisabled = true; |
421 clearInternalStateWhenDisabled(); | 424 clearInternalStateWhenDisabled(); |
422 for (auto& output : m_outputs) | 425 for (auto& output : m_outputs) |
423 output->disable(); | 426 output->disable(); |
424 } | 427 } |
425 } | 428 } |
426 } | 429 } |
427 | 430 |
428 void AudioHandler::makeConnection() | 431 void AudioHandler::makeConnection() |
429 { | 432 { |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
929 { | 932 { |
930 m_connectedNodes.append(nullptr); | 933 m_connectedNodes.append(nullptr); |
931 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedNodes.size()); | 934 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedNodes.size()); |
932 m_connectedParams.append(nullptr); | 935 m_connectedParams.append(nullptr); |
933 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedParams.size()); | 936 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedParams.size()); |
934 } | 937 } |
935 | 938 |
936 } // namespace blink | 939 } // namespace blink |
937 | 940 |
938 #endif // ENABLE(WEB_AUDIO) | 941 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |