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 // TODO(rtoy,hongchan): we special case the convolver, delay, and biquad since they have a | 415 // TODO(rtoy,hongchan): we special case the convolver, delay, biquad, an d IIR since they |
hongchan
2015/10/09 18:10:00
'we special case...' - perhaps typo? It's not from
Raymond Toy
2015/10/09 19:41:15
Done. (I think.)
| |
416 // significant tail-time and shouldn't be disconnected simply because th ey no longer have | 416 // have a significant tail-time and shouldn't be disconnected simply bec ause they no longer |
417 // any input connections. This needs to be handled more generally where AudioNodes have a | 417 // have any input connections. This needs to be handled more generally w here AudioNodes have |
418 // tailTime attribute. Then the AudioNode only needs to remain "active" for tailTime seconds | 418 // a tailTime attribute. Then the AudioNode only needs to remain "active " for tailTime |
419 // after there are no longer any active connections. | 419 // 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
932 { | 933 { |
933 m_connectedNodes.append(nullptr); | 934 m_connectedNodes.append(nullptr); |
934 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedNodes.size()); | 935 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedNodes.size()); |
935 m_connectedParams.append(nullptr); | 936 m_connectedParams.append(nullptr); |
936 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedParams.size()); | 937 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedParams.size()); |
937 } | 938 } |
938 | 939 |
939 } // namespace blink | 940 } // namespace blink |
940 | 941 |
941 #endif // ENABLE(WEB_AUDIO) | 942 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |