It will be passed to the first filter when it's created.
It is only set when calling filter_chain_Reset() and no filter has been added yet.
We should not be using the filter chain unless filter_chain_Reset() has been called.
The input context pushed by the decoder (and soon by the preceding filter in chain).
The output context is similar to the output video video context set by the decoder.
The filter should hold a reference to the output video context and release it
when it doesn't need it anymore.
Typically used when a CPU to GPU converter is used. It cannot deduce the decoder
device or the video context from the input. Since we are pushing the video
context we don't want to get it from the output/environment either.
When the callback is not provided, a NULL decoder device is returned.
Blend video filters use the pf_video_blend() callback, not to be confused with
video filters using the pf_video_filter() callback and which can be chained.
filter_chain_Reset is reserved for restating new input/output formats and does
not allow empty format anymore.
filter_chain_Clear doesn't change the input/output formats, only remove all the
filters.
pf_audio_flush will flush/reset the state of an audio filter.
pf_audio_drain will drain an audio filter, it'll returns a block_t containing
the drained output.
The current workflow is often parsing a subtitle format, then convert it
in a common HTML and then push it to the renderer as HTML. The renderer
will reparse the HTML and try to render it. Of course, that means that
only one renderer can do that correctly, and so we bloat the freetype
renderer as much as we can.
It also means that we have 2 render callbacks for subtitles, one for
normal text and one for styled text, and we sometimes reparse the HTML
to remove the tags, for the first.
We now only use a text_segment, with new segments at every style change;
an unique render function and the renderer can decide to honor or not
the style.
It's a big commit, so regressions can arise, but it was tested for most
common cases.
All variants of the filter_t.video.buffer_del callback invoke
picture_Release() - possibly through recursion.
Most filters used picture_Release() directly already.
Also remove the filter chain buffer functions update hack, keep constant
callbacks for video filters in the filter chain, remove now useless
parameters from filter_chain_New(), and inline
filter_chain_AppendFilterInternal().