In the next patches, when the AudioDriver will be implemented, the audio backend
thread (that we don't control), will return from the stack frame where the
nsTArray that allows the MSG thread to exchange message queues in a efficient
manner with the main thread. We put it in the MediaStreamGraph to avoid adding
an allocation/deallocation per iteration on the MSG thread.
In addition, the graph will be able to run on different threads during its
lifetime, so we can't guarantee a stable stack frame to allocate things on
anymore.
The array are renamed with meaningful names, explaining the double-buffering
pattern: the back queue is filled by the main thread, and is swapped with the
front queue that is processed by the MSG thread.
Arrays accesses are synchronized using the driver's monitor.
When "speex/speex_resampler.h" was included, another exported header (in
dist/include) would find the speex/speex_resampler.h in dist/include before
dist/system_wrappers. Visibility of undefined symbols depended on the order
of includes.
This patch changes includes to <speex/speex_resampler.h> so that
WRAP_SYSTEM_INCLUDES works as expected but removes the wrapper when not using
GKMEDIAS_SHARED_LIBRARY.
--HG--
extra : rebase_source : 93ca1dbdd6b489647624326e78539f44c60d0b34
UpdateStreamOrder is not called often because it's expensive (it's called only
when the graph topology changed), and it's earlier in the MSG loop than the
audio stream creation, so we need to tell the newly created AudioStream that a
microphone is active on creation as well.
The panning logic is also now triggered on stream start, because it is async.
This shouldn't be necessary, if clients do the right things, but provides some
safety, in case they don't.
--HG--
extra : rebase_source : e64d663c27f03eff35f538c205cd66d42420d9e4
The stream order is only important if there are connections, in which case
MediaInputPort::Disconnect() calls SetStreamOrderDirty().
MediaStreamGraphImpl::RemoveStream() also calls SetStreamOrderDirty(), which
ensures that mFirstCycleBreaker is updated when necessary.
--HG--
extra : rebase_source : b437f0d078a481725579456d91acc32353e1221a
Also reduce the number of ProcessedMediaStream* static_casts and use a new
variable name |removed| to emphasize what is happening.
--HG--
extra : rebase_source : 50b6c5e2d97a2e4ffbf9db993e1327de8c1d7b36
UpdateStreamOrder is not called often because it's expensive (it's called only
when the graph topology changed), and it's earlier in the MSG loop than the
audio stream creation, so we need to tell the newly created AudioStream that a
microphone is active on creation as well.
The panning logic is also now triggered on stream start, because it is async.
Previously downstream nodes from DelayNodes in cycles sometimes received stale
output from the previous MSG iteration.
Also, if two cycles share a common path, they will now *both* be treated as
cycles, either by muting or by enforcing minimum delay. Previously, marking
one cycle first could prevent detection of other cycles in the same SCC.
--HG--
extra : rebase_source : 82892c538c5ce514165b5f975474df15b99e3d2b
We could get away with 1 as an initial time when units were 1/(1<<20) seconds
but when graph time units are audio samples, an initial value of 1 will mean
that the first audio block produced has 1 frame fewer.
--HG--
extra : transplant_source : %FF%D5%AF%A9%C7%EA%C4%D7%ED%8F%CC%AC%E4%5E%FF%D0%87%8D%3AN
This may result in repeating a sample sometimes due to rounding effects, but
that should only happen once per unblocked sequence of track frames.
--HG--
extra : transplant_source : %0C%E9%A4jq%286%96%B1%A9%AE%9F%1Cr%DCK%8F%AF%92i
mLastTickWritten and offset are stream positions, which do not advance when
the stream is blocked.
--HG--
extra : transplant_source : %15%7B%E5%E9.%89%BC%1E%F8%92%FD%3D%CB%10%FC%AD%EAT%90-
MediaTimes are multiplied by sample rates when converting to ticks.
This new maximum leaves 24 bits to count seconds, which corresponds to 194
days.
TimeVarying::GetAt() can return INT64_MAX, which may be > GRAPH_TIME_MAX.
The "Start time too early" assertion would now fail because conversion of
STREAM_TIME_MAX to ticks no longer overflows.
--HG--
extra : rebase_source : b49c95315d0c633f191ff68aab0b5b7aa04c6e38