Since lavfi works natively with AVFrame now, these functions are no longer
necessary and can be removed in a future bump.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
more than 8 channels is not supported and crashes with null pointer dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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>
* commit '6d0beefbf6ee6dbf8efb522a9307e54c6ed5f702':
swscale: Do not make ff_ symbols globally visible.
rtspdec: use av_strlcpy for writing into fixed size buffer
g722enc: fix size argument in memset
http: use av_strlcpy instead of strcpy() without size checks
avfilter: correct memcpy size avfilter_copy_buf_props()
lavc: split asv12 encoder/decoder
Conflicts:
libavcodec/asvdec.c
libavfilter/buffer.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Deprecate functions:
avfilter_fill_frame_from_buffer_ref
avfilter_fill_frame_from_audio_buffer_ref
avfilter_fill_frame_from_video_buffer_ref
and schedule to drop them at the next API major bump.
The function avfilter_copy_buf_props() should be used instead.
Use av_frame_* accessors for the newly added fields in AVFrame (for which
we are supposed to use such accessors), and group the istructions
accordingly.
The function will abort through an assert if the source is not defined,
or if the internal state of the source is inconsistent (e.g. type = AUDIO
&& !src->audio).
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:
45 Stefano Sabatini
23 Clément Bœsch
4 Michael Niedermayer
3 Robert Nagy
3 Nicolas George
2 Roger Pau Monné
Initial commit:
commit 566666caf3
Author: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Date: Sun May 1 14:47:05 2011 +0200
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>
* qatar/master: (27 commits)
libxvid: Give more suitable names to libxvid-related files.
libxvid: Separate libxvid encoder from libxvid rate control code.
jpeglsdec: Remove write-only variable in ff_jpegls_decode_lse().
fate: cosmetics: lowercase some comments
fate: Give more consistent names to some RealVideo/RealAudio tests.
lavfi: add avfilter_get_audio_buffer_ref_from_arrays().
lavfi: add extended_data to AVFilterBuffer.
lavc: check that extended_data is properly set in avcodec_encode_audio2().
lavc: pad last audio frame with silence when needed.
samplefmt: add a function for filling a buffer with silence.
samplefmt: add a function for copying audio samples.
lavr: do not try to copy to uninitialized output audio data.
lavr: make avresample_read() with NULL output discard samples.
fate: split idroq audio and video into separate tests
fate: improve dependencies
fate: add convenient shorthands for ea-vp6, libavcodec, libavutil tests
fate: split some combined tests into separate audio and video tests
fate: fix dependencies for probe tests
mips: intreadwrite: fix inline asm for gcc 4.8
mips: intreadwrite: remove unnecessary inline asm
...
Conflicts:
cmdutils.h
configure
doc/APIchanges
doc/filters.texi
ffmpeg.c
ffplay.c
libavcodec/internal.h
libavcodec/jpeglsdec.c
libavcodec/libschroedingerdec.c
libavcodec/libxvid.c
libavcodec/libxvid_rc.c
libavcodec/utils.c
libavcodec/version.h
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/buffersink.h
tests/Makefile
tests/fate/aac.mak
tests/fate/audio.mak
tests/fate/demux.mak
tests/fate/ea.mak
tests/fate/image.mak
tests/fate/libavutil.mak
tests/fate/lossless-audio.mak
tests/fate/lossless-video.mak
tests/fate/microsoft.mak
tests/fate/qt.mak
tests/fate/real.mak
tests/fate/screen.mak
tests/fate/video.mak
tests/fate/voice.mak
tests/fate/vqf.mak
tests/ref/fate/ea-mad
tests/ref/fate/ea-tqi
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
libschroedinger: Switch to function names more in line with Libav style.
Move code shared between libdirac and libschroedinger to libschroedinger.
lavfi: uninline avfilter_copy_buffer_ref_props().
lavf: add missing '*' in a doxy.
h264: Remove a commented-out function pointer typedef.
txd: Remove write-only variable in txd_decode_frame().
mmvideo.c: Remove unused variable in mm_decode_pal().
build: cosmetics: Add missing end-of-line backslashes to item lists.
build: cosmetics: Split HEADERS/OBJS/PROGS lists into one entry per line.
libschroedinger: Move a function to avoid a forward declaration.
pthread: warn on high thread counts
vf_yadif: fix missing error handling for avfilter_poll_frame()
avprobe: allow showing only one container/stream property.
lavfi: support audio in avfilter_copy_frame_props().
lavfi: avfilter_merge_formats: handle case where inputs are same
lavc: add sample rate and channel layout to AVFrame.
zerocodec: check if the previous frame is missing
doc: clarify check for NULL pointer style
Conflicts:
doc/APIchanges
doc/developer.texi
ffprobe.c
libavcodec/Makefile
libavcodec/avcodec.h
libavcodec/libdirac_libschro.c
libavcodec/libdirac_libschro.h
libavcodec/mmvideo.c
libavcodec/txd.c
libavcodec/version.h
libavcodec/zerocodec.c
libavfilter/Makefile
libavfilter/avfilter.c
libavfilter/version.h
libavformat/Makefile
libavutil/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
avs: call release_buffer() at the end.
Add minor bumps and APIchanges entries for lavc/lavfi changes.
mpegvideo.c: K&R formatting and cosmetics.
avconv: avoid memcpy in vsrc_buffer when possible.
avconv: implement get_buffer()/release_buffer().
lavfi: add a new function av_buffersrc_buffer().
lavfi: add avfilter_copy_frame_props()
lavc: add format field to AVFrame
lavc: add width and height fields to AVFrame
lavc: add a sample_aspect_ratio field to AVFrame
doxy: add website-alike style to the html output
FAQ: add an entry for common error when using -profile
Conflicts:
avconv.c
cmdutils.c
doc/APIchanges
libavcodec/avcodec.h
libavcodec/mpegvideo.c
libavcodec/utils.c
libavcodec/version.h
libavfilter/Makefile
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/src_movie.c
libavfilter/vsrc_buffer.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
avfilter_copy_frame_props() avoids code duplication and increases
robustness.
The added files libavfilter/avcodec.[ch] are used for containing
utilities useful for gluing togheter libavfilter and libavcodec.