Originally committed as revision 13342 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -150,6 +150,29 @@ static AVFilterContext *create_filter(AVFilterGraph *ctx, int index, · 149 unmodified lines | ||
| 150 | 150 | return filt; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | +/** | |
| 154 | + * Parse "filter=params" | |
| 155 | + * @arg name a pointer (that need to be free'd after use) to the name of the | |
| 156 | + * filter | |
| 157 | + * @arg ars a pointer (that need to be free'd after use) to the args of the | |
| 158 | + * filter | |
| 159 | + */ | |
| 160 | +static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph, | |
| 161 | + int index, AVClass *log_ctx) | |
| 162 | +{ | |
| 163 | + char *opts; | |
| 164 | + char *name = consume_string(buf); | |
| 165 | + | |
| 166 | + if(**buf == '=') { | |
| 167 | + (*buf)++; | |
| 168 | + opts = consume_string(buf); | |
| 169 | + } else { | |
| 170 | + opts = NULL; | |
| 171 | + } | |
| 172 | + | |
| 173 | + return create_filter(graph, index, name, opts, log_ctx); | |
| 174 | +} | |
| 175 | + | |
| 153 | 176 | static void free_inout(AVFilterInOut *head) |
| 154 | 177 | { |
| 155 | 178 | while(head) { |
| @@ -226,29 +249,6 @@ static int link_filter_inouts(AVFilterContext *filter, · 70 unmodified lines | ||
| 226 | 249 | return 0; |
| 227 | 250 | } |
| 228 | 251 | |
| 229 | −/** | |
| 230 | − * Parse "filter=params" | |
| 231 | − * @arg name a pointer (that need to be free'd after use) to the name of the | |
| 232 | − * filter | |
| 233 | − * @arg ars a pointer (that need to be free'd after use) to the args of the | |
| 234 | − * filter | |
| 235 | − */ | |
| 236 | −static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph, | |
| 237 | − int index, AVClass *log_ctx) | |
| 238 | −{ | |
| 239 | − char *opts; | |
| 240 | − char *name = consume_string(buf); | |
| 241 | − | |
| 242 | − if(**buf == '=') { | |
| 243 | − (*buf)++; | |
| 244 | − opts = consume_string(buf); | |
| 245 | − } else { | |
| 246 | − opts = NULL; | |
| 247 | − } | |
| 248 | − | |
| 249 | − return create_filter(graph, index, name, opts, log_ctx); | |
| 250 | −} | |
| 251 | − | |
| 252 | 252 | static int parse_inputs(const char **buf, AVFilterInOut **currInputs, |
| 253 | 253 | AVFilterInOut **openLinks, AVClass *log_ctx) |
| 254 | 254 | { |