On Wed, 19 Dec 2007 16:09:08 +0100
"Víctor Paesa" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Here I attach a port of the Imlib2 vhook to the libavfilter API for
> your kind review/testing.
> 
> I have not ported the -C option, as I favour the RGBA options.
> The vf_imlib2.c source is diff'ed from /dev/null, as diff'ing from
> vf_negate.c produces a less legible diff, IMHO.
> 
> The source contains a few usage examples, usable too as test
> scenarios.
> 
> Regards,
> Víctor
>
> Index: allfilters.h
> ===================================================================
> --- allfilters.h      (revision 1447)
> +++ allfilters.h      (working copy)
> @@ -27,6 +27,7 @@
>  extern AVFilter avfilter_vf_graph;
>  extern AVFilter avfilter_vf_graphdesc;
>  extern AVFilter avfilter_vf_graphfile;
> +extern AVFilter avfilter_vf_imlib2;
>  extern AVFilter avfilter_vf_negate;
>  extern AVFilter avfilter_vf_overlay;
>  extern AVFilter avfilter_vf_passthrough;
> Index: avfilter.c
> ===================================================================
> --- avfilter.c        (revision 1447)
> +++ avfilter.c        (working copy)
> @@ -340,6 +340,7 @@
>      avfilter_register(&avfilter_vf_graph);
>      avfilter_register(&avfilter_vf_graphdesc);
>      avfilter_register(&avfilter_vf_graphfile);
> +    avfilter_register(&avfilter_vf_imlib2);
>      avfilter_register(&avfilter_vf_negate);
>      avfilter_register(&avfilter_vf_overlay);
>      avfilter_register(&avfilter_vf_passthrough);

Since the filter is compiled conditionally, shouldn't this also be
conditional?

Also, the rewritten colorspace negotiation code I just commit requires
a minor tweak to the filter.  Attached patch should fix that for
vf_imlib2.

> Index: Makefile
> ===================================================================
> --- Makefile  (revision 1447)
> +++ Makefile  (working copy)
> @@ -23,6 +23,12 @@
>  
>  EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF)
> -L$(BUILD_ROOT)/libswscale -lswscale$(BUILDSUF)
> -L$(BUILD_ROOT)/libavcodec -lavcodec$(BUILDSUF) $(EXTRALIBS) +ifeq
> ($(HAVE_IMLIB2),yes)
> +    OBJS-yes += vf_imlib2.o
> +    CFLAGS += `imlib2-config --cflags`
> +    EXTRALIBS += `imlib2-config --libs`
> +endif
> +

This seems to only work correctly with --enable-shared.  I don't know
the build system well enough to suggest the right solution though.

-- 
Bobby Bingham
Never trust atoms.  Or anything made of atoms.
このメールは再利用されたバイトでできている。
--- vf_imlib2.c.old	2007-12-20 14:49:26.218350213 -0500
+++ vf_imlib2.c	2007-12-20 14:52:05.220755673 -0500
@@ -191,9 +191,11 @@
     return -1;
 }
 
-static int *query_formats(AVFilterLink *link)
+static int query_formats(AVFilterContext *ctx)
 {
-    return avfilter_make_format_list(1, PIX_FMT_RGB32);
+    avfilter_set_common_formats(ctx,
+        avfilter_make_format_list(1, PIX_FMT_RGB32));
+    return 0;
 }
 
 static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
@@ -396,13 +398,14 @@
     .init      = init,
     .uninit    = uninit,
 
+    .query_formats = query_formats,
+
     .priv_size = sizeof(Imlib2Context),
 
     .inputs    = (AVFilterPad[]) {{ .name            = "default",
                                     .type            = AV_PAD_VIDEO,
                                     .start_frame     = start_frame,
                                     .draw_slice      = draw_slice,
-                                    .query_formats   = query_formats,
                                     .end_frame       = end_frame,
                                     .min_perms       = AV_PERM_READ |
                                                        AV_PERM_WRITE, },
_______________________________________________
FFmpeg-soc mailing list
[email protected]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to