This system was kind of janky anyway. It makes more sense ultimately for the
audio management classes to contain the file handle rather than the renderer.
As opposed to simply leaving all values in the table, nodes can now "take"
values that they use to free up memory (e.g. "taking" input buffers if they're
used to produce an output buffer).
This is a fairly large change, expect regressions.
The audio rendering system uses an event-based mechanism where if audio needs
to be converted (i.e. to a different sample rate), it will create a conform
task and re-render that section again when the audio is ready. Unfortunately,
the export code didn't respect this and would start encoding audio once the
initial queue was done. This usually resulted in silent audio, but could also
result in "uninitialized" audio that would crash any float-based encoders
(e.g. AAC). Now we use a different signal that only emits once the queue is done
AND all conforms are done.
Due to an oversight, incoming footage frames were NOT converted to the
working pixel format (usually half or float). For most frames, this meant the
OCIO conversion would occur on frames while they were still in their source
format (usually either RGB8 or RGB16). This leads to rounding error
inaccuracies, but even worse GLSL will clamp integer textures to 1.0 potentially
losing a lot of data.
While later nodes would correctly convert to the appropriate format, by then it
would be too late. This commit corrects this issue, converting the frames to
float during the OCIO shader pass.
While developing, we used a function that only exists in OpenImageIO 2.1.x+.
Fortunately however, it seems to have simply existed with a different name in
earlier versions so we can maintain compatibility with 1.6+.
While we implement an audio cache "truncate" function when the sequence length
changes, the render functions also have the ability to extend it. This is fine,
but if truncation happened while workers were caching, it could truncate and
then extend beyond the length of the sequence. This commit changes the worker
extend function to only extend as much as the length, therefore not undoing the
truncation.
Minor code path improvement. Since EncodeFrame() will try to stop the debug
timer if the encode is finished, it doesn't make sense to always start it
unconditionally after calling EncodeFrame().