Anton Khirnov
fd9212f2ed
Mark some arrays that never change as const.
8 years ago
Diego Biurrun
8ddfa5ae5e
vf_drawtext: Drop wrong void* cast
libavfilter/vf_drawtext.c:844:49: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
9 years ago
Diego Biurrun
85baef4ff1
vf_drawtext: Move static keyword to beginning of variable declaration
libavfilter/vf_drawtext.c:226:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
9 years ago
Luca Barbato
98c9ade985
drawtext: Move the strftime expansion in a separate function
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years ago
Luca Barbato
fe026ba960
drawtext: Drop stray guards
There is a fallback for localtime_r and it is in use already.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years ago
Luca Barbato
9b2c57bef5
drawtext: Add an alpha option
And document both `draw` and `alpha`.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
10 years ago
Vittorio Giovara
1a3eb042c7
Replace av_dlog with normal av_log at trace level
This applies to every library where performance is not critical.
10 years ago
Михаил Муковников
71f29410e7
lavfi: Increase drawtext font size limits
Raise the maximum font size to a larger value.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
10 years ago
Martin Storsjö
6b9b42cc55
drawtext: Remove the ifdef for localtime_r
If it isn't available in the system, we've got a fallback to
the normal localtime function, so normal code can assume it is
available as long as time_internal.h is included.
Signed-off-by: Martin Storsjö <martin@martin.st>
10 years ago
Luca Barbato
f401792595
vf_drawtext: Do not leak the mmapped textfile
And validate its size while at it.
CC: libav-stable@libav.org
Bug-Id: CID 1244189
10 years ago
Vittorio Giovara
58400ac133
lavfi: name anonymous structs
11 years ago
Luca Barbato
f1b239ec8b
drawtext: Add fontconfig support
Introduce the `font` option and make it optional to pass a fontfile.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years ago
Luca Barbato
d68dc3c944
drawtext: Drop pointless header
It should be forward compatible with newer freetype.
11 years ago
Anton Khirnov
cd43ca0443
lavfi: do not export the filters from shared objects
11 years ago
Anton Khirnov
3fb29588a2
vf_drawtext: don't leak the expressions.
12 years ago
Anton Khirnov
90d9a2a04c
vf_drawtext: do not reset the frame number in config_input.
Frame number should be incremented normally even if the link properties
change.
12 years ago
Anton Khirnov
d3735f7ad6
vf_drawtext: use the name 's' for the pointer to the private context
This is shorter and consistent across filters.
12 years ago
Anton Khirnov
c43a7ecad9
lavfi: remove now unused args parameter from AVFilter.init
12 years ago
Anton Khirnov
8ec464c61c
vf_drawtext: switch to an AVOptions-based system.
12 years ago
Anton Khirnov
7e350379f8
lavfi: switch to AVFrame.
Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it
and use AVFrame instead.
12 years ago
Anton Khirnov
cb45553f57
Remove pointless #undefs of previously forbidden functions.
12 years ago
Anton Khirnov
565e4993c6
lavfi: merge start_frame/draw_slice/end_frame
Any alleged performance benefits gained from the split are purely
mythological and do not justify added code complexity.
12 years ago
Anton Khirnov
b68aac7ea3
vf_drawtext: do not use deprecated av_tree_node_size
12 years ago
Anton Khirnov
59ee9f78b0
lavfi: do not use av_pix_fmt_descriptors directly.
12 years ago
Mans Rullgard
568c70e79e
lavfi: convert input/ouput list compound literals to named objects
A number of compilers, for example those from TI and IBM, choke on
these initialisers. The current style is also quite ugly.
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Martin Storsjö
e6153f173a
avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
d58dd4b5b5
avopt: Store defaults for AV_OPT_TYPE_FLAGS in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
124134e424
avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
33e112847d
Add more missing includes after removing the implicit common.h
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Anton Khirnov
d4f89906e3
lavfi: add error handling to end_frame().
13 years ago
Anton Khirnov
e9b992d035
lavfi: add error handling to draw_slice().
13 years ago
Anton Khirnov
ebc8d97481
lavfi: add error handling to start_frame().
13 years ago
Ronald S. Bultje
3db407038e
lavfi: use const for AVFilterPad declarations in all filters.
12 years ago
Anton Khirnov
07bad27810
lavfi: unref AVFilterLink.cur_buf in ff_end_frame().
This reduces code duplication and prevents stale pointers from remaining
on the link.
13 years ago
Anton Khirnov
7155763b78
vf_drawtext: don't give up its own reference to the input buffer.
Directly forwarding the input buffer to the next filter means that
drawtext no longer owns any references to it and thus shouldn't refer to
it in any way.
13 years ago
Anton Khirnov
a5e8c41c28
lavfi: remove 'opaque' parameter from AVFilter.init()
It is not used in any filters currently and is inherently evil. If
passing binary data to filters is required in the future, it should be
done with some AVOptions-based system.
13 years ago
Anton Khirnov
9d0bfc5052
lavfi: make AVFilterPad opaque after two major bumps.
It will allow adding new fields to it without ABI breaks.
13 years ago
Anton Khirnov
803391f719
lavfi: remove request/poll and drawing functions from public API on next bump
They are only useful inside filters and we don't allow user filters for
now.
13 years ago
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.
13 years ago
Anton Khirnov
c04c533f62
lavfi: remove avfilter_null_* 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.
13 years ago
Alex Converse
b0f29db5c2
Mark mutable static data const where appropriate.
13 years ago
Andrey Utkin
e496c45d9b
drawtext: add 'fix_bounds' option on coords fixing
Before, drawtext filter deliberately altered given text coordinates if
text didn't fully fit on the picture. This breaks the use case of
scrolling large text, e.g. movie closing credits.
Add 'fix_bounds', to make it usable in such cases (by setting its value to 0).
Default behavior is not changed, and non-fitting text coords are fixed.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Andrey Utkin
2b43dfce36
drawtext: fix text_{w, h} expression vars
Before, {text_,}{w,h} vars hadn't got initialized
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Andrey Utkin
e7f0bc8c0f
drawtext: add missing braces around an if() block.
Prevents uninitialized read.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Diego Biurrun
d4b63054d9
cosmetics: Drop unnecessary parentheses around return values.
13 years ago
Luca Barbato
78212cefe1
drawtext: remove typo
It slipped through the last two iterations.
13 years ago
Luca Barbato
f5edfc9e92
drawtext: introduce rand(min, max)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
13 years ago
Luca Barbato
73585620b8
drawtext: introduce explicit draw/hide variable
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
13 years ago
Luca Barbato
2cf74eca70
drawtext: make x and y parametric
Introduce variables "E", "PHI", "PI", "main_w"/"W", "main_h"/"H",
"text_w"/"w", "text_h"/"h", "x", "y", "n" and "t" in line with
vf_overlay and refactor the code accordingly.
13 years ago