• Clément Bœsch's avatar
    lavc: add lavfi metadata support. · 6fb2fd89
    Clément Bœsch authored
    This commit introduces a new AVPacket side data type:
    AV_PKT_DATA_STRINGS_METADATA. Its main goal is to provide a way to
    transmit the metadata from the AVFilterBufferRef up to the AVFrame. This
    is at the moment "only" useful for lavfi input from libavdevice:
    lavd/lavfi only outputs packets, and the metadata from the buffer ref
    kept in its context needs to be transmitted from the packet to the frame
    by the decoders. The buffer ref can be destroyed at any time (along with
    the metadata), and a duplication of the AVPacket needs to duplicate the
    metadata as well, so the choice of using the side data to store them was
    selected.
    
    Making sure lavd/lavfi raises the metadata is useful to allow tools like
    ffprobe to access the filters metadata (it is at the moment the only
    way); ffprobe will now automatically show the AVFrame metadata in any
    customizable output format for users. API users will also be able to
    access the AVFrame->metadata pointer the same way ffprobe does
    (av_frame_get_metadata).
    
    All the changes are done in this single commit to avoid some memory
    leaks: for instances, the changes in lavfi/avcodec.c are meant to
    duplicate the metadata from the buffer ref into the AVFrame. Unless we
    have an internal way of freeing the AVFrame->metadata automatically, it
    will leak in most of the user apps. To fix this problem, we introduce
    AVCodecContext->metadata and link avctx->metadata to the current
    frame->metadata and free it at each decode frame call (and in the codec
    closing callback for the last one). But doing this also means to update
    the way the tiff decoder already handles the AVFrame->metadata (it's the
    only one decoder with frame metadata at the moment), by making sure it
    is not trying to free a pointer already freed by the lavc internals.
    
    The lavfi/avcodec.c buffer ref code is based on an old Thomas Kühnel
    work, the rest of the code belongs to the commit author.
    Signed-off-by: 's avatarThomas Kühnel <kuehnelth@googlemail.com>
    Signed-off-by: 's avatarClément Bœsch <ubitux@gmail.com>
    6fb2fd89
Name
Last commit
Last update
..
doxy Loading commit data...
examples Loading commit data...
APIchanges Loading commit data...
Makefile Loading commit data...
RELEASE_NOTES Loading commit data...
avtools-common-opts.texi Loading commit data...
avutil.txt Loading commit data...
bitstream_filters.texi Loading commit data...
build_system.txt Loading commit data...
decoders.texi Loading commit data...
demuxers.texi Loading commit data...
developer.texi Loading commit data...
encoders.texi Loading commit data...
errno.txt Loading commit data...
eval.texi Loading commit data...
faq.texi Loading commit data...
fate.texi Loading commit data...
fate_config.sh.template Loading commit data...
ffmpeg.texi Loading commit data...
ffmpeg.txt Loading commit data...
ffplay.texi Loading commit data...
ffprobe.texi Loading commit data...
ffprobe.xsd Loading commit data...
ffserver.conf Loading commit data...
ffserver.texi Loading commit data...
filter_design.txt Loading commit data...
filters.texi Loading commit data...
general.texi Loading commit data...
git-howto.texi Loading commit data...
git-howto.txt Loading commit data...
indevs.texi Loading commit data...
issue_tracker.txt Loading commit data...
metadata.texi Loading commit data...
mips.txt Loading commit data...
multithreading.txt Loading commit data...
muxers.texi Loading commit data...
nut.texi Loading commit data...
optimization.txt Loading commit data...
outdevs.texi Loading commit data...
platform.texi Loading commit data...
print_options.c Loading commit data...
protocols.texi Loading commit data...
rate_distortion.txt Loading commit data...
snow.txt Loading commit data...
soc.txt Loading commit data...
swresample.txt Loading commit data...
swscale.txt Loading commit data...
syntax.texi Loading commit data...
t2h.init Loading commit data...
tablegen.txt Loading commit data...
texi2pod.pl Loading commit data...
viterbi.txt Loading commit data...