History

Implement in AVFilterGraph the scale_sws_opts field, and pass its value in the args for the auto-inserted scale filters.

Originally committed as revision 17547 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini committed 17 years ago

Commit 39c07b81 parent cacb8213 files · +7 −2Browse files

Unified · Split

3 files
  1. libavfilter/avfilter.h +1 −1
  2. libavfilter/avfiltergraph.c +4 −1
  3. libavfilter/avfiltergraph.h +2 −0
libavfilter/avfilter.h+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #define AVFILTER_AVFILTER_H
2424
2525 #define LIBAVFILTER_VERSION_MAJOR 0
26−#define LIBAVFILTER_VERSION_MINOR 3
26+#define LIBAVFILTER_VERSION_MINOR 4
2727 #define LIBAVFILTER_VERSION_MICRO 0
2828
2929 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
libavfilter/avfiltergraph.c+4−1
@@ -30,6 +30,7 @@ void avfilter_destroy_graph(AVFilterGraph *graph) · 29 unmodified lines
3030 {
3131 for(; graph->filter_count > 0; graph->filter_count --)
3232 avfilter_destroy(graph->filters[graph->filter_count - 1]);
33+ av_freep(&graph->scale_sws_opts);
3334 av_freep(&graph->filters);
3435 }
3536
@@ -111,13 +112,15 @@ static int query_formats(AVFilterGraph *graph) · 75 unmodified lines
111112 if(!avfilter_merge_formats(link->in_formats,
112113 link->out_formats)) {
113114 AVFilterContext *scale;
115+ char scale_args[256];
114116 /* couldn't merge format lists. auto-insert scale filter */
115117 snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d",
116118 scaler_count);
117119 scale =
118120 avfilter_open(avfilter_get_by_name("scale"),inst_name);
119121
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) ||
121124 avfilter_insert_filter(link, scale, 0, 0)) {
122125 avfilter_destroy(scale);
123126 return -1;
libavfilter/avfiltergraph.h+2−0
@@ -27,6 +27,8 @@ · 26 unmodified lines
2727 typedef struct AVFilterGraph {
2828 unsigned filter_count;
2929 AVFilterContext **filters;
30+
31+ char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters
3032 } AVFilterGraph;
3133
3234 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t