Commit Graph

124 Commits

Author SHA1 Message Date
Anton Khirnov 0767bfd199 lavfi: allow user-provided execute() callbacks 2013-09-28 08:06:19 +02:00
Anton Khirnov 77cc958f60 lavfi: add const to the AVFilter parameter of avfilter_graph_create_filter()
This function should never modify the filter.
2013-08-04 15:46:19 +02:00
Diego Biurrun 7950e519bb Disable deprecation warnings for cases where a replacement is available 2013-08-02 19:19:02 +02:00
Anton Khirnov 129bb23843 lavfi: add a slice threading infrastructure
Mostly based on libavcodec's
2013-05-24 09:28:18 +02:00
Anton Khirnov b01f6041f4 lavfi: rename AVFilterFormats.format_count to nb_formats
This is more consistent with naming in the rest of Libav.
2013-05-17 20:29:50 +02:00
Anton Khirnov 096696ef0d avfiltergraph: simplify inserting conversion filters.
There is now no need to explicitly pass 0:0 as width/height to scale,
those are the defaults.
2013-05-15 07:45:51 +02:00
Anton Khirnov 48a5adab62 lavfi: add avfilter_init_str() to replace avfilter_init_filter().
Drop the unused opaque parameter from its signature.
2013-04-11 20:39:13 +02:00
Anton Khirnov 1565cbc65c lavfi: make avfilter_free() remove the filter from its graph. 2013-04-11 20:38:48 +02:00
Anton Khirnov 111367263a lavfi: add AVFilterContext.graph.
It will be useful in the following commits.
2013-04-11 20:38:23 +02:00
Anton Khirnov c2c9801bc9 lavfi: deprecate avfilter_graph_add_filter().
Since this function adds a standalone filter to a filter graph and we do
not support creating such filters, there is no reason for this function
to exist.
2013-04-11 20:36:42 +02:00
Anton Khirnov bc1a985ba0 lavfi: replace avfilter_open() with avfilter_graph_alloc_filter().
Since we do not support "standalone" filters not attached to an
AVFilterGraph, we should not have a public function to create such
filters. In addition that function is horribly named, the action it does
cannot be possibly described as "opening" a filter.
2013-04-11 20:34:14 +02:00
Anton Khirnov 38f0c0781a lavfi: merge avfiltergraph.h into avfilter.h
We do not support using filters without AVFilterGraph in practice
anyway, so there is no point in pretending we do.
2013-04-11 20:33:33 +02:00
Anton Khirnov 6d0546bbaf avfiltergraph: set deprecated filter_count. 2013-04-04 07:52:32 +02:00
Anton Khirnov 6e3c13a559 avfiltergraph: check for sws opts being non-NULL before using them.
Avoid snprintfing a NULL pointer.

CC: libav-stable@libav.org
2013-04-03 09:29:55 +02:00
Anton Khirnov dd74e3ef33 avfiltergraph: use sizeof(var) instead of sizeof(type) 2013-03-16 05:34:20 +01:00
Anton Khirnov 42c7c61ab2 avfiltergraph: replace AVFilterGraph.filter_count with nb_filters
This is more consistent with the naming in the rest of Libav.
2013-03-16 05:33:23 +01:00
Reimar Döffinger efa7f42020 Use the avstring.h locale-independent character type functions
Make sure the behavior does not change with the locale.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-07 15:16:36 +02:00
Justin Ruggles 9f1223562e lavfi: connect libavresample options to af_resample via AVFilterGraph 2013-02-23 17:07:54 -05: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
Anton Khirnov e3496e5dbe avfiltergraph: silence an uninitialized variable warning
The warning is:
libavfilter/avfiltergraph.c: In function ‘avfilter_graph_config’:
libavfilter/avfiltergraph.c:528:9: warning: ‘best_idx’ may be used uninitialized in this function [-Wuninitialized]
libavfilter/avfiltergraph.c:479:13: note: ‘best_idx’ was declared here

Initialize it to an invalid value and add an assert that it's properly
set later.
2012-09-17 15:48:20 +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
Justin Ruggles 743f07062a lavfi: better channel layout negotiation
Allow substitution of channel pairs in the input for nearby channel pairs in
the output in order to get a closer match. Also weigh LFE channel mismatch
differently to favor matching the same layout without LFE over one less
channel with LFE.
2012-07-27 14:15:33 -04:00
Anton Khirnov 61d158c321 avfiltergraph: shut up uninitialized variable warning.
The warning silenced was:
libavfilter/avfiltergraph.c: In function ‘avfilter_graph_config’:
libavfilter/avfiltergraph.c:500:13: warning: ‘best_idx’ may be used uninitialized in this function [-Wuninitialized]
2012-06-26 19:10:17 +02:00
Anton Khirnov 8d900aa4d0 lavfi: remove disabled FF_API_GRAPH_AVCLASS cruft 2012-06-26 13:14:59 +02:00
Anton Khirnov 58b049f2fa lavfi: support automatically inserting the fifo filter when needed.
This breaks libavfilter ABI.
2012-06-22 21:06:01 +02:00
Anton Khirnov 24b2f4ed21 avfiltergraph: remove a redundant call to avfilter_get_by_name(). 2012-06-13 13:58:03 +02:00
Anton Khirnov 2f296e39a1 lavfi: allow building without swscale. 2012-06-13 13:57:47 +02:00
Anton Khirnov 9baeff9506 lavfi: replace AVFilterContext.input/output_count with nb_inputs/outputs
This is more consistent with naming in the rest of Libav.
2012-06-13 11:13:22 +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
Anton Khirnov 8eb9bf0933 avfiltergraph: make some functions static.
They are not used outside of avfiltergraph.c
2012-06-04 14:17:39 +02:00
Anton Khirnov 43c7a01e98 lavfi: remove avfilter_default_* from public API on next bump.
Those functions are only useful inside filters. It is better to not
support user filters until the API is more stable.
2012-05-22 21:33:26 +02:00
Anton Khirnov ccefa89f39 avfiltergraph: smarter sample format selection. 2012-05-22 21:29:36 +02:00
Anton Khirnov fd127ede62 avfiltergraph: reindent 2012-05-14 21:36:10 +02:00
Anton Khirnov ff1f51a8aa lavfi: add channel layout/sample rate negotiation. 2012-05-14 21:36:10 +02:00
Anton Khirnov 012f04a277 lavfi: autoinsert resample filter when necessary. 2012-05-12 18:09:29 +02:00
Anton Khirnov 63736fe48c avfiltergraph: try to reduce format conversions in filters.
Current code, with a filterchain such as
(input - yuv411) -> (scale - any) -> (sink - any)
will result in yuv420 being chosen for the second link, which is clearly
not right.

This commit attempts to improve in the following way:
repeat until convergence:
  loop over all filters
    find input link with exactly one format
    force this format on all output links of the same type (if possible)
2012-04-01 09:04:09 +02:00
Anton Khirnov 996f9f0c32 avfiltergraph: add an AVClass to AVFilterGraph on next major bump.
It will be used for logging, possibly also AVOptions.
2012-04-01 09:03:35 +02:00
Stefano Sabatini 57fa314090 lavfi: fix signature for avfilter_graph_parse() and avfilter_graph_config()
Require "void *" rather than "AVClass *" for the log context type.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:02:53 +02:00
Stefano Sabatini 59cef18c24 avfiltergraph: use meaningful error codes
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:02:32 +02:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Stefano Sabatini 4359288c56 Make avfilter_graph_free() free the graph.
Make avfilter_graph_free() free not only the internal structures, but
also the allocated graph, and set the graph pointer to NULL for
increased safety.

Simplify usage.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-04 02:55:11 +00:00
Stefano Sabatini caeb0c3027 Make avfilter_graph_free() do nothing if graph is NULL.
Originally committed as revision 26323 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-12 21:23:16 +00:00
Stefano Sabatini b59dd1ea4f Fix style nits in avfiltergraph.c.
Originally committed as revision 26116 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-28 14:10:12 +00:00
Stefano Sabatini 037be76e15 Add avfilter_graph_create_filter().
Originally committed as revision 25862 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-02 20:12:27 +00:00
Stefano Sabatini 3fa77bde1b In libavfilter, use consistently "Copyright (c)" in the license
headers.

Originally committed as revision 25838 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-28 10:22:58 +00:00
Stefano Sabatini 4fcbb2af33 Prefix with "ff_" the functions:
ff_avfilter_graph_check_validity()
ff_avfilter_graph_config_links()
ff_avfilter_graph_config_formats()

and move their declaration to internal.h. These functions are never
used in application code, so it is better to consider them internal
functions, this can be changed later if necessary. Simplify API.

Originally committed as revision 25737 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-13 00:21:28 +00:00
Stefano Sabatini 24de0edbd5 Rename avfilter_destroy() as avfilter_free().
The new name is shorter and more consistent with the FFmpeg API, and
sounds less evil.

Originally committed as revision 25707 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-08 12:32:39 +00:00
Stefano Sabatini 97dd1e4a87 Rename avfilter_graph_destroy() to avfilter_graph_free().
The new name is shorter and more consistent with the rest of the API.

This change breaks libavfilter API/ABI.

Originally committed as revision 25674 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-04 20:34:24 +00:00
Stefano Sabatini e15aeea656 Implement avfilter_graph_alloc().
Originally committed as revision 25673 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-04 20:34:19 +00:00
Stefano Sabatini 2a24df9357 Add avfilter_graph_config().
Originally committed as revision 25502 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-16 10:20:53 +00:00