summaryrefslogtreecommitdiff
path: root/libavfilter/formats.c
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: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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: Update outdated commentAndreas Rheinhardt2021-10-02
| | | | | | Forgotten in 06754f7bbf341062581accc27b5cce353e99fd82. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Don't unnecessarily reget pixfmt descriptorAndreas Rheinhardt2021-10-02
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Avoid reallocations for video in ff_all_formats()Andreas Rheinhardt2021-09-26
| | | | | | | | | | | | | Up until now, the list of pixfmts is reallocated every time an entry is added to it; there are currently 196 pixel formats, so this matters: It causes 5541704 calls to av_realloc_array() in a typical FATE run, which is the majority for said function (8095768 calls) and even a large chunk of the calls to av_realloc() itself (12589508 calls). Fix this by using ff_formats_pixdesc_filter() instead. 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>
* avfilter/formats: Avoid redundant counterAndreas Rheinhardt2021-08-20
| | | | | | | | | | | The ff_set_common_(formats|channel_layouts|samplerates) have to free their list in case it doesn't have an owner; therefore they tracked whether they attached it to an owner. But the list's refcount already contains such a counter, so we don't have to keep track of whether we have attached the list to an owner. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavfi/formats: rename AVFilterNegotiation.nb to nb_mergersNicolas George2021-08-20
|
* 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>
* 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: Remove pointless checksAndreas Rheinhardt2020-09-11
| | | | | | | | | | | | | | | ff_formats_ref() takes a pointer to an AVFilterFormats and a pointer to a pointer to an AVFilterFormats as arguments and adds the latter as an owner to the list pointed to by the former; the latter is hereby always the address of a list contained in an AVFilterFormatsConfig and can therefore not be NULL. So remove the check for whether it is NULL; also do the same for ff_channel_layouts_ref(). Also do the same for the unref functions where argument is never NULL because it is always the address of an existing lvalue. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavfi/formats: more logical testing of inputs and outputs.Nicolas George2020-09-08
| | | | | | | | | | ff_set_common_formats() is currently only called after graph_check_validity(), guaranteeing that inputs and outputs are connected. If we want to support configuring partially-connected graphs, we will have a lot of redesign to do anyway. Fix CID 1466262 / 1466263.
* 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.
* lavfi/formats: simplify a macro parameters.Nicolas George2020-09-08
|
* lavfi: regroup formats lists in a single structure.Nicolas George2020-09-08
| | | | | | | | | | | | | | | It will allow to refernce it as a whole without clunky macros. Most of the changes have been automatically made with sed: sed -i ' s/-> *in_formats/->incfg.formats/g; s/-> *out_formats/->outcfg.formats/g; s/-> *in_channel_layouts/->incfg.channel_layouts/g; s/-> *out_channel_layouts/->outcfg.channel_layouts/g; s/-> *in_samplerates/->incfg.samplerates/g; s/-> *out_samplerates/->outcfg.samplerates/g; ' src/libavfilter/*(.)
* avfilter/formats: Fix double frees and memleaks on errorAndreas Rheinhardt2020-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The formats API deals with lists of channel layouts, sample rates, pixel formats and sample formats. These lists are refcounted in a way in which the list structure itself contains pointers to all of its owners. Furthermore, it is possible for a list to be not owned by anyone yet; this status is temporary until the list has been attached to an owner. Adding an owner to a list involves reallocating the list's list of owners and can therefore fail. In order to reduce the amount of checks and cleanup code for the users of this API, the API is supposed to be lenient when faced with input lists that are NULL and it is supposed to clean up if adding an owner to a list fails, so that a simple use case like list = ff_make_format_list(foo_fmts); if ((ret = ff_formats_ref(list, &ctx->inputs[0]->out_formats)) < 0) return ret; needn't check whether list could be successfully allocated (ff_formats_ref() return AVERROR(ENOMEM) if it couldn't) and it also needn't free list if ff_formats_ref() couldn't add an owner for it. But the cleaning up after itself was broken. The root cause was that the refcount was decremented during unreferencing whether or not the element to be unreferenced was actually an owner of the list or not. This means that if the above sample code is continued by if ((ret = ff_formats_ref(list, &ctx->inputs[1]->out_formats)) < 0) return ret; and that if an error happens at the second ff_formats_ref() call, the automatic cleaning of list will decrement the refcount from 1 (the sole owner of list at this moment is ctx->input[0]->out_formats) to 0 and so the list will be freed; yet ctx->input[0]->out_formats still points to the list and this will lead to a double free/use-after-free when ctx->input[0] is freed later. Presumably in order to work around such an issue, commit 93afb338a405eac0f9e7b092bc26603378bfcca6 restricted unreferencing to lists with owners. This does not solve the root cause (the above example is not fixed by this) at all, but it solves some crashs. This commit fixes the API: The list's refcount is only decremented if an owner is removed from the list of owners and not if the unref-function is called with a pointer that is not among the owners of the list. Furtermore, the requirement for the list to have owners is dropped. This implies that if the first call to ff_formats_ref() in the above example fails, the refcount which is initially zero during unreferencing is not modified, so that the list will be freed automatically in said call to ff_formats_ref() as every list whose refcount reaches zero is. If on the other hand, the second call to ff_formats_ref() is the first to fail, the refcount would stay at one during the automatic unreferencing in ff_formats_ref(). The list would later be freed when its last (and in this case sole) owner (namely ctx->inputs[0]->out_formats) gets unreferenced. The issues described here for ff_formats_ref() also affected the other functions of this API. E.g. ff_add_format() failed to clean up after itself if adding an entry to an already existing list failed (the case of a freshly allocated list was handled specially and this commit also removes said code). E.g. ff_all_formats() inherited the flaw. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* 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: CosmeticsAndreas Rheinhardt2020-08-21
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> 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: Avoid code duplication when merging sampleratesAndreas Rheinhardt2020-08-20
| | | | | | | | | | Right now, ff_merge_samplerates() contains three instances of the MERGE_REF() macro, a macro which reallocates an array, updates some pointers in a loop and frees several buffers. This commit makes it possible to contain only one instance of said macro in the function, thereby reducing codesize. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Avoid allocations when merging formats and sampleratesAndreas Rheinhardt2020-08-20
| | | | | | | | | | | | | | This is the analogue of cfc65520324ae640299bd321ef88ae76dcee6f78 for formats and samplerates; in contrast to said commit, one can avoid allocating a new array for formats as well (the complications of the generic channel layouts made this impossible for channel layouts). This commit also starts to move the line continuation '\' chars to the left to keep them in line with MERGE_REF() as well as with the 80 lines limit. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Make check for buffer overflow redundantAndreas Rheinhardt2020-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | and remove the redundant check. This check for whether the allocated buffer is sufficient has been added in commit 1cbf7fb4345a3e5b7791d483241bf4759bde4ece (merging commit 5775a1832c4165e6acc1d307004b38701bb463f4). It is not sufficient to detect invalid input lists (namely lists with duplicates); its only use is to avoid buffer overflows. And this can be achieved by simpler means: Make sure that one allocates space for so many elements as the outer loop ranges over and break out of the inner loop if a match has been found. For valid input without duplicates, no further match will be found anyway. This change will temporarily make the allocated formats array larger than before and larger than necessary; this will be fixed in a later commit that avoids the allocation altogether. If a check for duplicates in the lists is deemed necessary, it should be done properly somewhere else. Finally, the error message that is removed in this commit used __FUNCTION__, which is a GCC extension (C99 added __func__ for this). So this commit removes a warning when compiling in -pedantic mode. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Avoid allocations when merging channel layoutsAndreas Rheinhardt2020-08-13
| | | | | | | | | | | When one merges two AVFilterChannelLayouts structs, there is no need to allocate a new one. Instead one can reuse one of the two given ones. If one does this, one also doesn't need to update the references of the AVFilterChannelLayouts that is reused. Therefore this commit reuses the structure with the higher refcount. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Fix heap-buffer overflow when merging channel layoutsAndreas Rheinhardt2020-08-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The channel layouts accepted by ff_merge_channel_layouts() are of two types: Ordinary channel layouts and generic channel layouts. These are layouts that match all layouts with a certain number of channels. Therefore parsing these channel layouts is not done in one go; instead first the intersection of the ordinary layouts of the first input list of channel layouts with the ordinary layouts of the second list is determined, then the intersection of the ordinary layouts of the first one and the generic layouts of the second one etc. In order to mark the ordinary channel layouts that have already been matched as used they are zeroed. The inner loop that does this is as follows: for (j = 0; j < b->nb_channel_layouts; j++) { if (a->channel_layouts[i] == b->channel_layouts[j]) { ret->channel_layouts[ret_nb++] = a->channel_layouts[i]; a->channel_layouts[i] = b->channel_layouts[j] = 0; } } (Here ret->channel_layouts is the array containing the intersection of the two input arrays.) Yet the problem with this code is that after a match has been found, the loop continues the search with the new value a->channel_layouts[i]. The intention of zeroing these elements was to make sure that elements already paired at this stage are ignored later. And while they are indeed ignored when pairing ordinary and generic channel layouts later, it has the exact opposite effect when pairing ordinary channel layouts. To see this consider the channel layouts A B C D E and E D C B A. In the first round, A and A will be paired and added to ret->channel_layouts. In the second round, the input arrays are 0 B C D E and E D C B 0. At first B and B will be matched and zeroed, but after doing so matching continues, but this time it will search for 0, which will match with the last entry of the second array. ret->channel_layouts now contains A B 0. In the third round, C 0 0 will be added to ret->channel_layouts etc. This gives a quadratic amount of elements, yet the amount of elements allocated for said array is only the sum of the sizes of a and b. This issue can e.g. be reproduced by ffmpeg -f lavfi -i anullsrc=cl=7.1 \ -af 'aformat=cl=mono|stereo|2.1|3.0|4.0,aformat=cl=4.0|3.0|2.1|stereo|mono' \ -f null - The fix is easy: break out of the inner loop after having found a match. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Simplify cleanup for ff_merge_* functionsAndreas Rheinhardt2020-08-12
| | | | | | | | | | | Now that the output's refs-array is only allocated once, it is NULL in any error case and therefore needn't be freed at all; Instead an av_assert1() has been added to guarantee it to be NULL. Furthermore, it is unnecessary to av_freep(&ptr) when ptr == NULL. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/formats: Leave lists' ownership unchanged upon merge failureAndreas Rheinhardt2020-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ff_merge_formats(), ff_merge_samplerates() and ff_merge_channel_layouts() share common semantics: If merging succeeds, a non-NULL pointer is returned and both input lists (of type AVFilterFormats resp. AVFilterChannelLayouts) are to be treated as if they had been freed; the owners of the input parameters (if any) become owners of the returned list. If merging does not succeed, NULL is returned and both input lists are supposed to be unchanged. The problem is that the functions did not abide by these semantics: In case of reallocation failure, it is possible for these functions to return NULL after having already freed one of the two input list. This happens because sometimes the refs-array of the destined output gets reallocated twice to its final size and if the second of these reallocations fails, the first of the two inputs has already been freed and its refs updated to point to the destined output which in this case will be freed immediately so that all of the already updated pointers are now dangling. This leads to use-after-frees and memory corruptions lateron (when these owners get cleaned up, the lists they own get unreferenced). Should the input lists don't have owners at all, the caller (namely can_merge_formats() in avfiltergraph.c) thinks that both the input lists are unchanged and need to be freed, leading to a double free. The solution to this is simple: Don't reallocate twice; do it just once. This also saves a reallocation. This commit fixes the issue behind Coverity issue #1452636. It might also make Coverity realize that the issue has been fixed. 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: remove dead code.Nicolas George2020-05-23
| | | | | Move the contents of all_channel_layouts.inc directly into libavfilter/tests/formats.c.
* lavfi/formats: add ff_formats_pixdesc_filter().Nicolas George2020-05-23
|
* avfilter/formats: remove unnecessary unreferenceZhao Zhili2019-10-08
|
* avfilter/formats: guard against double freePaul B Mahol2019-10-07
|
* avfilter/formats: remove support for deprecated channel count specificationMarton Balint2018-01-20
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/formats: fix wrong function name in error messageJun Zhao2017-12-13
| | | | | | | | Use perdefined micro __FUNCTION__ rather than hard coding function name to fix wrong function name in error message. Signed-off-by: Jun Zhao <jun.zhao@intel.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/formats: do not allow unknown layouts in ff_parse_channel_layout if ↵Marton Balint2017-01-24
| | | | | | | | | | | | | nret is not set Current code returned the number of channels as channel layout in that case, and if nret is not set then unknown layouts are typically not supported. Also use the common parsing code. Use a temporary workaround to parse an unknown channel layout such as '13c', after a 1 year grace period only '13C' will work. Signed-off-by: Marton Balint <cus@passwd.hu>
* 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 'd12b5b2f135aade4099f4b26b0fe678656158c13'Derek Buitenhuis2016-05-11
|\ | | | | | | | | | | | | | | * commit 'd12b5b2f135aade4099f4b26b0fe678656158c13': build: Split test programs off into separate files Some conversions done by: James Almer <jamrial@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avfilter/formats: fix leak of formats on errorPaul B Mahol2016-01-07
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avfilter: add SOFAlizer audio filterPaul B Mahol2015-12-12
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavfi/formats: fix segfault when allocation failsGanesh Ajjanagadde2015-12-11
| | | | | | | | | | | | | | This is a somewhat subtle failure that can occur when the realloc_array fails in FORMATS_REF. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avfilter/all: propagate errors of functions from avfilter/formatsGanesh Ajjanagadde2015-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge commit 'ae25413daf42a06f078ed81bb545ec23a8e0b482'Hendrik Leppkes2015-09-29
|\| | | | | | | | | | | | | * commit 'ae25413daf42a06f078ed81bb545ec23a8e0b482': lavfi: do not exclude hwaccel formats from ff_all_formats() Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavfi: do not exclude hwaccel formats from ff_all_formats()Anton Khirnov2015-09-28
| | | | | | | | It should be possible to pass hwaccel frames through lavfi.
* | libavfilter/formats: Fix parsing of channel specifications with a trailing 'c'.Simon Thelen2015-06-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avfilter/formats: Add test for ff_parse_channel_layout()Michael Niedermayer2015-06-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>