ffmpeg/libavdevice
Clément Bœsch 6fb2fd895e lavc: add lavfi metadata support.
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>
2012-10-21 17:29:10 +02:00
..
Makefile Merge remote-tracking branch 'qatar/master' 2012-07-29 02:16:26 +02:00
alldevices.c Merge remote-tracking branch 'qatar/master' 2012-07-29 02:16:26 +02:00
alsa-audio-common.c Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85' 2012-08-07 22:45:46 +02:00
alsa-audio-dec.c Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9' 2012-09-05 14:33:32 +02:00
alsa-audio-enc.c Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85' 2012-08-07 22:45:46 +02:00
alsa-audio.h Merge remote-tracking branch 'qatar/master' 2012-10-06 13:45:08 +02:00
avdevice.c Merge remote-tracking branch 'qatar/master' 2012-08-16 16:20:30 +02:00
avdevice.h Merge remote-tracking branch 'qatar/master' 2012-07-29 02:16:26 +02:00
bktr.c Merge commit '716d413c13981da15323c7a3821860536eefdbbb' 2012-10-08 21:06:57 +02:00
caca.c caca: fix 10l typo 2012-10-12 19:05:58 +02:00
dshow.c Merge commit '716d413c13981da15323c7a3821860536eefdbbb' 2012-10-08 21:06:57 +02:00
dshow_capture.h dshow: Change WINBOOL to BOOL 2012-09-07 22:23:32 +02:00
dshow_common.c
dshow_enummediatypes.c
dshow_enumpins.c
dshow_filter.c
dshow_pin.c dshow: Change WINBOOL to BOOL 2012-09-07 22:23:32 +02:00
dv1394.c Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9' 2012-09-05 14:33:32 +02:00
dv1394.h cosmetics: various spelling fixes 2012-07-06 17:08:22 +02:00
fbdev.c Merge remote-tracking branch 'qatar/master' 2012-10-12 17:21:01 +02:00
iec61883.c Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9' 2012-09-05 14:33:32 +02:00
jack_audio.c Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9' 2012-09-05 14:33:32 +02:00
lavfi.c lavc: add lavfi metadata support. 2012-10-21 17:29:10 +02:00
libavdevice.v
libcdio.c Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9' 2012-09-05 14:33:32 +02:00
libdc1394.c Merge commit '716d413c13981da15323c7a3821860536eefdbbb' 2012-10-08 21:06:57 +02:00
openal-dec.c Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9' 2012-09-05 14:33:32 +02:00
oss_audio.c Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9' 2012-09-05 14:33:32 +02:00
pulse.c Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9' 2012-09-05 14:33:32 +02:00
sdl.c Merge commit '716d413c13981da15323c7a3821860536eefdbbb' 2012-10-08 21:06:57 +02:00
sndio_common.c Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85' 2012-08-07 22:45:46 +02:00
sndio_common.h Merge remote-tracking branch 'qatar/master' 2012-10-06 13:45:08 +02:00
sndio_dec.c Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9' 2012-09-05 14:33:32 +02:00
sndio_enc.c Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85' 2012-08-07 22:45:46 +02:00
timefilter.c Merge remote-tracking branch 'qatar/master' 2012-10-08 13:11:11 +02:00
timefilter.h
v4l.c Merge commit '716d413c13981da15323c7a3821860536eefdbbb' 2012-10-08 21:06:57 +02:00
v4l2.c Merge commit '716d413c13981da15323c7a3821860536eefdbbb' 2012-10-08 21:06:57 +02:00
version.h Add missing version macros to libraries 2012-09-28 15:10:18 +02:00
vfwcap.c Merge commit '716d413c13981da15323c7a3821860536eefdbbb' 2012-10-08 21:06:57 +02:00
x11grab.c Merge commit '716d413c13981da15323c7a3821860536eefdbbb' 2012-10-08 21:06:57 +02:00