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)
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") &&
121 snprintf(tmp_args,
sizeof(tmp_args),
"%s:%s",
129 "Error initializing filter '%s'", filt_name);
156 int index,
void *log_ctx)
167 ret =
create_filter(filt_ctx, graph, index, name, opts, log_ctx);
192 while (*links && (!(*links)->name || strcmp((*links)->name, label)))
193 links = &((*links)->next);
207 element->
next = *inouts;
213 while (*inouts && (*inouts)->
next)
214 inouts = &((*inouts)->next);
219 (*inouts)->
next = *element;
229 for (pad = 0; pad < filt_ctx->
nb_inputs; pad++) {
233 *curr_inputs = (*curr_inputs)->
next;
253 "Too many inputs specified for the \"%s\" filter.\n",
277 while (**buf ==
'[') {
306 *curr_inputs = parsed_inputs;
317 while (**buf ==
'[') {
328 "No output pad can be associated to link label '%s'.\n", name);
332 *curr_inputs = (*curr_inputs)->
next;
361 char *p = strchr(*buf,
';');
363 if (strncmp(*buf,
"sws_flags=", 10))
389 AVFilterInOut *curr_inputs = NULL, *open_inputs = NULL, *open_outputs = NULL;
400 if ((
ret =
parse_inputs(&filters, &curr_inputs, &open_outputs, graph)) < 0)
409 if ((
ret =
parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
416 if (chr ==
';' && curr_inputs)
419 }
while (chr ==
',' || chr ==
';');
423 "Unable to parse graph description substring: \"%s\"\n",
432 *inputs = open_inputs;
433 *outputs = open_outputs;
450 #if HAVE_INCOMPATIBLE_LIBAV_ABI || !FF_API_OLD_GRAPH_PARSE
462 if (inputs && !inputs->
name)
464 for (cur = inputs; cur; cur = cur->
next) {
467 "Not enough inputs specified for the \"%s\" filter.\n",
482 if (outputs && !outputs->name)
484 for (cur = outputs; cur; cur = cur->
next) {
487 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
525 int index = 0, ret = 0;
529 AVFilterInOut *open_inputs = open_inputs_ptr ? *open_inputs_ptr : NULL;
530 AVFilterInOut *open_outputs = open_outputs_ptr ? *open_outputs_ptr : NULL;
537 const char *filterchain =
filters;
540 if ((ret =
parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx)) < 0)
543 if ((ret =
parse_filter(&filter, &filters, graph, index, log_ctx)) < 0)
546 if (filter->input_count == 1 && !curr_inputs && !index) {
548 const char *tmp =
"[in]";
549 if ((ret =
parse_inputs(&tmp, &curr_inputs, &open_outputs, log_ctx)) < 0)
556 if ((ret =
parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
563 if (chr ==
';' && curr_inputs) {
565 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
571 }
while (chr ==
',' || chr ==
';');
575 "Unable to parse graph description substring: \"%s\"\n",
583 const char *tmp =
"[out]";
584 if ((ret =
parse_outputs(&tmp, &curr_inputs, &open_inputs, &open_outputs,
591 if (open_inputs_ptr) *open_inputs_ptr = open_inputs;
593 if (open_outputs_ptr) *open_outputs_ptr = open_outputs;