30 #define WHITESPACES " \n\t"
44 "Cannot create the link %s:%d -> %s:%d\n",
70 "Bad (empty?) label found in the following: \"%s\".\n", start);
74 if (*(*buf)++ !=
']') {
76 "Mismatched '[' found in the following: \"%s\".\n", start);
97 const char *filt_name,
const char *
args,
void *log_ctx)
101 char *tmp_args =
NULL;
104 snprintf(inst_name,
sizeof(inst_name),
"Parsed_%s_%d", filt_name, index);
110 "No such filter: '%s'\n", filt_name);
117 "Error creating filter '%s'\n", filt_name);
121 if (!strcmp(filt_name,
"scale") && args && !strstr(args,
"flags") &&
133 "Error initializing filter '%s'", filt_name);
162 int index,
void *log_ctx)
173 ret =
create_filter(filt_ctx, graph, index, name, opts, log_ctx);
198 while (*links && (!(*links)->name || strcmp((*links)->name, label)))
199 links = &((*links)->next);
213 element->
next = *inouts;
219 while (*inouts && (*inouts)->
next)
220 inouts = &((*inouts)->next);
225 (*inouts)->
next = *element;
235 for (pad = 0; pad < filt_ctx->
nb_inputs; pad++) {
239 *curr_inputs = (*curr_inputs)->
next;
259 "Too many inputs specified for the \"%s\" filter.\n",
283 while (**buf ==
'[') {
312 *curr_inputs = parsed_inputs;
323 while (**buf ==
'[') {
334 "No output pad can be associated to link label '%s'.\n", name);
338 *curr_inputs = (*curr_inputs)->
next;
367 char *p = strchr(*buf,
';');
369 if (strncmp(*buf,
"sws_flags=", 10))
406 if ((
ret =
parse_inputs(&filters, &curr_inputs, &open_outputs, graph)) < 0)
415 if ((
ret =
parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
422 if (chr ==
';' && curr_inputs)
425 }
while (chr ==
',' || chr ==
';');
429 "Unable to parse graph description substring: \"%s\"\n",
438 *inputs = open_inputs;
439 *outputs = open_outputs;
456 #if HAVE_INCOMPATIBLE_LIBAV_ABI || !FF_API_OLD_GRAPH_PARSE
468 if (inputs && !inputs->
name)
470 for (cur = inputs; cur; cur = cur->
next) {
473 "Not enough inputs specified for the \"%s\" filter.\n",
488 if (outputs && !outputs->name)
490 for (cur = outputs; cur; cur = cur->
next) {
493 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
531 int index = 0, ret = 0;
543 const char *filterchain =
filters;
546 if ((ret =
parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx)) < 0)
549 if ((ret =
parse_filter(&filter, &filters, graph, index, log_ctx)) < 0)
552 if (filter->
nb_inputs == 1 && !curr_inputs && !index) {
554 const char *tmp =
"[in]";
555 if ((ret =
parse_inputs(&tmp, &curr_inputs, &open_outputs, log_ctx)) < 0)
562 if ((ret =
parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
569 if (chr ==
';' && curr_inputs) {
571 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
577 }
while (chr ==
',' || chr ==
';');
581 "Unable to parse graph description substring: \"%s\"\n",
589 const char *tmp =
"[out]";
590 if ((ret =
parse_outputs(&tmp, &curr_inputs, &open_inputs, &open_outputs,
597 if (open_inputs_ptr) *open_inputs_ptr = open_inputs;
599 if (open_outputs_ptr) *open_outputs_ptr = open_outputs;