Remove the sout_stream_id_sys_t typedef in vlc_common.h (for ODR).
This implies to replace sout_stream_id_sys_t* by void* in the
sout_stream_t functions.
See #17078 and #18033
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Do not declare *_sys_t typedefs globally in vlc_common.h. Instead,
declare them locally in each module that provides a definition.
This paves the way to move C++ definitions into anonymous namespaces in
order to respect C++ ODR.
The picture_resource_t and sout_stream_id_sys_t typedefs will be handled
separately, since they require specific additional changes.
See #18033
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Since the decoder fmt_out can be updated from any threads with async decoders.
PS: As audio output blocks are not linked with a audio_format_t, it's still not
possible to know the real fmt of an audio output block if the format changed.
dec->fmt_out can be written from any thread by the decoder module. It's only
safe to access it without any lock from the pf_vout_format_update() callback.
In order to fetch the last video_format_t from the decoder, we use the one from
decoded pictures (that are created from dec->fmt_out.video from the same thread
than pf_vout_format_update()).
Note for conversion_video_filter_append():
We feed to the video converter chain a new fmt created from the pic
video_format_t instead of the original dec->fmt_out. Normally, video filters
only use fmt*.video
Use only one callback for every decoder types:
int (*pf_decode)(decoder_t *, block_t *p_block);
There is now only one way to send output frames/blocks from a decoder module:
using decoder_QueueVideo(), decoder_QueueAudio() and decoder_QueueSub()
functions.
This fixes transcoding not receiving any output when a decoder used
decoder_Queue*() function.
The pf_packetize callback is kept unchanged. A packetizer shouldn't be
asynchronous at all (and this simplify the locking for decoder core).
The pf_decode callback returns, for now, only one value: SUCCESS. This will
allow a module to send more status.
The deinterlace module string is meaningless if deinterlacing is
disabled, and must be set if deinterlacing is enabled. So compare it
to NULL to indicate if deinterlacing is enabled or is not.
Also name it to be next_input_pts instead of interpolated_pts
If input drift is more than 100ms that we estimate, we have most
likely dropped some packet and we should reset timers. Otherwise
it can cause lipsync issues if we for example just transcode video
track and audio track keeps original (jumped) pts.
Add some comments on how the code should work. Basic idea is first
check input lipsync against audio track. Then check if we can drop the
picture based on output pts and then do same checked in OutputFrame as
some filters can output multiple pictures (yadif2x etc).
simple framerate conversion from 25 worked to 4,5,10,20,23,29.97,50.60.
Not sure if yadif2x and all work fully yet.
The PICTURE_RING_BUFFER used a fixed size, which when running out of available pictures
produces visible artefacts in the encoded stream. Allocating a new picture and keeping
track of them in a fifo is much simpler (in the multiple threads encoding scenario) and
solves the ring buffer overrun.
I have merged spu_RenderSubpictures and spu_SortSubpictures and removed the
blending from spu_RenderSubpictures. No functionnal changes except maybe
a bit for the transcode plugin.
Fixes issue for me when doing transcode{}:gather: --sout-keep and subtitle
overlaying from dvbs. Otherwise keeps last subtitles on video if new channel
doesn't contain dvbs track.
also consistenty as spu_Create is called on transcode_spu_new()