Commit Graph

931 Commits

Author SHA1 Message Date
Luca Barbato ec11ff8407 drawtext: manage memory allocation better
Call dtext_prepare_text as early as possible
Do not draw if the memory allocation failed
2011-12-03 01:35:28 +01:00
Luca Barbato a2fb4bcb01 drawtext: refactor draw_text
Split the memory allocation from the actual drawing.
2011-12-03 01:35:28 +01:00
Mans Rullgard cc276c85d1 Make channel layout masks unsigned
It makes more sense for a bit mask to use an unsigned type.
The change should be source and binary compatible on all
supported systems, hence micro version bump.

Fixes a few invalid shifts.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-11-25 13:19:54 +00:00
Ronald S. Bultje 43317fd52c libavfilter: reindent. 2011-11-05 07:01:39 -07:00
Ronald S. Bultje 23a8b4ddfc avfilter: don't abort() on zero-size allocations. 2011-11-05 06:59:27 -07:00
Alex Converse 0d7a16a946 avfilter: Don't copy garbage from the stack when setting up video pictures. 2011-11-03 15:54:04 -07:00
Diego Biurrun 959cfbf3f4 vsrc_testsrc: fix mailing list reference URL 2011-11-02 10:42:55 +01:00
Diego Biurrun 124e28847b Remove some stray unnecessary ffmpeg references. 2011-11-02 10:42:54 +01:00
Stefano Sabatini ec2ac9271c lavfi: add rgbtestsrc source, ported from MPlayer libmpcodecs
The licence was changed from GPL to LGPL with explicit approval from
the original author.

See thread:
Subject: [FFmpeg-devel] [PATCH] lavfi: add rgbtestsrc source,
        ported from MPlayer libmpcodecs
Date: Mon, 11 Jul 2011 16:32:41 +0200

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-19 07:09:08 +02:00
Stefano Sabatini 0244879f30 lavfi: add testsrc source
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-19 07:08:42 +02:00
Stefano Sabatini b157be1f38 lavfi: port libmpcodecs delogo filter
The ported filter supports named option parsing and more YUV formats.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-17 18:05:41 +02:00
Stefano Sabatini ce6b6ef645 lavfi: port boxblur filter from libmpcodecs
With the following additions:
* support to gray format
* support to yuva420p format
* parametric luma/chroma/alpha radius
* consistency check on the radius values, avoid crashes with invalid values

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-17 18:05:41 +02:00
Stefano Sabatini 171868e25a lavfi: add negate filter
This filter is a simple wrapper around the LUT filter.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-17 18:05:41 +02:00
Stefano Sabatini 8fe0c527f3 lavfi: add LUT (LookUp Table) generic filters
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-17 18:05:38 +02:00
Anton Khirnov 145f741e11 AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_* 2011-10-12 16:51:16 +02:00
Stefano Sabatini 1ee2014190 vf_unsharp: set default chroma size value to 5x5
The previous default value 0x0 was not good, since it is not even
valid.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-29 07:20:05 +02:00
Stefano Sabatini 998e8519ef vf_unsharp: fix out-of-buffer read
In apply_unsharp(), when y is >= height, prevent out-of-buffer reading
from src, read from the last buffer line in src2 instead.

The check was implemented in the original unsharp libmpcodecs code and
lost in the port.

This also fixes output discrepancy between the two filters.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-29 07:19:30 +02:00
Stefano Sabatini 1c257dc32d vf_unsharp: store hsub/vsub in the filter context
Also drop obfuscating CHROMA_WIDTH/HEIGHT macros.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:09:18 +02:00
Stefano Sabatini e6d17ba426 vf_unsharp: adopt a more natural order of params in apply_unsharp()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:09:03 +02:00
Stefano Sabatini de7b58da3e vf_unsharp: rename method "unsharpen" to "apply_unsharp"
More consistent with the original libmpcodecs code, and the name
"unsharpen" was confusing.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:08:56 +02:00
Michael Niedermayer d33e0c6bc8 vf_scale: apply the same transform to the aspect during init that is applied per frame
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:08:30 +02:00
Stefano Sabatini 80de930a78 vf_pad: fix "vsub" variable value computation
It was shifting 2 rather than 1, +10l.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:03:30 +02:00
Stefano Sabatini 46b29397a6 vf_scale: add a "sar" variable
Also create a "dar" alias for the "a" variable, for avoiding possible
confusion between dar/sar.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:03:24 +02:00
Stefano Sabatini 0ec56d1144 lavfi: fix realloc size computation in avfilter_add_format()
Replace sizeof((*avff)->formats)
with    sizeof(*(*avff)->formats)

as the size of the array element is given by the pointed element
rather than by its pointer.

In particular fix computation with the pending patch when
sizeof(int64_t) != sizeof(int64_t *).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:03:18 +02:00
Stefano Sabatini e63e4c99c9 vsrc_color: use internal timebase
Avoid timescale conversion, simplify.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:03:11 +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 64abd375ec graphparser: prefer void * over AVClass * for log contexts
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-28 08:02:42 +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
Stefano Sabatini be4e8908d2 vf_yadif: add support to yuva420p
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-21 09:00:24 +02:00
Stefano Sabatini 4703a7b50b vf_yadif: correct documentation on the parity parameter
0 is top-field-first, 1 is bottom-field-first, not the other way
around.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-21 08:59:58 +02:00
Joakim Plate 5feb67f8a1 vf_yadif: copy buffer properties like aspect for second frame as well
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-21 08:59:36 +02:00
Joakim Plate ab09df9dea vf_yadif: add an option to enable/disable deinterlacing based on src frame "interlaced" flag
Signed-off-by: Joakim Plate <elupus@ecce.se>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-19 12:44:22 +02:00
Stefano Sabatini 91aff2665d vsrc_color: set output pos values to -1
-1 is more correct than 0, as the position in the file is undefined.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-19 12:44:02 +02:00
Stefano Sabatini 753890d0db vsrc_color: add @file doxy
Also remove outdated reference to color in vf_pad.c.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-19 12:43:25 +02:00
Stefano Sabatini deb58ab447 vsrc_buffer: remove duplicated file description
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-19 12:43:10 +02:00
Stefano Sabatini d763fb7d47 lavfi: add select filter
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-17 19:08:30 +02:00
Bobby Bingham 615baa13e4 lavfi: add split filter from soc.
Some fixes by Stefano.
For detailed authorship see SOC repo

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-12 08:48:16 +02:00
Stefano Sabatini ee42716b07 lavfi: add showinfo filter
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-12 08:48:14 +02:00
Anton Khirnov 79eff91325 AVOptions: deprecate av_opt_set_defaults2
It's a hack which was created to allow for multiple options with
different defaults to refer to same field (e.g. 'b' vs 'ab'). There is
no need for it anymore.
2011-09-07 11:19:43 +02:00
Michael Niedermayer 52982dbe47 vf_scale: don't leak SWS context.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-08-27 17:23:45 +02:00
Diego Biurrun 0249478756 doxygen: fix wrong comment syntax, //< vs. ///< 2011-08-26 18:34:28 +02:00
Stefano Sabatini 9bc8bcddbd vf_libopencv: replace opencv/cxtypes.h #include by opencv/cxcore.h
cxtypes.h works with version 2.1 and older, cxcore.h works with 2.2 and older.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-07-18 12:33:13 +02:00
Diego Biurrun 96c1e6d40d doxygen: Make sure parameter names match between .c and .h files. 2011-07-14 04:09:49 +02:00
Mans Rullgard 28e1c97916 build: rework rules for things in the tools dir
Declaring tools associated with each library in their respective
makefiles allows these tools to easily depend on the correct
prerequisites and link against the libs they need.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-10 21:13:38 +01:00
Anton Khirnov a67c061e0f lavf: add avformat_find_stream_info()
It supports passing options to codecs.
2011-07-10 17:07:05 +02:00
Anton Khirnov 0b950fe240 lavc: introduce avcodec_open2() as a replacement for avcodec_open().
Adds support for decoder-private options and makes setting other options
simpler.
2011-07-10 17:06:22 +02:00
Diego Biurrun 965fdda015 vf_drawtext: Remove some write-only variables.
libavfilter/vf_drawtext.c:427:22: warning: variable 'dst_pixel' set but not used
libavfilter/vf_drawtext.c:463:22: warning: variable 'dst_pixel' set but not used
2011-07-07 17:32:50 +02:00
Diego Biurrun d3f751e603 Add some missing mathematics.h #includes for av_rescale(). 2011-07-05 20:16:38 +02:00
Loren Merritt 082768f0b1 vf_gradfun: relicense x86 asm to LGPL
Actually I gave permission for LGPL long ago, but the original import
failed to update the license header.
2011-07-04 00:01:47 +00:00
Mans Rullgard abc78a5a7c Do not include log.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:07 +01:00
Mans Rullgard d49ea4afb4 Do not include pixfmt.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:07 +01:00
Mans Rullgard e91709ca17 Do not include rational.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:06 +01:00
Mans Rullgard 0ebcdf5cda Do not include mathematics.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:06 +01:00
Diego Biurrun 24c9babaaf doxygen: Fix parameter names to match the function prototypes. 2011-07-03 18:30:02 +02:00
Mans Rullgard 57b4a3dd2b build: include sub-makefiles using full path instead of symlinks
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-28 18:15:19 +01:00
Diego Biurrun a6213f3dce build: Remove redundant config.mak includes from subdirectory Makefiles.
Calling Make from subdirectories is not supported and config.mak has
multiple inclusion guards anyway, so the top-level include is enough.
2011-06-25 13:02:51 +02:00
Justin Ruggles e6c52cee54 Replace usages of av_get_bits_per_sample_fmt() with av_get_bytes_per_sample().
av_get_bits_per_sample_fmt() is deprecated.
2011-06-20 18:56:06 -04:00
Stefano Sabatini 5a0a6ae639 ocv: replace FF_INTERNAL_MEM_TYPE_MAX_VALUE with SIZE_MAX
Fix compilatin after removal of FF_INTERNAL_MEM_TYPE_MAX_VALUE.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-20 20:54:40 +02:00
Stefano Sabatini 702a62a1c6 drawtext: add braces around initialisers for option defaults
Fix warnings of the type:
vf_drawtext.c:NNN: warning: missing braces around initializer
vf_drawtext.c:NNN: warning: (near initialization for ‘drawtext_options[X].default_val’)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-20 20:54:40 +02:00
Stefano Sabatini 53a715f576 drawtext: reindent after the previous commit
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-20 20:54:40 +02:00
Stefano Sabatini 3fd53defaa drawtext: fix strftime() text expansion
The feature was dropped after the filter was partially rewritten and
recommitted.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-20 20:54:40 +02:00
Anton Khirnov 603b8bc2a1 Deprecate av_open_input_* and remove their uses.
Deprecate the last remaining member of AVFormatParameters.
2011-06-16 20:24:56 +02:00
Mans Rullgard e65ab9d94f Remove unused variables 2011-06-02 20:06:00 +01:00
Diego Biurrun b0a4e5f9e7 Employ correct printf format specifiers, mostly in debug output. 2011-05-31 23:45:14 +02:00
Diego Biurrun 5ac4952a58 vf_drawtext: Replace FFmpeg by Libav in license boilerplate. 2011-05-31 21:15:49 +02:00
Diego Biurrun d6e0729b24 avfilter: Surround function only used in debug mode by appropriate #ifdef.
This fixes the warning:
libavfilter/avfilter.c:219: warning: ‘ff_get_ref_perms_string’ defined but not used
2011-05-29 13:43:03 +02:00
Diego Biurrun 2146f4928a vf_crop: Replace #ifdef DEBUG + av_log() by av_dlog(). 2011-05-29 13:43:02 +02:00
Stefano Sabatini 75abcdb391 vsrc_buffer.h: add file doxy
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-24 14:22:51 +02:00
Stefano Sabatini f7053dc41a vsrc_buffer: tweak error message in init()
Change:
Expected 7 arguments, but only %d found in '%s'\n
to:
Expected 7 arguments, but %d found in '%s'\n

as the user may provide more than 7 arguments, in that case the error
is not misleading.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-24 14:21:20 +02:00
Diego Biurrun 153382e1b6 multiple inclusion guard cleanup
Add missing multiple inclusion guards; clean up #endif comments;
add missing library prefixes; keep guard names consistent.
2011-05-21 13:48:10 +02:00
Stefano Sabatini 5dc65a3d03 lavfi: print key-frame and picture type information in ff_dlog_ref()
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
(cherry picked from commit f7bdffb09d)
2011-05-16 14:13:03 -07:00
Anton Khirnov b66752790a AVOptions: make default_val a union, as proposed in AVOption2.
This breaks API and ABI.
2011-05-10 20:22:06 +02:00
Michael Niedermayer c5420f100f drawtext: add shadow support.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-07 10:21:56 +02:00
Michael Niedermayer e73127a443 drawtext: factor draw_glyphs.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-07 10:21:56 +02:00
Michael Niedermayer a5b81c317e drawtext: fix and optimize yuv blend.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-07 10:21:53 +02:00
Michael Niedermayer 3953a88014 drawtext: get rid of divisions in the inner loop.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-07 10:18:16 +02:00
Michael Niedermayer e74bf3f368 drawtext: simplify chroma blend and fix chroma alpha.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-07 10:18:16 +02:00
Stefano Sabatini a5b64584f3 lavfi: Port drawtext filter by Hemanth from the libavfilter soc repo
With the following additions:
* support to anti-aliased glyph rendering
* support to UTF-8 text and Unicode chars rendering
* support for RGB packed formats
* fix minor errors and typos in the filter description
* extend/clarify examples in the filter description

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-07 10:17:40 +02:00
Ronald S. Bultje 0699dbb847 avfilter: check malloc return values. 2011-05-03 22:35:23 -04:00
Ronald S. Bultje f8af93ab99 avfilter: don't av_malloc(0). 2011-05-03 22:29:13 -04:00
Diego Biurrun a3b7dabb5b vf_fieldorder: Replace FFmpeg by Libav in license boilerplate. 2011-04-29 15:00:08 +02:00
Peter Ross c90626b2ea hflip: make the filter accept PIX_FMT_BGR48LE and PIX_FMT_BGR48BE pixel formats
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-28 07:25:27 +02:00
Peter Ross a1f4d07563 crop: make the filter accept PIX_FMT_BGR48LE and PIX_FMT_BGR48BE pixel formats
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-28 07:25:27 +02:00
Stefano Sabatini bebe72f4a0 lavc: deprecate FF_*_TYPE macros in favor of AV_PICTURE_TYPE_* enums
Also deprecate av_get_pict_type_char() in favor of
av_get_picture_type_char().

The new enum and av_get_picture_type_char() are defined in libavutil.
This allows the use in libavfilter without the need to link against
libavcodec.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 08:38:57 +02:00
Stefano Sabatini 73a4f7c21b pad: make the filter parametric
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:43:34 +02:00
royger 0bbb28c75b vsrc_movie: add key_frame and pict_type.
Signed-off-by: Roger Pau Monné <roger.pau@entel.upc.edu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:43:16 +02:00
Stefano Sabatini 5eb901cfec vsrc_movie: fix leak in request_frame()
Also set movie->picref to NULL, in order to avoid a crash in uninit()
when movie->picref is unreffed again and it was already freed.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:42:56 +02:00
Roger Pau Monné 10d39405fa lavfi: add key_frame and pict_type to AVFilterBufferRefVideo.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:42:13 +02:00
Michael Niedermayer 7a11c82fb7 vsrc_buffer: add sample_aspect_ratio fields to arguments.
This fixes aspect handling in ffmpeg.

This is based on a patch by Baptiste.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:38:24 +02:00
Mark Himsley 2f84bb4236 lavfi: add fieldorder filter
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:37:41 +02:00
Stefano Sabatini 68e23c083a scale: make the filter parametric
Make the filter accept parametric expressions for the output video
size.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:29:29 +02:00
James Darnley b137bf7df3 yadif: support 16-bit
Fixes by Michael Niedermayer <michaelni@gmx.at>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:21:40 +02:00
James Darnley 88312a4de3 yadif: support more than yuv420p.
and correctly support grey8

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:15:54 +02:00
Michael Niedermayer d85e18e6e3 yadif: Fix assert() failure
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:15:10 +02:00
Stefano Sabatini f80b381bfd graphparser: add a NULL check on the argument passed to strstr
Fix crash in create_filter() which occurrs if a scale filter with no
args is provided.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-25 22:45:44 +02:00
Stefano Sabatini c61bfc113a setdar: prefer "sar" over "par" in log info message
This is more consistent with the terminology adopted by the aspect
filter names.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-25 22:45:44 +02:00
Mark Himsley b04d1abb40 fade: fix draw_slice() check on fade->factor value
draw_slice() checks that the fade factor is < 65536 and only
calculates the fade if so. But the fade factor is clipped in
end_frame() by av_clip_uint16() to 65535, so the fade is calculated
for every frame.  This patch alters the check so that it compares with
< 65535 (UINT16_MAX).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-25 22:45:44 +02:00
Mark Himsley 9026b27e84 fade: make draw_slice() chroma check against planes 1 and 2
draw_slice() checks that planes 0 and 1 of AVFilterBufferRef's data
are not NULL before manipulating planes 1 and 2. This patch makes the
check against planes 1 and 2. More senseful and possibly more robust.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-25 22:45:44 +02:00
Michael Niedermayer 14e3b120ad Reduce picture size for yadif.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-20 17:38:19 +02:00
Anton Khirnov 139f3ac42d Bump major versions of all libraries.
They've accumulated enough new APIs and corresponding deprecated cruft.

This breaks API and ABI.
2011-04-18 20:19:47 +02:00