[FFmpeg-cvslog] drawtext: Support changing parameters through reinit command at runtime.

Michael Niedermayer git at videolan.org
Mon Aug 29 20:22:08 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Aug 28 20:47:33 2011 +0200| [f782ce3b4d832372000f33e816758ac7aa3af429] | committer: Michael Niedermayer

drawtext: Support changing parameters through reinit command at runtime.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/vf_drawtext.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 7d8372b..8615aef 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -401,6 +401,16 @@ static int config_input(AVFilterLink *inlink)
     return 0;
 }
 
+static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
+{
+    if(!strcmp(cmd, "reinit")){
+        uninit(ctx);
+        return init(ctx, arg, NULL);
+    }
+
+    return AVERROR(ENOSYS);
+}
+
 #define GET_BITMAP_VAL(r, c)                                            \
     bitmap->pixel_mode == FT_PIXEL_MODE_MONO ?                          \
         (bitmap->buffer[(r) * bitmap->pitch + ((c)>>3)] & (0x80 >> ((c)&7))) * 255 : \
@@ -707,4 +717,5 @@ AVFilter avfilter_vf_drawtext = {
     .outputs   = (AVFilterPad[]) {{ .name             = "default",
                                     .type             = AVMEDIA_TYPE_VIDEO, },
                                   { .name = NULL}},
+    .process_command = command,
 };



More information about the ffmpeg-cvslog mailing list