Commit Graph

54 Commits

Author SHA1 Message Date
Anton Khirnov
b9c928a486 avfilter: add AVFILTER_FLAG_METADATA_ONLY
This flag allows distinguishing between filters that actually modify the
data and those that only modify metadata or gather some stream
information.
2021-12-04 14:07:19 +01:00
Andreas Rheinhardt
b4f5201967 avfilter: Replace query_formats callback with union of list and callback
If one looks at the many query_formats callbacks in existence,
one will immediately recognize that there is one type of default
callback for video and a slightly different default callback for
audio: It is "return ff_set_common_formats_from_list(ctx, pix_fmts);"
for video with a filter-specific pix_fmts list. For audio, it is
the same with a filter-specific sample_fmts list together with
ff_set_common_all_samplerates() and ff_set_common_all_channel_counts().

This commit allows to remove the boilerplate query_formats callbacks
by replacing said callback with a union consisting the old callback
and pointers for pixel and sample format arrays. For the not uncommon
case in which these lists only contain a single entry (besides the
sentinel) enum AVPixelFormat and enum AVSampleFormat fields are also
added to the union to store them directly in the AVFilter,
thereby avoiding a relocation.

The state of said union will be contained in a new, dedicated AVFilter
field (the nb_inputs and nb_outputs fields have been shrunk to uint8_t
in order to create a hole for this new field; this is no problem, as
the maximum of all the nb_inputs is four; for nb_outputs it is only
two).

The state's default value coincides with the earlier default of
query_formats being unset, namely that the filter accepts all formats
(and also sample rates and channel counts/layouts for audio)
provided that these properties agree coincide for all inputs and
outputs.

By using different union members for audio and video filters
the type-unsafety of using the same functions for audio and video
lists will furthermore be more confined to formats.c than before.

When the new fields are used, they will also avoid allocations:
Currently something nearly equivalent to ff_default_query_formats()
is called after every successful call to a query_formats callback;
yet in the common case that the newly allocated AVFilterFormats
are not used at all (namely if there are no free links) these newly
allocated AVFilterFormats are freed again without ever being used.
Filters no longer using the callback will not exhibit this any more.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-05 17:48:25 +02:00
Andreas Rheinhardt
8be701d9f7 avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilter
Up until now, an AVFilter's lists of input and output AVFilterPads
were terminated by a sentinel and the only way to get the length
of these lists was by using avfilter_pad_count(). This has two
drawbacks: first, sizeof(AVFilterPad) is not negligible
(i.e. 64B on 64bit systems); second, getting the size involves
a function call instead of just reading the data.

This commit therefore changes this. The sentinels are removed and new
private fields nb_inputs and nb_outputs are added to AVFilter that
contain the number of elements of the respective AVFilterPad array.

Given that AVFilter.(in|out)puts are the only arrays of zero-terminated
AVFilterPads an API user has access to (AVFilterContext.(in|out)put_pads
are not zero-terminated and they already have a size field) the argument
to avfilter_pad_count() is always one of these lists, so it just has to
find the filter the list belongs to and read said number. This is slower
than before, but a replacement function that just reads the internal numbers
that users are expected to switch to will be added soon; and furthermore,
avfilter_pad_count() is probably never called in hot loops anyway.

This saves about 49KiB from the binary; notice that these sentinels are
not in .bss despite being zeroed: they are in .data.rel.ro due to the
non-sentinels.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-20 12:53:58 +02:00
Andreas Rheinhardt
a04ad248a0 avfilter: Constify all AVFilters
This is possible now that the next-API is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:05 -03:00
Andreas Rheinhardt
a7bd379276 avfilter/af_aformat: Add uninit function
Fixes memleaks in case init fails (e.g. because of invalid parameters
like 'aformat=sample_fmts=s16:cl=wtf') or also if query_formats is never
called.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-24 01:01:02 +02:00
Andreas Rheinhardt
e013a71fe3 avfilter: Remove redundant ff_formats/channel_layouts_unref()
ff_add_format() and ff_add_channel_layout() already unref the list upon
error.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-24 01:01:02 +02:00
Gyan Doshi
5bd001043d avfilter/aformat: add shorthand names for options 2020-01-08 11:15:13 +05:30
Paul B Mahol
6bdeac24e0 avfilter/af_aformat: remove deprecated syntax from options description
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-02-07 22:47:39 +01:00
Ganesh Ajjanagadde
6aaac24d72 avfilter/all: propagate errors of functions from avfilter/formats
Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM).
This propagates the return values.

All of these were found by using av_warn_unused_result, demonstrating its utility.

Tested with FATE. I am least sure of the changes to avfilter/filtergraph,
since I don't know what/how reduce_format is intended to behave and how it should
react to errors.

Fixes: CID 1325680, 1325679, 1325678.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Previous version Reviewed-by: Nicolas George <george@nsup.org>
Previous version Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-14 10:04:01 -04:00
Paul B Mahol
a0854c084e avfilter: handle error in query_formats() in bunch of filters
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-04-08 13:05:06 +00:00
Michael Niedermayer
325f6e0a97 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavfi: do not export the filters from shared objects

Conflicts:
	libavfilter/af_amix.c
	libavfilter/af_anull.c
	libavfilter/asrc_anullsrc.c
	libavfilter/f_select.c
	libavfilter/f_settb.c
	libavfilter/split.c
	libavfilter/src_movie.c
	libavfilter/vf_aspect.c
	libavfilter/vf_blackframe.c
	libavfilter/vf_colorbalance.c
	libavfilter/vf_copy.c
	libavfilter/vf_crop.c
	libavfilter/vf_cropdetect.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_format.c
	libavfilter/vf_framestep.c
	libavfilter/vf_frei0r.c
	libavfilter/vf_hflip.c
	libavfilter/vf_libopencv.c
	libavfilter/vf_lut.c
	libavfilter/vf_null.c
	libavfilter/vf_overlay.c
	libavfilter/vf_scale.c
	libavfilter/vf_transpose.c
	libavfilter/vf_unsharp.c
	libavfilter/vf_vflip.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-29 11:58:11 +01:00
Anton Khirnov
cd43ca0443 lavfi: do not export the filters from shared objects 2013-10-28 15:29:54 +01:00
Paul B Mahol
b211607b5c avfilter: various cosmetics
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-09-12 14:01:43 +00:00
Michael Niedermayer
4742edd50e Merge commit 'c5ab6088ad7b0dac461fb6757b038f5260e638e5'
* commit 'c5ab6088ad7b0dac461fb6757b038f5260e638e5':
  af_aformat: cosmetics, fix indentation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-18 12:22:25 +02:00
Anton Khirnov
c5ab6088ad af_aformat: cosmetics, fix indentation 2013-05-17 20:30:02 +02:00
Anton Khirnov
d69a4177b9 lavfi: remove now unused args parameter from AVFilter.init
Conflicts:

	libavfilter/avfilter.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_lut.c
	libavfilter/vf_select.c
	libavfilter/vf_setpts.c
	libavfilter/vsrc_color.c
	libavfilter/vsrc_movie.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-12 11:54:39 +02:00
Paul B Mahol
10b1cc63c2 lavfi: remove double .priv_class initializers
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-04-11 11:13:42 +00:00
Michael Niedermayer
2a2a643c90 Merge commit 'e67a87eac814c7805d18c983c43033a8a1bd62af'
* commit 'e67a87eac814c7805d18c983c43033a8a1bd62af':
  vf_(no)format: switch to an AVOptions-based system.
  af_aformat: switch to an AVOptions-based system.

Conflicts:
	doc/filters.texi
	libavfilter/af_aformat.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-10 13:59:45 +02:00
Anton Khirnov
c43a7ecad9 lavfi: remove now unused args parameter from AVFilter.init 2013-04-09 19:12:38 +02:00
Anton Khirnov
0af7fe1f95 af_aformat: switch to an AVOptions-based system. 2013-04-09 18:55:45 +02:00
Nicolas George
6d962aec8d lavfi/af_aformat: accept unknown channel layouts. 2013-01-26 11:15:38 +01:00
Michael Niedermayer
03b078721c Merge commit '97bf7c03b1338a867da52c159a2afecbdedcfa88'
* commit '97bf7c03b1338a867da52c159a2afecbdedcfa88':
  doc: git-howto: Leave reviewers time to react before pushing patches
  Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
  lavu: rename audioconvert.* to channel_layout.* and deprecate audioconvert.h

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/git-howto.texi
	ffmpeg_filter.c
	libavcodec/flacdec.c
	libavcodec/imc.c
	libavcodec/mpegaudiodec.c
	libavcodec/utils.c
	libavfilter/asrc_anullsrc.c
	libavfilter/audio.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/avfiltergraph.c
	libavfilter/buffer.c
	libavutil/Makefile
	libavutil/audioconvert.h
	libavutil/channel_layout.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-12 11:32:11 +01:00
Justin Ruggles
a903f8f087 Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
Also reorder some other #include when applicable.
2012-11-11 13:35:12 -05:00
Michael Niedermayer
526cb36e4b Merge commit '4436f25a1682ada3f7226cb6fadf429946933161'
* commit '4436f25a1682ada3f7226cb6fadf429946933161':
  build: remove references to unused EXTRAOBJS variable
  lavfi: convert input/ouput list compound literals to named objects
  fate: add h263 obmc vsynth tests
  avconv: remove bogus warning when using avconv -h without parameter
  averror: explicitly define AVERROR_* values
  flashsv: propagate inflateReset() errors
  indeo4/5: remove constant parameter num_bands from wavelet recomposition
  mxfdec: return error if no segments are available in mxf_get_sorted_table_segments
  Double motion vector range for HPEL interlaced picture in proper place

Conflicts:
	libavcodec/v210dec.h
	libavfilter/af_aformat.c
	libavfilter/af_amix.c
	libavfilter/af_asyncts.c
	libavfilter/af_channelmap.c
	libavfilter/af_join.c
	libavfilter/asrc_anullsrc.c
	libavfilter/buffersrc.c
	libavfilter/f_setpts.c
	libavfilter/f_settb.c
	libavfilter/fifo.c
	libavfilter/src_movie.c
	libavfilter/vf_ass.c
	libavfilter/vf_blackframe.c
	libavfilter/vf_boxblur.c
	libavfilter/vf_delogo.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_fieldorder.c
	libavfilter/vf_fps.c
	libavfilter/vf_hflip.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_select.c
	libavfilter/vf_transpose.c
	libavfilter/vf_yadif.c
	libavfilter/vsrc_testsrc.c
	libavformat/mxfdec.c
	libavutil/error.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-11 15:46:48 +02:00
Mans Rullgard
568c70e79e lavfi: convert input/ouput list compound literals to named objects
A number of compilers, for example those from TI and IBM, choke on
these initialisers.  The current style is also quite ugly.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-10 22:26:12 +01:00
Stefano Sabatini
42d621d131 lavfi: add priv class to filter definitions and flags to filter internal options
This allows the iteration callbacks to discover the internal class and
options, and show them when required.
2012-08-18 10:19:05 +02:00
Michael Niedermayer
c581cb4e4f Merge remote-tracking branch 'qatar/master'
* 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>
2012-08-16 16:20:30 +02:00
Martin Storsjö
1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03:00
Clément Bœsch
cc650cf029 Remove "Error parsing options string [...]" messages.
This reduces from 3 to 2 messages for the same syntax error in ffprobe,
and from 4 to 3 in filters.
2012-08-09 08:11:00 +02:00
Michael Niedermayer
9023de342f Merge commit '1470ce21cec5ee26e106e2a884c26bbf84e5aaea'
* commit '1470ce21cec5ee26e106e2a884c26bbf84e5aaea':
  Bump libavcodec and libavformat minor versions for G.723.1 decoder and demuxer
  G.723.1 demuxer and decoder
  Add a shift parameter to celp_lp_synthesis_filter()
  libopenjpeg: K&R formatting cosmetics
  yadif: use emms_c() instead of inline assembly for emms invocations.
  ac3: don't use different names for option tables in the template file.
  lavfi: use const for AVFilterPad declarations in all filters.
  adpcm: don't duplicate identical AVSampleFmt array for each encoder.
  configure: cosmetics: Group test dependencies together
  configure: add more passthrough flags in tms470 filter
  configure: move flag filtering functions out of if/else blocks

Conflicts:
	Changelog
	configure
	doc/general.texi
	libavcodec/Makefile
	libavcodec/ac3enc_fixed.c
	libavcodec/allcodecs.c
	libavcodec/eac3enc.c
	libavcodec/g723_1.c
	libavcodec/g723_1_data.h
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/v210dec.h
	libavcodec/version.h
	libavfilter/af_anull.c
	libavfilter/asrc_anullsrc.c
	libavfilter/f_settb.c
	libavfilter/fifo.c
	libavfilter/split.c
	libavfilter/src_movie.c
	libavfilter/vf_aspect.c
	libavfilter/vf_blackframe.c
	libavfilter/vf_boxblur.c
	libavfilter/vf_copy.c
	libavfilter/vf_crop.c
	libavfilter/vf_cropdetect.c
	libavfilter/vf_delogo.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_fieldorder.c
	libavfilter/vf_format.c
	libavfilter/vf_frei0r.c
	libavfilter/vf_gradfun.c
	libavfilter/vf_hflip.c
	libavfilter/vf_hqdn3d.c
	libavfilter/vf_libopencv.c
	libavfilter/vf_lut.c
	libavfilter/vf_null.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_pixdesctest.c
	libavfilter/vf_scale.c
	libavfilter/vf_select.c
	libavfilter/vf_setpts.c
	libavfilter/vf_showinfo.c
	libavfilter/vf_slicify.c
	libavfilter/vf_transpose.c
	libavfilter/vf_unsharp.c
	libavfilter/vf_vflip.c
	libavfilter/vf_yadif.c
	libavfilter/vsrc_color.c
	libavfilter/vsrc_testsrc.c
	libavformat/Makefile
	libavformat/allformats.c
	libavformat/g723_1.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-22 22:18:18 +02:00
Ronald S. Bultje
3db407038e lavfi: use const for AVFilterPad declarations in all filters. 2012-07-21 16:31:15 -07:00
Michael Niedermayer
052f4f859c Merge commit 'a5e8c41c28f907d98d2a739db08f7aef4cbfcf3a'
* commit 'a5e8c41c28f907d98d2a739db08f7aef4cbfcf3a':
  lavfi: remove 'opaque' parameter from AVFilter.init()
  mov: do not try to read total disc/track number if data atom is too short.
  avconv: fix -force_key_frames
  dxva2_h264: fix signaling of mbaff frames
  x86: fft: elf64: fix PIC build

Conflicts:
	ffmpeg.c
	libavcodec/v210dec.h
	libavfilter/asrc_anullsrc.c
	libavfilter/buffersrc.c
	libavfilter/src_movie.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_overlay.c
	libavfilter/vsrc_color.c
	libavfilter/vsrc_testsrc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-26 23:57:07 +02:00
Anton Khirnov
a5e8c41c28 lavfi: remove 'opaque' parameter from AVFilter.init()
It is not used in any filters currently and is inherently evil. If
passing binary data to filters is required in the future, it should be
done with some AVOptions-based system.
2012-06-26 13:13:48 +02:00
Michael Niedermayer
1c60088885 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  x86: Only use optimizations with cmov if the CPU supports the instruction
  x86: Add CPU flag for the i686 cmov instruction
  x86: remove unused inline asm macros from dsputil_mmx.h
  x86: move some inline asm macros to the only places they are used
  lavfi: Add the af_channelmap audio channel mapping filter.
  lavfi: add join audio filter.
  lavfi: allow audio filters to request a given number of samples.
  lavfi: support automatically inserting the fifo filter when needed.
  lavfi/audio: eliminate ff_default_filter_samples().

Conflicts:
	Changelog
	libavcodec/x86/h264dsp_mmx.c
	libavfilter/Makefile
	libavfilter/allfilters.c
	libavfilter/avfilter.h
	libavfilter/avfiltergraph.c
	libavfilter/version.h
	libavutil/x86/cpu.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-24 02:09:53 +02:00
Stefano Sabatini
c17808cebd lavfi: define macro AVFILTER_DEFINE_CLASS
The macro can be used to define consistently the internal class of a
filter, save some typing and factorize.
2012-06-22 23:11:43 +02:00
Anton Khirnov
fa06623930 lavfi/audio: eliminate ff_default_filter_samples().
It currently does the following:
1) get a zeroed audio buffer
2) copy some properties (but not the data) of the input buffer to it
3) pass this buffer to the output filter
This looks useless and is indeed not used by any filters, therefore
delete it.

Make ff_null_filter_samples() (just pass the buffer to the next filter)
the new default.
2012-06-22 20:58:19 +02:00
Paul B Mahol
54101214d8 lavfi: use designated initializers for AVClass
While here:
    - add missing .version and .category,
    - make .class_name consistent across filters,
    - align declarations.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-06-17 11:10:10 +00:00
Michael Niedermayer
ad60b3b181 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  vorbis: Validate that the floor 1 X values contain no duplicates.
  avprobe: Identify codec probe failures rather than calling them unsupported codecs.
  avformat: Probe codecs at score 0 on buffer exhaustion conditions.
  avformat: Factorize codec probing.
  Indeo Audio decoder
  imc: make IMDCT support stereo output
  imc: move channel-specific data into separate context
  lavfi: remove request/poll and drawing functions from public API on next bump
  lavfi: make avfilter_insert_pad and pals private on next bump.
  lavfi: make formats API private on next bump.
  avplay: use buffersrc instead of custom input filter.
  avtools: move buffer management code from avconv to cmdutils.
  avconv: don't use InputStream in the buffer management code.
  avconv: fix exiting when max frames is reached.
  mpc8: fix maximum bands handling
  aacdec: Turn PS off when switching to stereo and turn it to implicit when switching to mono.

Conflicts:
	Changelog
	cmdutils.h
	ffmpeg.c
	ffplay.c
	ffprobe.c
	libavcodec/avcodec.h
	libavcodec/mpc8.c
	libavcodec/v210dec.h
	libavcodec/version.h
	libavcodec/vorbisdec.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/buffersrc.c
	libavfilter/formats.c
	libavfilter/src_movie.c
	libavfilter/vf_aspect.c
	libavfilter/vf_blackframe.c
	libavfilter/vf_boxblur.c
	libavfilter/vf_crop.c
	libavfilter/vf_cropdetect.c
	libavfilter/vf_delogo.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_fifo.c
	libavfilter/vf_format.c
	libavfilter/vf_frei0r.c
	libavfilter/vf_gradfun.c
	libavfilter/vf_hflip.c
	libavfilter/vf_hqdn3d.c
	libavfilter/vf_libopencv.c
	libavfilter/vf_lut.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vf_select.c
	libavfilter/vf_showinfo.c
	libavfilter/vf_transpose.c
	libavfilter/vf_unsharp.c
	libavfilter/vf_yadif.c
	libavfilter/vsrc_color.c
	libavfilter/vsrc_testsrc.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-06 01:08:33 +02:00
Anton Khirnov
b74a1da49d lavfi: make formats API private on next bump.
It is only useful inside filters and we don't allow user filters for
now.
2012-06-05 09:37:30 +02:00
Stefano Sabatini
0f0f3bd1e0 lavfi: use av_default_item_name() as filter private context logger
avfilter_default_filter_name() is supposed to access an AVFilterContext
struct, if used with a private struct it will cause a crash since it will
access fields which are non defined in the private struct.
2012-06-04 02:40:01 +02:00
Stefano Sabatini
4d6a8a2bdb lavfi: add avfilter_default_filter_name()
The function is modelled after av_default_item_name(), and will print the
name of the instance filter if defined, otherwise the name of the filter.

This allows to show the instance name in the log, which is useful when
debugging complex filter graphs.
2012-06-04 00:54:57 +02:00
Michael Niedermayer
a5c7525bcb set some categories of some AVClass structs
Please help setting the category for all remaining AVClasses

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-03 21:55:50 +02:00
Michael Niedermayer
1cbf7fb434 Merge remote-tracking branch 'qatar/master'
* 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>
2012-05-16 02:27:31 +02:00
Anton Khirnov
fb604ae850 lavfi: add aformat filter
Based on a patch by Mina Nagy Zaki <mnzaki@gmail.com>
2012-05-14 21:36:11 +02:00
Clément Bœsch
4522df52aa lavfi: remove audio.h include from avfilter.h.
avfilter.h is a public header and the unexported audio.h header contains
only internal prototypes.
2012-05-12 17:59:41 +02:00
Michael Niedermayer
015903294c Merge remote-tracking branch 'qatar/master'
* qatar/master: (25 commits)
  rv40dsp x86: MMX/MMX2/3DNow/SSE2/SSSE3 implementations of MC
  ape: Use unsigned integer maths
  arm: dsputil: fix overreads in put/avg_pixels functions
  h264: K&R formatting cosmetics for header files (part II/II)
  h264: K&R formatting cosmetics for header files (part I/II)
  rtmp: Implement check bandwidth notification.
  rtmp: Support 'rtmp_swfurl', an option which specifies the URL of the SWF player.
  rtmp: Support 'rtmp_flashver', an option which overrides the version of the Flash plugin.
  rtmp: Support 'rtmp_tcurl', an option which overrides the URL of the target stream.
  cmdutils: Add fallback case to switch in check_stream_specifier().
  sctp: be consistent with socket option level
  configure: Add _XOPEN_SOURCE=600 to Solaris preprocessor flags.
  vcr1enc: drop pointless empty encode_init() wrapper function
  vcr1: drop pointless write-only AVCodecContext member from VCR1Context
  vcr1: group encoder code together to save #ifdefs
  vcr1: cosmetics: K&R prettyprinting, typos, parentheses, dead code, comments
  mov: make one comment slightly more specific
  lavr: replace the SSE version of ff_conv_fltp_to_flt_6ch() with SSE4 and AVX
  lavfi: move audio-related functions to a separate file.
  lavfi: remove some audio-related function from public API.
  ...

Conflicts:
	cmdutils.c
	libavcodec/h264.h
	libavcodec/h264_mvpred.h
	libavcodec/vcr1.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/defaults.c
	libavfilter/internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-10 23:30:42 +02:00
Clément Bœsch
9f0b0db0d3 lavfi/aformat: use do..while(0) form for macro.
This avoids some empty statements.
2012-02-02 14:31:17 +01:00
Reimar Döffinger
5af7daabc4 Mark AVFilterPad[] compound literals as const.
GCC 4.6.2 at least still seems to fail to put them in .rodata though,
see also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37303

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-11-06 00:05:14 +01:00
Stefano Sabatini
b35e9e19e9 lavu: add av_strtok()
The function strtok_r() is part of the POSIX.1 specification, but is not
available on some platforms. We provide an internal implementation, so we
do not need to rely on a platform implementation.
2011-10-18 18:21:03 +02:00
Stefano Sabatini
9899037dc6 lavfi: rename avfilter_all_* function names to avfilter_make_all_*
A function name should tell what the function does rather than what
the function returns. This also avoids possible conflicts
(e.g. between a function and a public list of all supported formats),
and clarifies the code.

Breaks audio API/ABI, add a backward compatibility layer for video
API/ABI.
2011-09-16 00:42:47 +02:00