Bug 1558123 Pass spans to ProcessBlocksOnPorts to facilitate forwarding from ProcessBlock() r=padenot

It is easier to make a span than an nsTArray.

This also clarifies that the output array lengths are not modified.

Depends on D34833

Differential Revision: https://phabricator.services.mozilla.com/D34834

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2019-06-14 16:06:22 +00:00
Родитель 2f7457ad55
Коммит 442e4282a1
5 изменённых файлов: 15 добавлений и 6 удалений

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

@ -382,8 +382,8 @@ void AudioNodeEngine::ProcessBlock(AudioNodeStream* aStream, GraphTime aFrom,
}
void AudioNodeEngine::ProcessBlocksOnPorts(AudioNodeStream* aStream,
const OutputChunks& aInput,
OutputChunks& aOutput,
Span<const AudioBlock> aInput,
Span<AudioBlock> aOutput,
bool* aFinished) {
MOZ_ASSERT(mInputCount > 1 || mOutputCount > 1);
// Only produce one output port, and drop all other input ports.

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

@ -324,8 +324,8 @@ class AudioNodeEngine {
* of silence.
*/
virtual void ProcessBlocksOnPorts(AudioNodeStream* aStream,
const OutputChunks& aInput,
OutputChunks& aOutput, bool* aFinished);
Span<const AudioBlock> aInput,
Span<AudioBlock> 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

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

@ -25,6 +25,13 @@ class WorkletNodeEngine final : public AudioNodeEngine {
AudioWorkletImpl* aWorkletImpl, const nsAString& aName,
NotNull<StructuredCloneHolder*> aOptionsSerialization);
void ProcessBlock(AudioNodeStream* aStream, GraphTime aFrom,
const AudioBlock& aInput, AudioBlock* aOutput,
bool* aFinished) override {
ProcessBlocksOnPorts(aStream, MakeSpan(&aInput, 1), MakeSpan(aOutput, 1),
aFinished);
}
void NotifyForcedShutdown() override { ReleaseJSResources(); }
private:

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

@ -20,7 +20,8 @@ class ChannelMergerNodeEngine final : public AudioNodeEngine {
}
void ProcessBlocksOnPorts(AudioNodeStream* aStream,
const OutputChunks& aInput, OutputChunks& aOutput,
Span<const AudioBlock> aInput,
Span<AudioBlock> aOutput,
bool* aFinished) override {
MOZ_ASSERT(aInput.Length() == InputCount());
MOZ_ASSERT(aOutput.Length() == 1, "Should have only one output port");

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

@ -20,7 +20,8 @@ class ChannelSplitterNodeEngine final : public AudioNodeEngine {
}
void ProcessBlocksOnPorts(AudioNodeStream* aStream,
const OutputChunks& aInput, OutputChunks& aOutput,
Span<const AudioBlock> aInput,
Span<AudioBlock> aOutput,
bool* aFinished) override {
MOZ_ASSERT(aInput.Length() == 1, "Should only have one input port");
MOZ_ASSERT(aOutput.Length() == OutputCount());