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

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

Issue 645853010: Make reduction value of dynamics compressor zero when no sources are connected (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git/+/master
Patch Set: Created 6 years, 2 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 void AudioNode::initialize() 82 void AudioNode::initialize()
83 { 83 {
84 m_isInitialized = true; 84 m_isInitialized = true;
85 } 85 }
86 86
87 void AudioNode::uninitialize() 87 void AudioNode::uninitialize()
88 { 88 {
89 m_isInitialized = false; 89 m_isInitialized = false;
90 } 90 }
91 91
92 void AudioNode::clearInternalState()
93 {
94 }
95
92 void AudioNode::dispose() 96 void AudioNode::dispose()
93 { 97 {
94 ASSERT(isMainThread()); 98 ASSERT(isMainThread());
95 ASSERT(context()->isGraphOwner()); 99 ASSERT(context()->isGraphOwner());
96 100
97 context()->removeChangedChannelCountMode(this); 101 context()->removeChangedChannelCountMode(this);
98 context()->removeAutomaticPullNode(this); 102 context()->removeAutomaticPullNode(this);
99 context()->disposeOutputs(*this); 103 context()->disposeOutputs(*this);
100 for (unsigned i = 0; i < m_outputs.size(); ++i) 104 for (unsigned i = 0; i < m_outputs.size(); ++i)
101 output(i)->disconnectAll(); 105 output(i)->disconnectAll();
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // As far as JavaScript is concerned, our outputs must still appear to b e connected. 472 // As far as JavaScript is concerned, our outputs must still appear to b e connected.
469 // But internally our outputs should be disabled from the inputs they're connected to. 473 // But internally our outputs should be disabled from the inputs they're connected to.
470 // disable() can recursively deref connections (and call disable()) down a whole chain of connected nodes. 474 // disable() can recursively deref connections (and call disable()) down a whole chain of connected nodes.
471 475
472 // FIXME: we special case the convolver and delay since they have a sign ificant tail-time and shouldn't be disconnected simply 476 // FIXME: we special case the convolver and delay since they have a sign ificant tail-time and shouldn't be disconnected simply
473 // because they no longer have any input connections. This needs to be h andled more generally where AudioNodes have 477 // because they no longer have any input connections. This needs to be h andled more generally where AudioNodes have
474 // a tailTime attribute. Then the AudioNode only needs to remain "active " for tailTime seconds after there are no 478 // a tailTime attribute. Then the AudioNode only needs to remain "active " for tailTime seconds after there are no
475 // longer any active connections. 479 // longer any active connections.
476 if (nodeType() != NodeTypeConvolver && nodeType() != NodeTypeDelay) { 480 if (nodeType() != NodeTypeConvolver && nodeType() != NodeTypeDelay) {
477 m_isDisabled = true; 481 m_isDisabled = true;
482 // Resets internal states for future external data request. (i.e. Ga in reduction)
Raymond Toy 2014/10/21 20:47:57 I think I would remove this comment. The comment
hongchan 2014/10/21 20:58:53 Acknowledged.
483 if (nodeType() == NodeTypeDynamicsCompressor) {
Raymond Toy 2014/10/21 20:47:57 This if test isn't needed. Every node now has a c
hongchan 2014/10/21 20:58:53 I agree, but this was what we talked about it befo
484 clearInternalState();
485 }
478 for (unsigned i = 0; i < m_outputs.size(); ++i) 486 for (unsigned i = 0; i < m_outputs.size(); ++i)
479 output(i)->disable(); 487 output(i)->disable();
480 } 488 }
481 } 489 }
482 } 490 }
483 491
484 void AudioNode::makeConnection() 492 void AudioNode::makeConnection()
485 { 493 {
486 atomicIncrement(&m_connectionRefCount); 494 atomicIncrement(&m_connectionRefCount);
487 495
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 571
564 void AudioNode::updateChannelCountMode() 572 void AudioNode::updateChannelCountMode()
565 { 573 {
566 m_channelCountMode = m_newChannelCountMode; 574 m_channelCountMode = m_newChannelCountMode;
567 updateChannelsForInputs(); 575 updateChannelsForInputs();
568 } 576 }
569 577
570 } // namespace blink 578 } // namespace blink
571 579
572 #endif // ENABLE(WEB_AUDIO) 580 #endif // ENABLE(WEB_AUDIO)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698