Originally committed as revision 17547 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -23,7 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | #define AVFILTER_AVFILTER_H |
| 24 | 24 | |
| 25 | 25 | #define LIBAVFILTER_VERSION_MAJOR 0 |
| 26 | −#define LIBAVFILTER_VERSION_MINOR 3 | |
| 26 | +#define LIBAVFILTER_VERSION_MINOR 4 | |
| 27 | 27 | #define LIBAVFILTER_VERSION_MICRO 0 |
| 28 | 28 | |
| 29 | 29 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ |
| @@ -30,6 +30,7 @@ void avfilter_destroy_graph(AVFilterGraph *graph) · 29 unmodified lines | ||
| 30 | 30 | { |
| 31 | 31 | for(; graph->filter_count > 0; graph->filter_count --) |
| 32 | 32 | avfilter_destroy(graph->filters[graph->filter_count - 1]); |
| 33 | + av_freep(&graph->scale_sws_opts); | |
| 33 | 34 | av_freep(&graph->filters); |
| 34 | 35 | } |
| 35 | 36 | |
| @@ -111,13 +112,15 @@ static int query_formats(AVFilterGraph *graph) · 75 unmodified lines | ||
| 111 | 112 | if(!avfilter_merge_formats(link->in_formats, |
| 112 | 113 | link->out_formats)) { |
| 113 | 114 | AVFilterContext *scale; |
| 115 | + char scale_args[256]; | |
| 114 | 116 | /* couldn't merge format lists. auto-insert scale filter */ |
| 115 | 117 | snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d", |
| 116 | 118 | scaler_count); |
| 117 | 119 | scale = |
| 118 | 120 | avfilter_open(avfilter_get_by_name("scale"),inst_name); |
| 119 | 121 | |
| 120 | − if(!scale || scale->filter->init(scale, NULL, NULL) || | |
| 122 | + snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts); | |
| 123 | + if(!scale || scale->filter->init(scale, scale_args, NULL) || | |
| 121 | 124 | avfilter_insert_filter(link, scale, 0, 0)) { |
| 122 | 125 | avfilter_destroy(scale); |
| 123 | 126 | return -1; |
| @@ -27,6 +27,8 @@ · 26 unmodified lines | ||
| 27 | 27 | typedef struct AVFilterGraph { |
| 28 | 28 | unsigned filter_count; |
| 29 | 29 | AVFilterContext **filters; |
| 30 | + | |
| 31 | + char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters | |
| 30 | 32 | } AVFilterGraph; |
| 31 | 33 | |
| 32 | 34 | /** |