summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-07 01:40:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-07 01:40:29 +0100
commitb479e016128efe42e8b26ceb6c1b4a95b6d0c791 (patch)
tree30ab5e543d733f62a81deecce3a15404e46ce4f4 /libavfilter
parent6ba2505a0e894eeb326cfee95df9e1c030bcde3e (diff)
parentd016d3074cc084ea813e389f046eee01ecd48b7e (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: Revert "v210enc: use FFALIGN()" doxygen: Do not include license boilerplates in Doxygen comment blocks. avplay: reset decoder flush state when seeking ape: skip packets with invalid size ape: calculate final packet size instead of guessing ape: stop reading after the last frame has been read ape: return AVERROR_EOF instead of AVERROR(EIO) when demuxing is finished ape: return error if seeking to the current packet fails in ape_read_packet() avcodec: Clarify AVFrame member documentation. v210dec: check for coded_frame allocation failure v210enc: use stride as it is already calculated v210enc: use FFALIGN() v210enc: return proper AVERROR codes instead of -1 v210enc: do not set coded_frame->key_frame v210enc: check for coded_frame allocation failure drawtext: add 'fix_bounds' option on coords fixing drawtext: fix text_{w, h} expression vars drawtext: add missing braces around an if() block. Conflicts: libavcodec/arm/vp8.h libavcodec/arm/vp8dsp_init_arm.c libavcodec/v210dec.c libavfilter/vf_drawtext.c libavformat/ape.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_drawtext.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index f7727ef24f..7c216800a6 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -139,6 +139,7 @@ typedef struct {
short int draw_box; ///< draw box around text - true or false
int use_kerning; ///< font kerning is used - true/false
int tabsize; ///< tab size
+ int fix_bounds; ///< do we let it go out of frame bounds - t/f
FT_Library library; ///< freetype font library handle
FT_Face face; ///< freetype font face handle
@@ -184,6 +185,8 @@ static const AVOption drawtext_options[]= {
{"timecode", "set initial timecode", OFFSET(tc_opt_string), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX },
{"r", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX },
{"rate", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX },
+{"fix_bounds", "if true, check and fix text coords to avoid clipping",
+ OFFSET(fix_bounds), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 },
/* FT_LOAD_* flags */
{"ft_load_flags", "set font loading flags for libfreetype", OFFSET(ft_load_flags), AV_OPT_TYPE_FLAGS, {.dbl=FT_LOAD_DEFAULT|FT_LOAD_RENDER}, 0, INT_MAX, 0, "ft_load_flags" },
@@ -754,8 +757,9 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
/* get glyph */
dummy.code = code;
glyph = av_tree_find(dtext->glyphs, &dummy, glyph_cmp, NULL);
- if (!glyph)
+ if (!glyph) {
load_glyph(ctx, &glyph, code);
+ }
y_min = FFMIN(glyph->bbox.yMin, y_min);
y_max = FFMAX(glyph->bbox.yMax, y_max);