This MR changes es_format_t::i_extra from a signed int to size_t.
This variable is used to describe the size of the buffer pointed by
p_extra, and is never strictly negative.
Users of this member are also updated in this commit at once. I'm not
sure it's easy to split, except if callers are casted to size_t before
usage in a preparatory change, and then the cast is removed in a cleanup
change.
Some users were already using size_t though, like videotoolbox decoder
or hxxx_helpers.c. The main blocker for splitting is that most clients
not doing that are actually using pointers to i_extra instead of using a
copy, which is much more verbose to fix locally.
Almost No unneeded cast is added to fix signedness mismatch in this
patch. Most notably, only mpeg/ts_psi.c gets a new cast when using
__MIN() with fmt->i_extra, since the dvbpsi_descriptor_t::i_length
parameter is signed.
avformat/demux.c gets a temporary cast which is no-op with a version
libavutil >= 57 but which would trigger the warning before that. It may
be removed when libavutil < 57 is dropped.
We don't need to know it's a pointer and can save 2 characters.
No functional changes. This is simply renaming "dec->p_fmt_in",
"decoder->p_fmt_in", "dec.p_fmt_in" and "packetizer->p_fmt_in"
see e967f81f6a.
note, this does **not** affect cat-based module selection items
(of which there are just three in use by the core), since that
mechanism uses subcats not cats.
Currently, when encoding an ES category, the encoders had to check
whether they supported the ES category and return an error, forcing many
modules to be loaded and probed for nothing.
By splitting by ES category, we ensure that most encoder that would have
not supported the encoding anyway won't be probed. As a side effect, it
improves the documentation in the help output by only listing encoders
that will actually be able to encode the format, for instance in
aenc/venc/senc options in the transcode module. It will also provide a
better way for the UI to list the available encoders.
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>
Rename i_original_channels to i_chan_mode. For now, chan modes can be
DOLBYSTEREO or DUALMONO.
This new value, i_chan_mode, should only be set by demuxes/codecs/packetizers
if there is a special stereo mode to handle.
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.
Decoder modules are now responsible for calling decoder_UpdateAudioFormat()
before decoder_NewAudioBuffer().
In a lot of modules, decoder_UpdateAudioFormat() could be called in a better
place. Just after dec->fmt_out is updated for example.
For now, a lot of decoder/packetizer are also flushing on
BLOCK_FLAG_DISCONTINUITY flag. Some others are also flushing on
BLOCK_FLAG_CORRUPTED flag (omxil, videotoolbox, avcodec audio).
This patch doesn't change the current behavior.
But maybe we shouldn't flush anymore on DISCONTINUOUS/CORRUPTED.
If blocks are marked BLOCK_FLAG_DISCONTINUITY then do not drop them,
unless BLOCK_FLAGS_CORRUPTED is set. Instead flush old blocks from decoder
queue and restart at this new stream access point (new timeline).
Signed-off-by: Ilkka Ollakka <ileoo@videolan.org>
If no header is given, deduce it from the decoder format.
Tested for mono, stereo and with/without --codec avcodec at
8000, 12000, 16000, 24000 and 48000hz.