]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Implement in AVFilterGraph the scale_sws_opts field, and pass its
authorstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 23 Feb 2009 23:45:21 +0000 (23:45 +0000)
committerstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 23 Feb 2009 23:45:21 +0000 (23:45 +0000)
value in the args for the auto-inserted scale filters.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17547 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavfilter/avfilter.h
libavfilter/avfiltergraph.c
libavfilter/avfiltergraph.h

index 61ce1ad27a28bf66c64cb1a08107565a6a13f887..9f455bb4474e3a644697b9c7df12e701e23b694a 100644 (file)
@@ -23,7 +23,7 @@
 #define AVFILTER_AVFILTER_H
 
 #define LIBAVFILTER_VERSION_MAJOR  0
-#define LIBAVFILTER_VERSION_MINOR  3
+#define LIBAVFILTER_VERSION_MINOR  4
 #define LIBAVFILTER_VERSION_MICRO  0
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
index 72c0fd2ca25848fde05e8a74a3f32defd7b2ee0d..e97507dcf4c504e3cde74ce9e5e90d2c3ab4414b 100644 (file)
@@ -30,6 +30,7 @@ void avfilter_destroy_graph(AVFilterGraph *graph)
 {
     for(; graph->filter_count > 0; graph->filter_count --)
         avfilter_destroy(graph->filters[graph->filter_count - 1]);
+    av_freep(&graph->scale_sws_opts);
     av_freep(&graph->filters);
 }
 
@@ -111,13 +112,15 @@ static int query_formats(AVFilterGraph *graph)
                 if(!avfilter_merge_formats(link->in_formats,
                                            link->out_formats)) {
                     AVFilterContext *scale;
+                    char scale_args[256];
                     /* couldn't merge format lists. auto-insert scale filter */
                     snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d",
                              scaler_count);
                     scale =
                         avfilter_open(avfilter_get_by_name("scale"),inst_name);
 
-                    if(!scale || scale->filter->init(scale, NULL, NULL) ||
+                    snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts);
+                    if(!scale || scale->filter->init(scale, scale_args, NULL) ||
                                  avfilter_insert_filter(link, scale, 0, 0)) {
                         avfilter_destroy(scale);
                         return -1;
index 716d9199f1c5e85d01dc738db6953ac10a5fe42b..88820ac7f46ad1c6809afb7ec23d49078e601a41 100644 (file)
@@ -27,6 +27,8 @@
 typedef struct AVFilterGraph {
     unsigned filter_count;
     AVFilterContext **filters;
+
+    char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters
 } AVFilterGraph;
 
 /**