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_UpdateVideoFormat()
before decoder_NewPicture().
In a lot of modules, decoder_UpdateVideoFormat() 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>
The variable len is a raw 32 bit value read using GetDWBE. If this
value is larger than UINT32_MAX - sizeof(eos), this will cause an
integer overflow in the subsequent call to malloc, and finally a
buffer overflow when calling memcpy. We fix this by checking len
accordingly.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Re-license almost all the playback modules to LGPLv2.1+ with
authorization from their respective contributors (230+)
This includes:
- access, codec, packetizers, demux
- audio filters, audio mixers, audio output
- video filters, video chroma, video output
- text renderers
- XML parser
- ARM NEON and SSE2 optimisations (mostly for chromas and filters)
Some modules are not concerned:
- BDA and DShow access modules because Manol Manolov is AWOL
- Real RTSP, because it is derived from Xine
- x264 and t140 because they are encoders only
- DLL Loader, because it is derived from MPlayer
- DTS packetizer, because Jon Lech Johansen is AWOL
- Shine and WMAfixed, because they are derived from Rockbox
- Real demuxer, as it is derived from MPlayer and Wang Bo is AWOL
- MPC demuxer, as Yavor Doganov is AWOL
- Tivo demuxer, because it is derived from an MPlayer fork
- Playlist demuxer, (WPL and ZPL parts missing), because suheaven is AWOL
- iOS audio output and video display, because author refuses the license change
- Equalizer and compressor, because Ronald Wright is AWOL
- Mono, Headphone and Dolby, because author refuses the license change
- hqdn3d and yadif, because they are from MPlayer/libavfilter
- remoteosd, because it derives from RealVNC code
- MMX optimisations, because Ollie Lho, from SiS, is AWOL
- Rotate, because it depends on GPL motion
Nota Bene:
- Some modules depend on GPL-only libraries, a LGPL module does not mean
that the resulting binary module will be LGPL.
Libraries affected would include liba52, libdvdcss, libdvdnav, libdvdread,
faad2, libdca, libmad, libmpeg2, libpostproc, SRC, sid, zvbi and probably others.
The configuration system cannot store both a static list and a dynamic
one (and AFAIK, it never could). It only makes to use either a static
list or a callback.
Hand-crafted code in plugin descriptor is not allowed. And the code was
unsurprisingly buggy.
This reverts commit 1c2a95b85e.
Conflicts:
modules/codec/schroedinger.c
On such flag, the bitstream before and after it are not related at all and
so are the timestamp. In order to not confuse the core, do not output
wrong timestamps.
timestamp will be interpolated at output of decoder instead.
Signed-off-by: David Flynn <davidf@rd.bbc.co.uk>
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
For SD, this should allow removal of black bars form the edge of frames.
i_aspect is set to the aspect ratio of the whole frame which may be
greater than that of the clean area. VLC should then calculate the SAR,
and eventually display a clean area sized picture that is of the correct
aspect ratio.
NB, we do actually know the SAR, but it isn't known if vlc cares at this
point.
Signed-off-by: David Flynn <davidf@rd.bbc.co.uk>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
The packetizer does a far more thorough job of handling the different
timestamp representations used by vlc
Signed-off-by: David Flynn <davidf@rd.bbc.co.uk>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Schroedinger now has an api that allows passing in arbitarily aligned
data units (ie, whole encapsuation units), use this rather than attempt
to chunk up the bitstream ourselves.
This new api also enables buffer tagging, where buffers may be tagged
with arbitary data that gets associated with the next picture to
commence at or after the start of the buffer. This removes the need
for the TLBs and associated accounting.
Signed-off-by: David Flynn <davidf@rd.bbc.co.uk>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
It is more reliable to interpolate pts at the output of the decoder
than to use dts.
This requires demuxers that only provide dts (such as avi) to provide
an initial value of pts so that the decoder may interpolate correctly.
Properly return pictures obtained from vout when they won't get
returned via the normal decodeBlock path.
- Fixes lockup when seeking.
- Maybe fixes win32 end of file fault.
Signed-off-by: David Flynn <davidf@woaf.net>
Signed-off-by: Derk-Jan Hartman <hartman@videolan.org>