30 #define WHITESPACES " \n\t"
44 "Cannot create the link %s:%d -> %s:%d\n",
68 "Bad (empty?) label found in the following: \"%s\".\n", start);
72 if (*(*buf)++ !=
']') {
74 "Mismatched '[' found in the following: \"%s\".\n", start);
95 const char *filt_name,
const char *
args,
void *log_ctx)
99 char *tmp_args = NULL;
102 snprintf(inst_name,
sizeof(inst_name),
"Parsed_%s_%d", filt_name, index);
108 "No such filter: '%s'\n", filt_name);
115 "Error creating filter '%s'\n", filt_name);
119 if (!strcmp(filt_name,
"scale") && args && !strstr(args,
"flags") &&
131 "Error initializing filter '%s'", filt_name);
158 int index,
void *log_ctx)
169 ret =
create_filter(filt_ctx, graph, index, name, opts, log_ctx);
194 while (*links && (!(*links)->name || strcmp((*links)->name, label)))
195 links = &((*links)->next);
209 element->
next = *inouts;
215 while (*inouts && (*inouts)->
next)
216 inouts = &((*inouts)->next);
221 (*inouts)->
next = *element;
231 for (pad = 0; pad < filt_ctx->
nb_inputs; pad++) {
235 *curr_inputs = (*curr_inputs)->
next;
255 "Too many inputs specified for the \"%s\" filter.\n",
279 while (**buf ==
'[') {
308 *curr_inputs = parsed_inputs;
319 while (**buf ==
'[') {
330 "No output pad can be associated to link label '%s'.\n", name);
334 *curr_inputs = (*curr_inputs)->
next;
363 char *p = strchr(*buf,
';');
365 if (strncmp(*buf,
"sws_flags=", 10))
391 AVFilterInOut *curr_inputs = NULL, *open_inputs = NULL, *open_outputs = NULL;
402 if ((
ret =
parse_inputs(&filters, &curr_inputs, &open_outputs, graph)) < 0)
411 if ((
ret =
parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
418 if (chr ==
';' && curr_inputs)
421 }
while (chr ==
',' || chr ==
';');
425 "Unable to parse graph description substring: \"%s\"\n",
434 *inputs = open_inputs;
435 *outputs = open_outputs;
452 #if HAVE_INCOMPATIBLE_LIBAV_ABI || !FF_API_OLD_GRAPH_PARSE
464 if (inputs && !inputs->
name)
466 for (cur = inputs; cur; cur = cur->
next) {
469 "Not enough inputs specified for the \"%s\" filter.\n",
484 if (outputs && !outputs->name)
486 for (cur = outputs; cur; cur = cur->
next) {
489 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
527 int index = 0, ret = 0;
531 AVFilterInOut *open_inputs = open_inputs_ptr ? *open_inputs_ptr : NULL;
532 AVFilterInOut *open_outputs = open_outputs_ptr ? *open_outputs_ptr : NULL;
539 const char *filterchain =
filters;
542 if ((ret =
parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx)) < 0)
545 if ((ret =
parse_filter(&filter, &filters, graph, index, log_ctx)) < 0)
548 if (filter->
nb_inputs == 1 && !curr_inputs && !index) {
550 const char *tmp =
"[in]";
551 if ((ret =
parse_inputs(&tmp, &curr_inputs, &open_outputs, log_ctx)) < 0)
558 if ((ret =
parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
565 if (chr ==
';' && curr_inputs) {
567 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
573 }
while (chr ==
',' || chr ==
';');
577 "Unable to parse graph description substring: \"%s\"\n",
585 const char *tmp =
"[out]";
586 if ((ret =
parse_outputs(&tmp, &curr_inputs, &open_inputs, &open_outputs,
593 if (open_inputs_ptr) *open_inputs_ptr = open_inputs;
595 if (open_outputs_ptr) *open_outputs_ptr = open_outputs;