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: Thomas Kühnel <kuehnelth@googlemail.com>
Signed-off-by: Clément Bœsch <ubitux@gmail.com>
* qatar/master:
Fix even more missing includes after the common.h removal
build: Factor out rangecoder dependencies to CONFIG_RANGECODER
build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
x86: avcodec: Consistently name all init files
Add more missing includes after removing the implicit common.h
Add some more missing includes after removing the implicit common.h
Don't include common.h from avutil.h
rtmp: Automatically compute the hash for SWFVerification
Conflicts:
configure
doc/APIchanges
doc/examples/decoding_encoding.c
libavcodec/Makefile
libavcodec/assdec.c
libavcodec/audio_frame_queue.c
libavcodec/avpacket.c
libavcodec/dv_profile.c
libavcodec/dwt.c
libavcodec/libtheoraenc.c
libavcodec/rawdec.c
libavcodec/rv40dsp.c
libavcodec/tiff.c
libavcodec/tiffenc.c
libavcodec/v210dec.h
libavcodec/vc1dsp.c
libavcodec/x86/Makefile
libavfilter/asrc_anullsrc.c
libavfilter/avfilter.c
libavfilter/buffer.c
libavfilter/formats.c
libavfilter/vf_ass.c
libavfilter/vf_drawtext.c
libavfilter/vf_fade.c
libavfilter/vf_select.c
libavfilter/video.c
libavfilter/vsrc_testsrc.c
libavformat/version.h
libavutil/audioconvert.c
libavutil/error.h
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
avcodec.c is where it is defined the lavc/lavfi interface code, so seems
a more adequate location (and doesn't force the inclusion of
libavcodec/avcodec.h where it is not required).
git blame:
75 Anton Khirnov
72 Michael Niedermayer
39 Stefano Sabatini
23 S.N. Hemanth Meenakshisundaram
9 Vitor Sessak
6 Robert Nagy
2 Diego Biurrun
1 Andrey Utkin
Note:
commit ab165047a6
Author: Anton Khirnov <anton@khirnov.net>
Date: Fri Apr 27 17:27:40 2012 +0200
lavfi: add a function for copying properties from AVFilterBufferRef->AVFrame
Based on a commit by Stefano Sabatini <stefano.sabatini-lala@poste.it>
commit 4a1ac8c43f
Author: Anton Khirnov <anton@khirnov.net>
Date: Thu May 10 07:58:11 2012 +0200
lavfi: move buffer management function to a separate file.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master: (26 commits)
fate: use diff -b in oneline comparison
Add missing version bumps and APIchanges/Changelog entries.
lavfi: move buffer management function to a separate file.
lavfi: move formats-related functions from default.c to formats.c
lavfi: move video-related functions to a separate file.
fate: make smjpeg a demux test
fate: separate sierra-vmd audio and video tests
fate: separate smacker audio and video tests
libmp3lame: set supported channel layouts.
avconv: automatically insert asyncts when -async is used.
avconv: add support for audio filters.
lavfi: add asyncts filter.
lavfi: add aformat filter
lavfi: add an audio buffer sink.
lavfi: add an audio buffer source.
buffersrc: add av_buffersrc_write_frame().
buffersrc: fix invalid read in uninit if the fifo hasn't been allocated
lavfi: rename vsrc_buffer.c to buffersrc.c
avfiltergraph: reindent
lavfi: add channel layout/sample rate negotiation.
...
Conflicts:
Changelog
doc/APIchanges
doc/filters.texi
ffmpeg.c
ffprobe.c
libavcodec/libmp3lame.c
libavfilter/Makefile
libavfilter/af_aformat.c
libavfilter/allfilters.c
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/avfiltergraph.c
libavfilter/buffersrc.c
libavfilter/defaults.c
libavfilter/formats.c
libavfilter/src_buffer.c
libavfilter/version.h
libavfilter/vf_yadif.c
libavfilter/vsrc_buffer.c
libavfilter/vsrc_buffer.h
libavutil/avutil.h
tests/fate/audio.mak
tests/fate/demux.mak
tests/fate/video.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>