[FFmpeg-cvslog] vf_drawtext: drop text wrapping feature

Stefano Sabatini git at videolan.org
Sat Sep 24 12:42:10 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sun Sep 18 02:51:17 2011 +0200| [163854bca0e0c1b43831de7463ffa3ff9e6595ca] | committer: Stefano Sabatini

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=163854bca0e0c1b43831de7463ffa3ff9e6595ca
---

 libavfilter/avfilter.h    |    2 +-
 libavfilter/vf_drawtext.c |    6 ------
 2 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 78c8b6f..a2ecc08 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -30,7 +30,7 @@
 
 #define LIBAVFILTER_VERSION_MAJOR  2
 #define LIBAVFILTER_VERSION_MINOR 43
-#define LIBAVFILTER_VERSION_MICRO  3
+#define LIBAVFILTER_VERSION_MICRO  4
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
                                                LIBAVFILTER_VERSION_MINOR, \
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 4a6693e..54119a0 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -654,12 +654,6 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
             x += delta.x >> 6;
         }
 
-        if (x + glyph->bbox.xMax >= width) {
-            str_w = FFMAX(str_w, x - dtext->x);
-            y += text_height;
-            x = dtext->x;
-        }
-
         /* save position */
         dtext->positions[i].x = x + glyph->bitmap_left;
         dtext->positions[i].y = y - glyph->bitmap_top + y_max;



More information about the ffmpeg-cvslog mailing list