Commit Graph

153 Commits

Author SHA1 Message Date
Luca Barbato 78212cefe1 drawtext: remove typo
It slipped through the last two iterations.
2011-12-07 20:40:18 +01:00
Luca Barbato f5edfc9e92 drawtext: introduce rand(min, max)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-07 12:11:14 +01:00
Luca Barbato 73585620b8 drawtext: introduce explicit draw/hide variable
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-07 12:11:14 +01:00
Michael Niedermayer dda3d716d6 vf_drawtext: support W/H parameters to reduce UI differences to qatar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-04 15:29:26 +01:00
Michael Niedermayer f88d5df383 vf_drawtext: cosmetics to reduce diff to qatar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-04 02:27:45 +01:00
Michael Niedermayer 297422b338 vf_drawtext: Add main_w/h to improve compatibility with the modified UI
from the fork.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-04 02:08:56 +01:00
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.
2011-12-03 01:35:29 +01:00
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
Clément Bœsch 2f0f9a87d0 Fix various if parenthesis misplacements. 2011-11-21 19:35:33 +01:00
Reimar Döffinger 5af7daabc4 Mark AVFilterPad[] compound literals as const.
GCC 4.6.2 at least still seems to fail to put them in .rodata though,
see also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37303

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-11-06 00:05:14 +01:00
Reimar Döffinger d78473334e Add const to static arrays where it was forgotten.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-11-05 15:37:01 +01:00
Michael Niedermayer 988f585fcb Merge remote-tracking branch 'qatar/master'
* qatar/master: (44 commits)
  replacement Indeo 3 decoder
  gsm demuxer: do not allocate packet twice.
  flvenc: use first packet delay as global delay.
  ac3enc: doxygen update.
  imc: return error codes instead of 0 for error conditions.
  imc: return meaningful error codes instead of -1
  imc: do not set channel layout for stereo
  imc: validate channel count
  imc: check for ff_fft_init() failure
  imc: check output buffer size before decoding
  imc: use DSPContext.bswap16_buf() to byte-swap packet data
  rtsp: add allowed_media_types option
  libgsm: add flush function to reset the decoder state when seeking
  libgsm: simplify decoding by using a loop
  gsm: log error message when packet is too small
  libgsmdec: do not needlessly set *data_size to 0
  gsmdec: do not needlessly set *data_size to 0
  gsmdec: add flush function to reset the decoder state when seeking
  libgsmdec: check output buffer size before decoding
  gsmdec: log error message when output buffer is too small.
  ...

Conflicts:
	Changelog
	ffplay.c
	libavcodec/indeo3.c
	libavcodec/mjpeg_parser.c
	libavcodec/vp3.c
	libavformat/cutils.c
	libavformat/id3v2.c
	libavutil/parseutils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-03 02:16:26 +01:00
Diego Biurrun 124e28847b Remove some stray unnecessary ffmpeg references. 2011-11-02 10:42:54 +01:00
Nicolas George a2af901295 vf_drawtext: remove mathematical constants now redundant.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-13 18:08:50 +02:00
Michael Niedermayer f884ef00de Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits)
  tiffenc: initialize forgotten avctx.
  avplay: free the active audio packet at exit.
  avplay: free rdft data used for spectrogram analysis.
  log.h: make AVClass a named struct
  fix ac3 encoder documentation
  vc1: more prettyprinting cosmetics
  vc1: prettyprint some tables
  vc1: K&R formatting cosmetics
  AVOptions: bump minor and add APIchanges entry.
  cmdutils/avtools: simplify show_help() by using av_opt_child_class_next()
  AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_*
  Remove all uses of deprecated AVOptions API.
  AVOptions: add av_opt_next, deprecate av_next_option.
  AVOptions: add functions for evaluating option strings.
  AVOptions: split get_number().
  AVOptions: add av_opt_get*, deprecate av_get*.
  AVOptions: add av_opt_set*().
  AVOptions: add new API for enumerating children.
  rv34: move inverse transform functions to DSP context
  flvenc: Write the right metadata entry count
  ...

Conflicts:
	avconv.c
	cmdutils.c
	doc/APIchanges
	ffplay.c
	ffprobe.c
	libavcodec/ac3dec.c
	libavcodec/h264.c
	libavcodec/libvpxenc.c
	libavcodec/libx264.c
	libavcodec/mpeg12enc.c
	libavcodec/options.c
	libavdevice/libdc1394.c
	libavdevice/v4l2.c
	libavfilter/vf_drawtext.c
	libavformat/flvdec.c
	libavformat/mpegtsenc.c
	libavformat/options.c
	libavutil/avutil.h
	libavutil/opt.c
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-13 06:00:03 +02:00
Anton Khirnov 145f741e11 AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_* 2011-10-12 16:51:16 +02:00
Stefano Sabatini 9921613e82 vf_drawtext: apply misc style fixes 2011-09-25 22:47:51 +02:00
Stefano Sabatini 80daa247d8 vf_drawtext: do not reset "n" variable to 0 in case the filter is reinited 2011-09-25 22:47:51 +02:00
Stefano Sabatini 87f5e79732 vf_drawtext: use ctx for expressing outlink and dtext in end_frame
(Very) slighly improve readability.
2011-09-24 12:37:12 +02:00
Stefano Sabatini 3de684206e vf_drawtext: perform misc cosmetics changes to uninit
In particular:
* lexically sort strings freeing commands
* logically group freeing instructions
* prefer NULL over 0 when setting dtext->glyphs
2011-09-24 12:37:03 +02:00
Stefano Sabatini 275516f87c vf_drawtext: set string defaults in the options array
Simplify.
2011-09-24 12:36:55 +02:00
Stefano Sabatini 482ce0ce4e vf_drawtext: make x and y options parametric
Address trac issue #378.
2011-09-24 12:36:48 +02:00
Stefano Sabatini 163854bca0 vf_drawtext: drop text wrapping feature
Or in other word, do not go to the next line when the text cannot be
rendered within the frame.

The rationale is that wrapping is hard to manage, as it depends on the
position of the text, thus making hard/impossible to compute the size
occupied by the rendered text, and makes the filter behavior
unpredictible with moving text (implemented in a pending patch).

Also the current wrapping code is very limited (for example it splits
words in the middle), and correctly handling wrapping requires much
more complexity (alignment, gravity, word parsing etc.), while
drawtext is meant to be only a thin wrapper around libfreetype, so
such advanced features don't belong here.
2011-09-24 12:36:39 +02:00
Stefano Sabatini b87d4c2b9f vf_drawtext: do not set limitations on fontsize
It may be needed to use values greater than 72, and in general greater
than an arbitrary big value. Let the user choose what's too big for
her.
2011-09-23 01:35:38 +02:00
Stefano Sabatini 3a87dce6bf vf_drawtext: remove useless and misnamed intermediary "baseline" variable in draw_text() 2011-09-22 00:45:59 +02:00
Stefano Sabatini 500b3210da vf_drawtext: fix background box coloring with RGB formats != RGBA
drawbox() expects a color specified in RGBA format, while the code was
providing a color with the components specified in the same order of
the input pixel format.

In particular, fix box coloring with AXXX RGB formats.
2011-09-22 00:45:59 +02:00
Stefano Sabatini db56a7507e vf_drawtext: prefer int over unsigned int
This avoids overflow errors when the considered x and y values are
negative, as required by the incoming patches.
2011-09-22 00:45:59 +02:00
Michael Niedermayer f1b5693027 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Add LATM muxer
  v210enc: clip values according to specifications
  v210enc: switch to PIX_FMT_422P10
  v210dec: switch to PIX_FMT_422P10
  AVOptions: remove AVOption.offset <= 0 checks
  AVOptions: deprecate av_opt_set_defaults2
  AVOptions: move doxy for av_opt_set_defaults() from opt.c to opt.h
  libx264: fix setting some more parameters
  libx264: fix setting the H.264 level
  libx264: add 'direct-pred' private option
  libx264: add 'partitions' private option

Conflicts:
	Changelog
	libavcodec/Makefile
	libavcodec/libx264.c
	libavcodec/v210enc.c
	libavfilter/src_movie.c
	libavformat/version.h
	libavutil/opt.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-07 22:58:39 +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 845383c358 vf_drawtext: always use expanded_text as we always support strftime() now and dont depend on localtime_r() anymore
Found-by: Rolf Siegrist
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-05 23:13:59 +02:00
Michael Niedermayer 038a465efc vf_drawtext: make strftime work without localtime_r()
modern OS should have localtime_r() or return thread locals on localtime() hopefully

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-05 05:16:44 +02:00
Michael Niedermayer b881a2e254 vf_drawtext: Fix reinit to allow color changes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-04 20:58:13 +02:00
Michael Niedermayer 595cfdef97 vf_drawtext: add basetime argument to allow specifying the wall clock time of PTS=0
the basetime argument also enables useage of pts instead of time()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-30 23:37:49 +02:00
Michael Niedermayer 3016c7f543 vf_drawtext: fix segfault on reinit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-30 20:25:58 +02:00
Michael Niedermayer f782ce3b4d drawtext: Support changing parameters through reinit command at runtime.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-29 20:16:08 +02:00
Michael Niedermayer 5d1b39f7e7 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  build: clean up library installation rules
  vf_drawtext: Remove some write-only variables.
  libgsm: Drop const qualifier to silence compiler warning.
  docs: Remove needless configure options
  docs: Don't recommend adding --enable-memalign-hack
  libvo-amrwbenc: Add braces to shut up gcc warning.
  adts: Fix PCE copying.

Conflicts:
	configure
	doc/general.texi
	subdir.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-08 01:05:28 +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
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
Mina Nagy Zaki fd2c0a5db2 lavfi: add layout negotiation fields and helper functions. 2011-06-19 22:58:32 +02:00
Diego Biurrun 5ac4952a58 vf_drawtext: Replace FFmpeg by Libav in license boilerplate. 2011-05-31 21:15:49 +02:00
Stefano Sabatini d8c7a21602 drawtext: specify union type for setting default options
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’)
2011-05-16 23:50:43 +02:00
Stefano Sabatini e8ea9c2179 drawtext: reindent after the previous commit 2011-05-16 23:50:36 +02:00
Stefano Sabatini ce207e050e drawtext: fix strftime() text expansion
The feature was dropped after the filter was partially rewritten and
recommitted.

Fix issue #207.
2011-05-16 23:50:29 +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
Anton Khirnov 59ee9f78b0 lavfi: do not use av_pix_fmt_descriptors directly. 2012-10-12 12:45:39 +02:00