summaryrefslogtreecommitdiff
path: root/libavfilter/formats.h
Commit message (Collapse)AuthorAge
* avfilter/formats: Constify channel_layout in ff_add_channel_layout()Andreas Rheinhardt2022-05-19
| | | | | | It copies, not moves the channel layout. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: convert to new channel layout APIJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/formats: Add function to create AVFilterFormats with one entryAndreas Rheinhardt2021-10-05
| | | | | | | | Most instances ff_add_formats() actually only ever add one format; this function can be used to simplify those callers. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Make ff_formats_pixdesc_filter return AVFilterFormats*Andreas Rheinhardt2021-09-26
| | | | | | | | | | | | | | | | Up until now, it has returned the AVFilterFormats list via an AVFilterFormats** parameter; the actual return value was an int that was always AVERROR(ENOMEM) on error. The AVFilterFormats** argument was a pure output parameter which was only documented by naming the parameter rfmts. Yet nevertheless all callers initialized the underlying AVFilterFormats* to NULL. This commit changes this to return a pointer to AVFilterFormats directly. This is more in line with the API in general, as it allows to avoid checks for intermediate values. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Don't set samplerate or channel count on video linksAndreas Rheinhardt2021-08-20
| | | | | | | | | | | This currently happens by accident in a few filters that use ff_set_common_(samplerates|channel_layouts) like afir (if the response option is set) or agraphmonitor (due to the default code in avfiltergraph.c). So change those functions to make sure it does no longer happen. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavfi/formats: document the negotiation processNicolas George2021-08-20
|
* lavfi/formats: rename AVFilterNegotiation.nb to nb_mergersNicolas George2021-08-20
|
* lavfi/formats: cosmetic: move negotiation stuff at the endNicolas George2021-08-20
| | | | It was between AVFilterFormats and AVFilterChannelLayouts.
* lavfi/formats: describe conversion in negotiation structure.Nicolas George2021-08-14
|
* lavfi/formats: put merge functions in structures.Nicolas George2021-08-14
| | | | | It makes the code clearer and will allow adding new stages of negotiation easier.
* avfilter/formats: Factor common function combinations outAndreas Rheinhardt2021-08-13
| | | | | | | | | | | Several combinations of functions happen quite often in query_format functions; e.g. ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)) is very common. This commit therefore adds functions that are equivalent to commonly used function combinations in order to reduce code duplication. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove obsolete version.h inclusionsAndreas Rheinhardt2021-07-22
| | | | | | | These have mostly been added because of FF_API_*; yet when these were removed, removing the header has been forgotten. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Remove avfilter_make_format64_list()Andreas Rheinhardt2021-04-27
| | | | | | | | The API it is part of has been made private long ago (see commit b74a1da49db5ebed51aceae6cacc2329288a92c1). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/formats: Don't typedef structure a second timeAndreas Rheinhardt2020-09-11
| | | | | | | | | | | | | | | | | | | Before commit 2f76476549a01ae2c4ec2a440e4b14c5aba64869, avfilter.h contained no typedef for AVFilterChannelLayouts; all references to it were done using its struct tag. formats.h meanwhile contained the definition of the struct and a typedef for it. Said commit now added a typedef in avfilter.h, too, bringing it in line with AVFilterFormats; yet this means that there are two typedefs for AVFilterChannelLayouts (in contrast to AVFilterFormats which is only typedef'ed in avfilter.h). The problem is that older versions of GCC don't like this and error out: http://fate.ffmpeg.org/history.cgi?slot=x86_64-openbsd5.6-gcc4.2-conf2 is one of the FATE boxes that now fail to compile. So just remove the typedef in formats.h. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavfi: check the validity of formats lists.Nicolas George2020-09-08
| | | | | | | | | | | Part of the code expects valid lists, in particular no duplicates. These tests allow to catch bugs in filters (unlikely but possible) and to give a clear message when the error comes from the user ((a)formats) or the application (buffersink). If we decide to switch to a more efficient merging algorithm, possibly sorting the lists, these functions will be the preferred place for pre-processing, and can be renamed accordingly.
* avfilter/formats: Remove unused functionsAndreas Rheinhardt2020-08-21
| | | | | | | | | | | | | | This commit removes ff_parse_sample_format(), ff_parse_time_base() and ff_query_formats_all_layouts() from libavfilter/formats.c. All of these functions were completely unused. ff_parse_time_base() has not been used at all since it had been added in 3448404a707b6e236a2ffa7b0453b3300de41b7b; the last caller of ff_parse_sample_format has been removed in commit d1c49bcae9b7fd41df5c6804ac7f6a5c271a7c2e. And the one and only caller of ff_query_formats_all_layouts() (the asyncts filter) has been removed in commit a8fe8d6b4a35c95aa94fccde5f001041278d197c. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Factor checking for mergeability out of ff_merge_*Andreas Rheinhardt2020-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The callers of the ff_merge_*() functions fall into two categories with quite different needs: One caller is can_merge_formats() which only wants to test for mergeability without it merging anything. In order to do so, it duplicates the lists it intends to test and resets their owners so that they are not modified by ff_merge_*(). It also means that it needs to receive the merged list (and not only an int containing whether the lists are mergeable) to properly free it. The other callers want the lists to be actually merged. But given the fact that ff_merge_*() automatically updates the owners of the lists, they only want the information whether the merge succeeded or not; they don't want a link to the new list. Therefore this commit splits these functions in two: ff_merge_*() for the latter callers and ff_can_merge_*() for the former. ff_merge_*() doesn't need to return a pointer to the combined list at all and hence these functions have been modified to return an int, which allows to distinguish between incompability and memory allocation failures. ff_can_merge_*() meanwhile doesn't modify its arguments at all obviating the need for copies. This in turn implies that there is no reason to return a pointer to the new list, as nothing needs to be freed. These functions therefore return an int as well. This allowed to completely remove can_merge_formats() in avfiltergraph.c. Notice that no ff_can_merge_channel_layouts() has been created, because there is currently no caller for this. It could be added if needed. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Schedule avfilter_make_format64_list() for removalAndreas Rheinhardt2020-08-12
| | | | | | | | | | | | Despite its name, this function is not part of the public API, as formats.h, the header containing its declaration, is a private header. The formats API was once public API, but that changed long ago (b74a1da49db5ebed51aceae6cacc2329288a92c1, the commit scheduling it to become private, is from 2012). That avfilter_make_format64_list() was forgotten is probably a result of the confusion resulting from the libav-ffmpeg split. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Remove ff_make_formatu64_list()Andreas Rheinhardt2020-08-12
| | | | | | | It is unused since 8cbb055760c725d0fb99fb759caabb5f4e37e340 and it actually coincides with avfilter_make_format64_list(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavfi/formats: add ff_formats_pixdesc_filter().Nicolas George2020-05-23
|
* avfilter/formats: allow unknown channel layouts by defaultMarton Balint2016-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the default in the libav fork is to only allow known layouts, making unknown layouts allowed by default here can be a security risk for filters directly merged from libav. However, usually it is simple to detect such cases, use of av_get_channel_layout_nb_channels is a good indicator, so I suggest we change this regardless. See http://ffmpeg.org/pipermail/ffmpeg-devel/2016-November/203204.html. This patch indirectly adds unknown channel layout support for filters where query_formats is not specified: abench afifo ainterleave anullsink apad aperms arealtime aselect asendcmd asetnsamples asetpts asettb ashowinfo azmq It introduces a query_formats callback for the asyncts filter, which only supports known channel layouts since it is using libavresample. And it removes .query_formats callback from filters where it was only there to support unknown layouts, as this is now the default: aloop ametadata anull asidedata asplit atrim Acked-by: Nicolas George <george@nsup.org> Signed-off-by: Marton Balint <cus@passwd.hu>
* Merge commit '29c2d06d67724e994980045afa055c6c34611b30'Derek Buitenhuis2016-02-24
|\ | | | | | | | | | | | | * commit '29c2d06d67724e994980045afa055c6c34611b30': cosmetics: Drop empty comment lines Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * cosmetics: Drop empty comment linesDiego Biurrun2016-02-18
| |
* | avfilter: add SOFAlizer audio filterPaul B Mahol2015-12-12
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avfilter/formats: add av_warn_unused_result to function prototypesGanesh Ajjanagadde2015-10-14
| | | | | | | | | | | | | | | | This uses the av_warn_unused_result attribute liberally to catch some forms of improper usage of functions defined in avfilter/formats.h. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avfilter/formats: proper error handling in ff_set_common_*() functionsClément Bœsch2015-03-16
| |
* | avfilter/formats: proper error handling in ff_channel_layouts_ref() and ↵Clément Bœsch2015-03-16
| | | | | | | | | | | | ff_formats_ref() Also make sure the allocation and its check are properly done.
* | Merge commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0'Michael Niedermayer2013-05-18
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0': lavfi: rename AVFilterFormats.format_count to nb_formats Conflicts: libavfilter/avfiltergraph.c libavfilter/filtfmts.c libavfilter/formats.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: rename AVFilterFormats.format_count to nb_formatsAnton Khirnov2013-05-17
| | | | | | | | This is more consistent with naming in the rest of Libav.
* | lavfi: fix merging of formats and clarify exception.Nicolas George2013-02-24
| | | | | | | | | | | | | | | | The following commit: b97d61f avfilter/ff_merge_formats: only merge if doing so does not loose chroma or alpha introduced an exception to avoid lossy conversions. Add a comment to explain the logic. Fix the call to avoid applying it on audio formats.
* | lavfi: implement ff_query_formats_all().Nicolas George2013-01-26
| |
* | lavfi: implement ff_all_channel_counts().Nicolas George2013-01-26
| |
* | lavfi: support unknown channel layouts.Nicolas George2013-01-26
| |
* | Fix misspellings of FFmpegMichael Niedermayer2012-07-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-07-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: cosmetics: Consistently use C-style comments with multiple inclusion guards anm: fix a few Doxygen comments misc typo and wording fixes attributes: add av_noreturn attributes: drop pointless define guards configure: do not disable av_always_inline with --enable-small flvdec: initial stream switch support avplay: fix write on freed memory for rawvideo snow: remove a VLA used for edge emulation x86: lavfi: fix gradfun/yadif build with mmx/sse disabled snow: remove the runs[] VLA. snow: Check mallocs at init flacdec: remove redundant setting of avctx->sample_fmt Conflicts: ffplay.c libavcodec/h264.c libavcodec/snow.c libavcodec/snow.h libavcodec/snowdec.c libavcodec/snowenc.c libavformat/flvdec.c libavutil/attributes.h tools/patcheck Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Consistently use C-style comments with multiple inclusion guardsDiego Biurrun2012-07-03
| |
* | formats.h: fix project reference in commentMichael Niedermayer2012-06-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '1961e46c15c23a041f8d8614a25388a3ee9eff63'Michael Niedermayer2012-06-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1961e46c15c23a041f8d8614a25388a3ee9eff63': lavfi: remove disabled FF_API_FILTERS_PUBLIC cruft lavfi: remove disabled FF_API_DEFAULT_CONFIG_OUTPUT_LINK cruft lavfi: use proper FF_API guards for different deprecated functions lavfi: remove disabled FF_API_VSRC_BUFFER_ADD_FRAME cruft lavfi: remove disabled FF_API_SAMPLERATE64 cruft lavfi: remove disabled FF_API_GRAPH_AVCLASS cruft Conflicts: libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/buffersrc.c libavfilter/formats.c libavfilter/graphparser.c libavfilter/version.h libavfilter/video.c libavfilter/vsrc_buffer.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: remove disabled FF_API_FILTERS_PUBLIC cruftAnton Khirnov2012-06-26
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: rtmp: Add a new option 'rtmp_buffer', for setting the client buffer time rtmp: Set the client buffer time to 3s instead of 0.26s rtmp: Handle server bandwidth packets rtmp: Display a verbose message when an unknown packet type is received lavfi/audio: use av_samples_copy() instead of custom code. configure: add all filters hardcoded into avconv to avconv_deps avfiltergraph: remove a redundant call to avfilter_get_by_name(). lavfi: allow building without swscale. build: Do not delete tests/vsynth2 directory, which is no longer created. lavfi: replace AVFilterContext.input/output_count with nb_inputs/outputs lavfi: make AVFilterPad opaque after two major bumps. lavfi: add avfilter_pad_get_type() and avfilter_pad_get_name(). lavfi: make avfilter_get_video_buffer() private on next bump. jack: update to new latency range API as the old one has been deprecated rtmp: Tokenize the AMF connection parameters manually instead of using strtok_r ppc: Rename H.264 optimization template file for consistency. lavfi: add channelsplit audio filter. golomb: check remaining bits during unary decoding in get_ur_golomb_jpegls() sws: fix planar RGB input conversions for 9/10/16 bpp. Conflicts: Changelog configure doc/APIchanges ffmpeg.c libavcodec/golomb.h libavcodec/v210dec.h libavfilter/Makefile libavfilter/allfilters.c libavfilter/asrc_anullsrc.c libavfilter/audio.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/avfiltergraph.c libavfilter/buffersrc.c libavfilter/formats.c libavfilter/version.h libavfilter/vf_frei0r.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/video.h libavfilter/vsrc_color.c libavformat/rtmpproto.c libswscale/input.c tests/Makefile Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: add channelsplit audio filter.Anton Khirnov2012-06-12
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-06
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavfi: make formats API private on next bump.Anton Khirnov2012-06-05
| | | | | | | | | | It is only useful inside filters and we don't allow user filters for now.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-05-23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: os_support: Define SHUT_RD, SHUT_WR and SHUT_RDWR on OS/2 http: Add support for reading http POST reply headers http: Add http_shutdown() for ending writing of posts tcp: Allow signalling end of reading/writing avio: Add a function for signalling end of reading/writing lavfi: fix comment, audio is supported now. lavfi: fix incorrect comment. lavfi: remove avfilter_null_* from public API on next bump. lavfi: remove avfilter_default_* from public API on next bump. lavfi: deprecate default config_props() callback and refactor avfilter_config_links() avfiltergraph: smarter sample format selection. avconv: rename transcode_audio/video to decode_audio/video. asyncts: reset delta to 0 when it's not used. x86: lavc: use %if HAVE_AVX guards around AVX functions in yasm code. dwt: return errors from ff_slice_buffer_init() Conflicts: ffmpeg.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/formats.c libavfilter/version.h libavfilter/vf_blackframe.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_format.c libavfilter/vf_showinfo.c libavfilter/video.c libavfilter/video.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavfi: remove avfilter_default_* from public API on next bump.Anton Khirnov2012-05-22
| | | | | | | | | | Those functions are only useful inside filters. It is better to not support user filters until the API is more stable.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-05-16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* lavfi: add types and functions for channel layout/samplerate negotiationAnton Khirnov2012-05-14