зеркало из https://github.com/mozilla/gecko-dev.git
b=923301 remove now-unnecessary AcceptPlayingRefRelease r=roc
--HG-- extra : transplant_source : %7B%21%18%B17%16%7B%9E%9F%B3%23%17%FD%3DZ%FC%5C%0F%D3%8C
This commit is contained in:
Родитель
1c5f0e79ec
Коммит
c9bdef52d5
|
@ -176,7 +176,6 @@ AudioNode::Connect(AudioNode& aDestination, uint32_t aOutput,
|
|||
ps->AllocateInputPort(mStream, MediaInputPort::FLAG_BLOCK_INPUT,
|
||||
static_cast<uint16_t>(aInput),
|
||||
static_cast<uint16_t>(aOutput));
|
||||
aDestination.NotifyInputConnected();
|
||||
}
|
||||
|
||||
// This connection may have connected a panner and a source.
|
||||
|
|
|
@ -199,8 +199,6 @@ public:
|
|||
|
||||
void RemoveOutputParam(AudioParam* aParam);
|
||||
|
||||
virtual void NotifyInputConnected() {}
|
||||
|
||||
// MarkActive() asks the context to keep the AudioNode alive until the
|
||||
// context is finished. This takes care of "playing" references and
|
||||
// "tail-time" references.
|
||||
|
|
|
@ -126,9 +126,7 @@ public:
|
|||
mLeftOverData -= WEBAUDIO_BLOCK_SIZE;
|
||||
if (mLeftOverData <= 0) {
|
||||
// Note: this keeps spamming the main thread with messages as long
|
||||
// as there is nothing to play. This isn't great, but it avoids
|
||||
// problems with some messages being ignored when they're rejected by
|
||||
// ConvolverNode::AcceptPlayingRefRelease.
|
||||
// as there is nothing to play. This isn't great.
|
||||
mLeftOverData = 0;
|
||||
nsRefPtr<PlayingRefChanged> refchanged =
|
||||
new PlayingRefChanged(aStream, PlayingRefChanged::RELEASE);
|
||||
|
@ -175,7 +173,6 @@ ConvolverNode::ConvolverNode(AudioContext* aContext)
|
|||
2,
|
||||
ChannelCountMode::Clamped_max,
|
||||
ChannelInterpretation::Speakers)
|
||||
, mMediaStreamGraphUpdateIndexAtLastInputConnection(0)
|
||||
, mNormalize(true)
|
||||
{
|
||||
ConvolverNodeEngine* engine = new ConvolverNodeEngine(this, mNormalize);
|
||||
|
|
|
@ -56,21 +56,8 @@ public:
|
|||
}
|
||||
AudioNode::SetChannelCountModeValue(aMode, aRv);
|
||||
}
|
||||
virtual void NotifyInputConnected() MOZ_OVERRIDE
|
||||
{
|
||||
mMediaStreamGraphUpdateIndexAtLastInputConnection =
|
||||
mStream->Graph()->GetCurrentGraphUpdateIndex();
|
||||
}
|
||||
bool AcceptPlayingRefRelease(int64_t aLastGraphUpdateIndexProcessed) const
|
||||
{
|
||||
// Reject any requests to release the playing ref if the request was issued
|
||||
// before the MediaStreamGraph was aware of the most-recently-added input
|
||||
// connection.
|
||||
return aLastGraphUpdateIndexProcessed >= mMediaStreamGraphUpdateIndexAtLastInputConnection;
|
||||
}
|
||||
|
||||
private:
|
||||
int64_t mMediaStreamGraphUpdateIndexAtLastInputConnection;
|
||||
nsRefPtr<AudioBuffer> mBuffer;
|
||||
bool mNormalize;
|
||||
};
|
||||
|
|
|
@ -95,8 +95,7 @@ public:
|
|||
} else if (mLeftOverData != INT32_MIN) {
|
||||
if (mLeftOverData <= 0) {
|
||||
// Continue spamming the main thread with messages until we are destroyed.
|
||||
// This isn't great, but it ensures a message will get through even if
|
||||
// some are ignored by DelayNode::AcceptPlayingRefRelease
|
||||
// This isn't great.
|
||||
mLeftOverData = 0;
|
||||
playedBackAllLeftOvers = true;
|
||||
|
||||
|
@ -173,7 +172,6 @@ DelayNode::DelayNode(AudioContext* aContext, double aMaxDelay)
|
|||
2,
|
||||
ChannelCountMode::Max,
|
||||
ChannelInterpretation::Speakers)
|
||||
, mMediaStreamGraphUpdateIndexAtLastInputConnection(0)
|
||||
, mDelay(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
|
||||
SendDelayToStream, 0.0f))
|
||||
{
|
||||
|
|
|
@ -37,25 +37,11 @@ public:
|
|||
return this;
|
||||
}
|
||||
|
||||
virtual void NotifyInputConnected() MOZ_OVERRIDE
|
||||
{
|
||||
mMediaStreamGraphUpdateIndexAtLastInputConnection =
|
||||
mStream->Graph()->GetCurrentGraphUpdateIndex();
|
||||
}
|
||||
bool AcceptPlayingRefRelease(int64_t aLastGraphUpdateIndexProcessed) const
|
||||
{
|
||||
// Reject any requests to release the playing ref if the request was issued
|
||||
// before the MediaStreamGraph was aware of the most-recently-added input
|
||||
// connection.
|
||||
return aLastGraphUpdateIndexProcessed >= mMediaStreamGraphUpdateIndexAtLastInputConnection;
|
||||
}
|
||||
|
||||
private:
|
||||
static void SendDelayToStream(AudioNode* aNode);
|
||||
friend class DelayNodeEngine;
|
||||
|
||||
private:
|
||||
int64_t mMediaStreamGraphUpdateIndexAtLastInputConnection;
|
||||
nsRefPtr<AudioParam> mDelay;
|
||||
};
|
||||
|
||||
|
|
|
@ -19,8 +19,7 @@ class PlayingRefChangeHandler : public nsRunnable
|
|||
public:
|
||||
enum ChangeType { ADDREF, RELEASE };
|
||||
PlayingRefChangeHandler(AudioNodeStream* aStream, ChangeType aChange)
|
||||
: mLastProcessedGraphUpdateIndex(aStream->GetProcessingGraphUpdateIndex())
|
||||
, mStream(aStream)
|
||||
: mStream(aStream)
|
||||
, mChange(aChange)
|
||||
{
|
||||
}
|
||||
|
@ -39,8 +38,7 @@ public:
|
|||
if (node) {
|
||||
if (mChange == ADDREF) {
|
||||
node->MarkActive();
|
||||
} else if (mChange == RELEASE &&
|
||||
node->AcceptPlayingRefRelease(mLastProcessedGraphUpdateIndex)) {
|
||||
} else if (mChange == RELEASE) {
|
||||
node->MarkInactive();
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +46,6 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
int64_t mLastProcessedGraphUpdateIndex;
|
||||
nsRefPtr<AudioNodeStream> mStream;
|
||||
ChangeType mChange;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче