Commit Graph

575 Commits

Author SHA1 Message Date
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
Nicolas George
03c8fe49ea lavfi: remove request_samples.
Filters can use min_samples/max_samples if the number is constant
or activate and ff_inlink_consume_samples().
2020-08-20 18:55:19 +02:00
Nicolas George
4ca1fb9d2a lavfi: remove needs_fifo. 2020-08-20 18:55:19 +02:00
Zhao Zhili
0115dbd043 avfilter/avfilter: update documentation of avfilter_graph_create_filter 2019-12-23 17:02:55 +01:00
Zhao Zhili
2bfa7df9fe avfilter: fix typo in comments
Signed-off-by: mypopy@gmail.com
2019-10-14 15:02:20 -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
James Almer
da5b05c833 Revert "avfilter: deprecate avfilter_link_get_channels()"
This reverts commit 798dcf2432.

It was applied by accident before it could be reviewed.
2018-01-05 22:13:28 -03:00
James Almer
798dcf2432 avfilter: deprecate avfilter_link_get_channels()
And move the channels field to the public section of the struct.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-05 17:49:09 -03:00
James Almer
d1b1a65662 Merge commit '96a47364d1cf346a5d0437e054b1b10d44d8d969'
* commit '96a47364d1cf346a5d0437e054b1b10d44d8d969':
  lavfi: Drop deprecated non-const filter retrieval

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 15:40:14 -03:00
James Almer
de0b26ce28 Merge commit '8e18328b18e69b38a5feae5d10ad01b403a205b6'
* commit '8e18328b18e69b38a5feae5d10ad01b403a205b6':
  lavfi: Drop deprecated filter registration

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 15:37:34 -03:00
James Almer
5045cf27aa Merge commit '52067b3c0e5ddbcf7021a093420798420351a9e2'
* commit '52067b3c0e5ddbcf7021a093420798420351a9e2':
  lavfi: Drop deprecated filter initialization

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 15:35:14 -03:00
James Almer
7c4f63d05b Merge commit 'c5c7cfd5e80d4c36568c01cc40abfde341657ad9'
* commit 'c5c7cfd5e80d4c36568c01cc40abfde341657ad9':
  lavfi: Drop deprecated functions to open a filter or a filterchain

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 15:28:35 -03:00
Nicolas George
f8d7b5febb lavfi: add a preinit callback to filters.
It is necessary for filters with child objects, to set the class
and default options values.
2017-08-29 10:19:04 +02:00
Matthieu Bouron
b5e1ec5660 Merge commit 'e3fb74f7f9a8f1895381355f40c92cac3c1023d9'
* commit 'e3fb74f7f9a8f1895381355f40c92cac3c1023d9':
  lavfi: Always propagate hw_frames_ctx through links

Merged-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2017-03-30 00:02:08 +02:00
Vittorio Giovara
96a47364d1 lavfi: Drop deprecated non-const filter retrieval
Deprecated in 10/2013.
2017-03-23 10:09:11 +01:00
Vittorio Giovara
8e18328b18 lavfi: Drop deprecated filter registration
Deprecated in 04/2013.
2017-03-23 09:57:33 +01:00
Vittorio Giovara
52067b3c0e lavfi: Drop deprecated filter initialization
Deprecated in 03/2013.
2017-03-23 09:57:33 +01:00
Vittorio Giovara
c5c7cfd5e8 lavfi: Drop deprecated functions to open a filter or a filterchain
Deprecated in 03/2013.
2017-03-23 09:57:32 +01:00
Rostislav Pehlivanov
3796fb2692 lavfi: deprecate AVFilterGraph->resample_lavr_opts
Not used by anything at all since we don't auto insert lavr filters.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-03-18 07:37:35 +00:00
Nicolas George
3ff01feda3 lavfi: add AVFilter.activate. 2017-01-12 14:06:16 +01:00
Nicolas George
485617ea0f lavfi: document that AVFilterLink is not for applications. 2017-01-12 14:06:16 +01:00
Matthieu Bouron
b1f68f00b1 lavfi/framepool: rename FFVideoFramePool to FFFramePool 2017-01-12 10:22:52 +01:00
Nicolas George
02aa0701ae lavfi: make filter_frame non-recursive.
A lot of changes happen at the same time:

- Add a framequeue fifo to AVFilterLink.

- split AVFilterLink.status into status_in and status_out: requires
  changes to the few filters and programs that use it directly
  (f_interleave, split, filtfmts).

- Add a field ready to AVFilterContext, marking when the filter is ready
  and its activation priority.

- Add flags to mark blocked links.

- Change ff_filter_frame() to enqueue the frame.

- Change all filtering functions to update the ready field and the
  blocked flags.

- Update ff_filter_graph_run_once() to use the ready field.

- buffersrc: always push the frame immediately.
2016-12-18 10:38:52 +01:00
Nicolas George
183ce55b0d lavfi: split frame_count between input and output.
AVFilterLink.frame_count is supposed to count the number of frames
that were passed on the link, but with min_samples, that number is
not always the same for the source and destination filters.
With the addition of a FIFO on the link, the difference will become
more significant.

Split the variable in two: frame_count_in counts the number of
frames that entered the link, frame_count_out counts the number
of frames that were sent to the destination filter.
2016-11-13 10:41:16 +01:00
Mark Thompson
e3fb74f7f9 lavfi: Always propagate hw_frames_ctx through links
Also adds a new flag to mark filters which are aware of hwframes and
will perform this task themselves, and marks all appropriate filters
with this flag.

This is required to allow software-mapped hardware frames to work,
because we need to have the frames context available for any later
mapping operation in the filter graph.

The output from the filter graph should only propagate further to an
encoder if the hardware format actually matches the visible format
(mapped frames are valid here and have an hw_frames_ctx, but this
should not be given to the encoder as its hardware context).
2016-11-02 20:29:05 +00:00
Paul B Mahol
449339084f avfilter: add nb_threads to AVFilterContext
To be used in following commits.
2016-08-29 16:27:09 +02:00
Timothy Gu
58c7bf789f doxygen: Standardize root-level modules 2016-08-02 22:15:25 -07:00
Timo Rothenpieler
1a75145559 lavfi: Move new field to the end of AVFilterContext
This fixes an accidental ABI break introduced at 8688d3a.
2016-06-29 18:23:28 +02:00
Timo Rothenpieler
1eb43af1a0 lavfi: Move new field to the end of AVFilterLink
Even though this is not part of the public API, some external
applications access fields after it, thus breaking after updating from
ffmpeg 3.0 or earlier.
Since it is not public, it can be freely moved to the end to avoid
that problem in the future.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-29 12:53:07 +02:00
Vittorio Giovara
41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Derek Buitenhuis
8688d3af39 Merge commit '07a844f32ebb78503981df017fa3ebfedb75fe1c'
* commit '07a844f32ebb78503981df017fa3ebfedb75fe1c':
  lavfi: generic hardware surface upload and download filters

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-14 13:59:45 +01:00
Mark Thompson
07a844f32e lavfi: generic hardware surface upload and download filters
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-19 15:41:04 +01:00
Derek Buitenhuis
10424024a1 Merge commit 'b3dd30db0b2d857147fc0e1461a00bd6172a26a3'
* commit 'b3dd30db0b2d857147fc0e1461a00bd6172a26a3':
  lavfi: pass the hw frames context through the filter chain

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-24 16:03:57 +00:00
Anton Khirnov
b3dd30db0b lavfi: pass the hw frames context through the filter chain 2016-02-14 22:21:00 +01:00
Paul B Mahol
547d412078 avfilter: update some comments
start_frame is no more, samplesref argument is now frame argument.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-01-24 14:32:14 +01:00
Nicolas George
1655788712 lavfi: make request_frame() non-recursive.
Instead of calling the input filter request_frame() method,
ff_request_frame() now marks the link and returns immediately.
buffersink is changed to activate the marked filters until
a frame is obtained.
2015-12-22 16:04:30 +01:00
Nicolas George
108b4de552 lavfi: replace link.closed by link.status.
The status field can carry any error code instead of just EOF.
Also only update it through a wrapper function and provide a timestamp.
Update the few filters that used it directly.
2015-12-22 16:04:30 +01:00
Nicolas George
39a09e995d lavfi: deprecate avfilter_link_set_closed().
Applications are not supposed to mess with links,
they should close the sinks.
Furthermore, this function does not distinguish what end
of the link caused the close and does not have a timestamp.
2015-12-22 16:04:22 +01:00
Nicolas George
b8b7d5ac6c lavfi: add link.current_pts field. 2015-12-22 15:55:00 +01:00
Nicolas George
d03eab34dd lavfi: rename link.current_pts to current_pts_us.
This field is used for fast comparison between link ages,
it is in AV_TIME_BASE units, in other words microseconds,
µs =~ us.
Renaming it allows a second field in link time base units.
2015-12-22 15:55:00 +01:00
Matthieu Bouron
0c59d40ae0 lavfi: use a video frame pool for each link of the filtergraph 2015-12-15 10:35:41 +01:00
Hendrik Leppkes
0b73d0ff0d Merge commit '48ff6683ba5d40b629428673b1028e8ec542a9fa'
* commit '48ff6683ba5d40b629428673b1028e8ec542a9fa':
  lavfi: add a frame_rate field to AVFilterLink.

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-11 14:47:29 +01:00
Nicolas George
48ff6683ba lavfi: add a frame_rate field to AVFilterLink.
(cherry picked from ffmpeg commit 7b42036b3b)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-11-09 08:09:34 +01:00
Nicolas George
2a351f6c55 lavfi: drop the requirement that request_frame returns a frame.
It requires a loop in filters or the framework,
that makes the scheduling less efficient and more complex.
This is purely an internal change since the loop is now
present in buffersink.
Note that no filter except buffersink did rely on the requirement.
2015-09-20 19:02:33 +02:00
Hendrik Leppkes
3433228795 lavfi: remove old graph parser API with different semantics
This API hasn't been active since the last bump already.
2015-09-05 18:35:09 +02:00
Hendrik Leppkes
144fb06806 Remove left-over FF_API_AVFILTERBUFFER cruft 2015-09-05 16:27:19 +02:00
Hendrik Leppkes
033764e015 Merge commit 'f6974fe651d29ef6eb68d66d73f7b6c011062aa0'
* commit 'f6974fe651d29ef6eb68d66d73f7b6c011062aa0':
  lavfi: Drop deprecated AVFilterBuffer* code

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 16:22:03 +02:00