bug 1205540 provide querying whether engines need to continue processing even without input r=padenot

--HG--
extra : rebase_source : 08dfd9685c49b93a9ca113434f62d92de26f58e7
This commit is contained in:
Karl Tomlinson 2015-09-09 08:54:03 +12:00
Родитель 7e9bfa19a5
Коммит 57f288f403
10 изменённых файлов: 69 добавлений и 0 удалений

Просмотреть файл

@ -83,6 +83,11 @@ public:
NS_DispatchToMainThread(transfer);
}
virtual bool IsActive() const override
{
return mChunksToProcess != 0;
}
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);

Просмотреть файл

@ -508,6 +508,12 @@ public:
}
}
virtual bool IsActive() const override
{
// Whether buffer has been set and start() has been called.
return mBufferSampleRate != 0;
}
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
// Not owned:

Просмотреть файл

@ -112,6 +112,14 @@ public:
}
}
virtual bool IsActive() const override
{
// Keep processing to track stream time, which is used for all timelines
// associated with the same AudioContext.
return true;
}
class OnCompleteTask final : public nsRunnable
{
public:
@ -255,6 +263,16 @@ public:
}
}
virtual bool IsActive() const override
{
// Keep processing to track stream time, which is used for all timelines
// associated with the same AudioContext. If there are no other engines
// for the AudioContext, then this could return false to suspend the
// stream, but the stream is blocked anyway through
// AudioDestinationNode::SetIsOnlyNodeForContext().
return true;
}
virtual void SetDoubleParameter(uint32_t aIndex, double aParam) override
{
if (aIndex == VOLUME) {

Просмотреть файл

@ -346,6 +346,12 @@ public:
OutputChunks& aOutput,
bool* aFinished);
// IsActive() returns true if the engine needs to continue processing an
// unfinished stream even when it has silent or no input connections. This
// includes tail-times and when sources have been scheduled to start. If
// returning false, then the stream can be suspended.
virtual bool IsActive() const { return false; }
bool HasNode() const
{
MOZ_ASSERT(NS_IsMainThread());

Просмотреть файл

@ -211,6 +211,11 @@ public:
}
}
virtual bool IsActive() const override
{
return !mBiquads.IsEmpty();
}
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
// Not owned:

Просмотреть файл

@ -154,6 +154,11 @@ public:
mReverb->process(&input, aOutput, WEBAUDIO_BLOCK_SIZE);
}
virtual bool IsActive() const override
{
return mLeftOverData != INT32_MIN;
}
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);

Просмотреть файл

@ -161,6 +161,11 @@ public:
mHaveProducedBeforeInput = true;
}
virtual bool IsActive() const override
{
return mLeftOverData != INT32_MIN;
}
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);

Просмотреть файл

@ -330,6 +330,12 @@ public:
}
virtual bool IsActive() const override
{
// start() has been called.
return mStart != -1;
}
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);

Просмотреть файл

@ -172,6 +172,11 @@ public:
(this->*mPanningModelFunction)(aInput, aOutput);
}
virtual bool IsActive() const override
{
return mLeftOverData != INT_MIN;
}
void ComputeAzimuthAndElevation(float& aAzimuth, float& aElevation);
float ComputeConeGain();
// Compute how much the distance contributes to the gain reduction.

Просмотреть файл

@ -333,6 +333,14 @@ public:
}
}
virtual bool IsActive() const override
{
// Could return false when !mIsConnected after all output chunks produced
// by main thread events calling
// SharedBuffers::FinishProducingOutputBuffer() have been processed.
return true;
}
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
// Not owned: