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);
160 int index,
void *log_ctx)
171 ret =
create_filter(filt_ctx, graph, index, name, opts, log_ctx);
196 while (*links && (!(*links)->name || strcmp((*links)->name, label)))
197 links = &((*links)->next);
211 element->
next = *inouts;
217 while (*inouts && (*inouts)->
next)
218 inouts = &((*inouts)->next);
223 (*inouts)->
next = *element;
233 for (pad = 0; pad < filt_ctx->
nb_inputs; pad++) {
237 *curr_inputs = (*curr_inputs)->
next;
257 "Too many inputs specified for the \"%s\" filter.\n",
281 while (**buf ==
'[') {
310 *curr_inputs = parsed_inputs;
321 while (**buf ==
'[') {
332 "No output pad can be associated to link label '%s'.\n", name);
336 *curr_inputs = (*curr_inputs)->
next;
365 char *p = strchr(*buf,
';');
367 if (strncmp(*buf,
"sws_flags=", 10))
393 AVFilterInOut *curr_inputs = NULL, *open_inputs = NULL, *open_outputs = NULL;
404 if ((
ret =
parse_inputs(&filters, &curr_inputs, &open_outputs, graph)) < 0)
413 if ((
ret =
parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
420 if (chr ==
';' && curr_inputs)
423 }
while (chr ==
',' || chr ==
';');
427 "Unable to parse graph description substring: \"%s\"\n",
436 *inputs = open_inputs;
437 *outputs = open_outputs;
454 #if HAVE_INCOMPATIBLE_LIBAV_ABI || !FF_API_OLD_GRAPH_PARSE
466 if (inputs && !inputs->
name)
468 for (cur = inputs; cur; cur = cur->
next) {
471 "Not enough inputs specified for the \"%s\" filter.\n",
486 if (outputs && !outputs->name)
488 for (cur = outputs; cur; cur = cur->
next) {
491 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
529 int index = 0, ret = 0;
533 AVFilterInOut *open_inputs = open_inputs_ptr ? *open_inputs_ptr : NULL;
534 AVFilterInOut *open_outputs = open_outputs_ptr ? *open_outputs_ptr : NULL;
541 const char *filterchain =
filters;
544 if ((ret =
parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx)) < 0)
547 if ((ret =
parse_filter(&filter, &filters, graph, index, log_ctx)) < 0)
550 if (filter->
nb_inputs == 1 && !curr_inputs && !index) {
552 const char *tmp =
"[in]";
553 if ((ret =
parse_inputs(&tmp, &curr_inputs, &open_outputs, log_ctx)) < 0)
560 if ((ret =
parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
567 if (chr ==
';' && curr_inputs) {
569 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
575 }
while (chr ==
',' || chr ==
';');
579 "Unable to parse graph description substring: \"%s\"\n",
587 const char *tmp =
"[out]";
588 if ((ret =
parse_outputs(&tmp, &curr_inputs, &open_inputs, &open_outputs,
595 if (open_inputs_ptr) *open_inputs_ptr = open_inputs;
597 if (open_outputs_ptr) *open_outputs_ptr = open_outputs;