[FFmpeg-cvslog] lavfi: allow building without swscale.

Anton Khirnov git at videolan.org
Wed Jun 13 23:02:29 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Jun 13 10:10:31 2012 +0200| [2f296e39a17cd947c6675c20ff61a2d993ff0de2] | committer: Anton Khirnov

lavfi: allow building without swscale.

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

 configure                   |    4 ++--
 libavfilter/Makefile        |    4 +++-
 libavfilter/allfilters.c    |    5 +----
 libavfilter/avfiltergraph.c |    9 +++++++--
 4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 5f9eed3..31c437c 100755
--- a/configure
+++ b/configure
@@ -1531,16 +1531,16 @@ frei0r_src_filter_extralibs='$ldl'
 hqdn3d_filter_deps="gpl"
 resample_filter_deps="avresample"
 ocv_filter_deps="libopencv"
+scale_filter_deps="swscale"
 yadif_filter_deps="gpl"
 
 # libraries
 avdevice_deps="avcodec avformat"
-avfilter_deps="swscale"
 avformat_deps="avcodec"
 
 # programs
 avconv_deps="avcodec avfilter avformat avresample swscale format_filter
-             setpts_filter"
+             scale_filter setpts_filter"
 avplay_deps="avcodec avformat swscale sdl"
 avplay_select="rdft"
 avprobe_deps="avcodec avformat"
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 7e1a6d1..955a97c 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -1,8 +1,9 @@
 NAME = avfilter
-FFLIBS = avutil swscale
+FFLIBS = avutil
 FFLIBS-$(CONFIG_ASYNCTS_FILTER) += avresample
 FFLIBS-$(CONFIG_MOVIE_FILTER) += avformat avcodec
 FFLIBS-$(CONFIG_RESAMPLE_FILTER) += avresample
+FFLIBS-$(CONFIG_SCALE_FILTER)   += swscale
 
 HEADERS = avfilter.h                                                    \
           avfiltergraph.h                                               \
@@ -63,6 +64,7 @@ OBJS-$(CONFIG_OCV_FILTER)                    += vf_libopencv.o
 OBJS-$(CONFIG_OVERLAY_FILTER)                += vf_overlay.o
 OBJS-$(CONFIG_PAD_FILTER)                    += vf_pad.o
 OBJS-$(CONFIG_PIXDESCTEST_FILTER)            += vf_pixdesctest.o
+OBJS-$(CONFIG_SCALE_FILTER)                  += vf_scale.o
 OBJS-$(CONFIG_SELECT_FILTER)                 += vf_select.o
 OBJS-$(CONFIG_SETDAR_FILTER)                 += vf_aspect.o
 OBJS-$(CONFIG_SETPTS_FILTER)                 += vf_setpts.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 6814871..118f09d 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -73,6 +73,7 @@ void avfilter_register_all(void)
     REGISTER_FILTER (OVERLAY,     overlay,     vf);
     REGISTER_FILTER (PAD,         pad,         vf);
     REGISTER_FILTER (PIXDESCTEST, pixdesctest, vf);
+    REGISTER_FILTER (SCALE,       scale,       vf);
     REGISTER_FILTER (SELECT,      select,      vf);
     REGISTER_FILTER (SETDAR,      setdar,      vf);
     REGISTER_FILTER (SETPTS,      setpts,      vf);
@@ -113,8 +114,4 @@ void avfilter_register_all(void)
         extern AVFilter avfilter_asink_abuffer;
         avfilter_register(&avfilter_asink_abuffer);
     }
-    {
-        extern AVFilter avfilter_vf_scale;
-        avfilter_register(&avfilter_vf_scale);
-    }
 }
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 4521f79..0a863e5 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -213,11 +213,16 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
                 /* couldn't merge format lists. auto-insert conversion filter */
                 switch (link->type) {
                 case AVMEDIA_TYPE_VIDEO:
+                    if (!(filter = avfilter_get_by_name("scale"))) {
+                        av_log(log_ctx, AV_LOG_ERROR, "'scale' filter "
+                               "not present, cannot convert pixel formats.\n");
+                        return AVERROR(EINVAL);
+                    }
+
                     snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d",
                              scaler_count++);
                     snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts);
-                    if ((ret = avfilter_graph_create_filter(&convert,
-                                                            avfilter_get_by_name("scale"),
+                    if ((ret = avfilter_graph_create_filter(&convert, filter,
                                                             inst_name, scale_args, NULL,
                                                             graph)) < 0)
                         return ret;



More information about the ffmpeg-cvslog mailing list