The ObtainInputBlock API is also changed to create an input block for one input
block at a time. An array of these input blocks is then sent to
ProduceAudioBlock for processing, which generates an array of AudioChunks as
output.
Backwards compatibilty with existing engines is achieved by keeping the
existing ProduceAudioBlock API for use with engines with only a maximum of one
input and output port.
These MediaStreams are used as a way to down-mix the input AudioChunks, and
also as a way to get proper stream processing ordering. The MediaStream for
the source AudioNode is an input to these streams, and these streams in turn
are inputs to the MediaStream that the AudioNode that owns the AudioParam owns.
This way, the Media Streams Graph processing code will order the streams so
that by the time that the MediaStream for a given node is processed, all of the
MediaStreams belonging to the AudioNode(s) feeding into the AudioParam have
been processed.
This has a tricky side-effect that those streams also being considered when
determining the input block for the AudioNodeStream belonging to the
AudioParam's owner AudioNode. In order to fix that, we simply special case
those streams and make AudioNodeStream::ObtainInputBlock ignore them.
We need this in order to update the MediaStreamGraph thread when an
AudioParam changes. This enables each AudioParam to be registered with
a callback from its owner node, so that the owner node can have custom
processing code for each AudioParam's mutation.
We need this in order to update the MediaStreamGraph thread when an
AudioParam changes. This enables each AudioParam to be registered with
a callback from its owner node, so that the owner node can have custom
processing code for each AudioParam's mutation.
This patch implements most of the semantics of AudioParam in a
templatized base class called AudioEventTimeline. This is done in order
to make it possible to test this code from C++ without the need of
linking to libxul. Basically we take everything that could depend on
libxul or is not suitable for a genertic implementation and put it in a
traits like type as a template argument. Then the test creates mock
objects that conform to the argument interfaces, and tests the logic of
AudioEventTimeline.