Commit Graph

641 Commits

Author SHA1 Message Date
Andreas Rheinhardt 260d7d5a6c avfilter/avfilter: Fix compilation with TRACE defined
av_get_pix_fmt_name() is used in an ff_tlog(), which is only
compiled if TRACE is defined. Fixes a regression caused by
f2b79c5b85.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 18:22:20 +02:00
Andreas Rheinhardt f2b79c5b85 lib*/version: Move library version functions into files of their own
This avoids having to rebuild big files every time FFMPEG_VERSION
changes (which it does with every commit).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 06:49:32 +02:00
Anton Khirnov 1b7ecb3eef avfilter: handle duplicates in the options string
Use the same logic as fftools/cmdutils - when a flag-type option starts
with [+-], append it to the existing value.
2022-03-22 18:49:43 +01:00
Anton Khirnov a0f04433f4 avfilter: simplify processing child context options
THe call to av_opt_set() is redundant, since the option is written in
the options dict, which is later passed to avfilter_init_dict().
2022-03-22 18:49:43 +01:00
Martin Storsjö 288313a8b2 libavfilter: Split version.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:05:26 +02:00
James Almer 1f96db959c avfilter: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:46 -03:00
Nicolas George 531d09fb2d lavfi: add ff_inoutlink_check_flow() 2022-02-20 12:38:52 +01:00
Andreas Rheinhardt 2761a7403b avfilter/avfilter: Make ff_tlog_ref() static
It allows compilers to inline the one and only call to this function
in its caller or even to optimize it away completely (this function
is empty in case TRACE is not defined).

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-03 22:54:54 +02:00
Andreas Rheinhardt c1f7e62810 avfilter/avfilter: Remove unused buffer
Unused since the removal of ff_get_ref_perms_string() in
a05a44e205.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-02 16:20:42 +02:00
Andreas Rheinhardt 1ea3650823 Replace all occurences of av_mallocz_array() by av_calloc()
They do the same.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 01:03:52 +02:00
Andreas Rheinhardt 10ad3cd798 avfilter/avfilter: Actually error out on init error
Currently an error from init could be overwritten by successfully
setting the enable expression.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-17 16:17:26 +02:00
Andreas Rheinhardt dc2279a4f2 avfilter/avfilter: Remove unused count
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-13 16:05:15 +02:00
James Almer 61b38f7aef avfilter/avfilter: add a return at the end of a non-void function
Fixes compilation with GCC 11 when configured with "--disable-optimizations --toolchain=gcc-tsan"

Signed-off-by: James Almer <jamrial@gmail.com>
2021-08-24 09:36:21 -03:00
Andreas Rheinhardt f308f37441 avfilter/avfilter: Allow to free non-static pads generically
This can be enabled/disabled on a per-pad basis by setting
the AVFILTERPAD_FLAG_FREE_NAME flag; variants of ff_append_(in|out)pads
that do this for you have been added and will be put to use in the
following commits.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-22 16:13:25 +02:00
Andreas Rheinhardt dff1709eb2 avfilter/internal: Uninline ff_insert_(in|out)pad()
These functions are not hot at all.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-22 16:12:06 +02:00
Andreas Rheinhardt e88db774d8 avfilter/avfilter: Deprecate avfilter_pad_count()
It is unnecessary as the number of static inputs and outputs can now
be directly read via AVFilter.nb_(in|out)puts.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-20 14:29:46 +02:00
Andreas Rheinhardt 7c5f998196 avfilter/avfilter: Add avfilter_filter_pad_count()
It is intended as replacement for avfilter_pad_count(). In contrast to
the latter, it avoids a loop.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-20 13:19:59 +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 515e7fbce1 avfilter/avfilter: Remove unused feature to add pads in the middle
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-17 21:20:59 +02:00
Andreas Rheinhardt 1e35744a4c avfilter/internal: Replace AVFilterPad.needs_writable by flags
It will be useful in the future when more flags are added.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-17 21:10:45 +02:00
Andreas Rheinhardt 90550856e5 avfilter/avfilter: Remove redundant assignment
av_frame_copy_props() already copies pts.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-17 19:12:45 +02:00
Andreas Rheinhardt 7b0e63b7d5 avfilter: Remove init_opaque callback
The last init_opaque callback has been removed in commit
07ffdedf784e86b88074d8d3e08e55752869562a; the opaque argument has been
always NULL since 0acf7e268b.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-16 17:16:09 +02:00
Andreas Rheinhardt 35b1f46d79 avfilter/avfilter: Use av_memdup where appropriate
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-11 16:49:20 +02:00
Andreas Rheinhardt 304cb08693 avfilter/avfilter: Remove unused partial_buf
It is unused since 02aa0701ae.
The corresponding size field is write-only since then.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-05 17:53:43 +02:00
Paul B Mahol c317862c88 avfilter/avfilter: add sample_count_in and sample_count_out 2021-08-05 15:42:48 +02:00
Andreas Rheinhardt 6e66e2c321 avfilter/internal: Don't include framepool.h, thread.h
They are not used by the header at all and only used by very few files;
so include the headers in their users instead of in internal.h.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-04 03:03:25 +02:00
James Almer e0b84d1069 avfilter/avfilter: use av_frame_copy() to copy frame data
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-08-03 18:41:31 -03:00
James Almer 0bf3a7361d avutil: remove deprecated AVClass.child_class_next
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:04 -03:00
Andreas Rheinhardt 4de2b035a7 avfilter/avfilter: Remove deprecated avfilter_link_set_closed()
Deprecated in 39a09e995d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:11 -03:00
Andreas Rheinhardt 3a370868dc avfilter: Remove deprecated avfilter_link_get_channels
Deprecated in b2c42fc6dc.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:11 -03:00
Andreas Rheinhardt 1ec87f50f4 avfilter/avfilter: Remove compatibility code for old filter options
Added in ad7d972e08dddb1788ac6a434d1be314febcb09d; the old syntax has
been deprecated in b439c992c2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:10 -03:00
Andreas Rheinhardt fec3c730e6 avfilter/avfilter: Remove avfilter_link_set_closed() on bump
Deprecated in 39a09e995d.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-07 15:18:35 +01:00
Paul B Mahol 6317d40d08 avfilter/avfilter: move enable_str expression parsing into avfilter_init_dict()
This ensures that needed arrays are always allocated and properly initialized.

Previously if code would use only avfilter_init_dict() to set options for filters
it would not allocate arrays for timeline processing thus it would crash if
user supplied enable option for filter(s).
2021-02-06 11:40:59 +01:00
Paul B Mahol b4ad669a42 avfilter/avfilter: mark enable as runtime option too 2021-02-03 15:51:40 +01:00
Paul B Mahol 84327e4607 avfilter/avfilter: remove obsolete comment 2020-09-10 11:24:58 +02:00
Nicolas George 2f76476549 lavfi: regroup formats lists in a single structure.
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/*(.)
2020-09-08 14:02:40 +02:00
Andreas Rheinhardt ae5369128a avfilter/avfilter: Fix indentation
Forgotten after fdd93eabfb.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-26 00:15:14 +02:00
Anton Khirnov aba98de6b8 avfilter: switch to child_class_iterate() 2020-06-10 12:36:44 +02:00
Carl Eugen Hoyos 96fab29e96 Silence "string-plus-int" warning shown by clang.
libswscale/utils.c:89:42: warning: adding 'unsigned long' to a string does not append to the string [-Wstring-plus-int]
2020-01-06 22:38:56 +01:00
Nicolas George 65e6850c56 lavfi: remove ff_poll_frame().
It is never used.
2019-12-23 13:03:38 +01:00
leozhang 4a3aa77d74 avfilter/avfilter: fix indentation
Signed-off-by: leozhang <leozhang@qiyi.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-11-21 21:26:12 +01:00
Paul B Mahol a918b833a5 avfilter/avfilter: add ff_filter_process_command() 2019-10-14 11:28:54 +02:00
Paul B Mahol 7d65fe87e9 avfilter: add ff_inlink_queued_samples() 2018-10-04 12:10:20 +02:00
Marton Balint 8f14170b9a avfilter/filters: add ff_inlink_peek_frame and ff_inlink_queued_frames to access frames in the inlink fifo
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-10-03 22:09:49 +02:00
Paul B Mahol 4c514edc5b avfilter/avfilter: fix typos in comments 2018-10-03 19:11:52 +02:00
Jun Zhao fe06ed22e6 lavfi: fix can't dispaly "slice" sub-option in "ffmpeg -h full"
fix can't dispaly "slice" sub-option in "ffmpeg -h full" for
 AVFilter options.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-08-16 19:45:07 +08:00
Josh de Kock 8f1382f80e lavfi: add new iteration API
Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-03-31 23:26:30 +01:00
Mark Thompson bcab11a1a2 Merge commit '6d86cef06ba36c0ed591e14a2382e9630059fc5d'
* commit '6d86cef06ba36c0ed591e14a2382e9630059fc5d':
  lavfi: Add support for increasing hardware frame pool sizes

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-02-12 22:28:12 +00:00
Mark Thompson 6d86cef06b lavfi: Add support for increasing hardware frame pool sizes
AVFilterContext.extra_hw_frames functions identically to the field of
the same name in AVCodecContext.
2018-02-11 22:11:06 +00:00
James Almer b2c42fc6dc avfilter: deprecate avfilter_link_get_channels()
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-06 11:01:16 -03:00