31 #define WHITESPACES " \n\t"
45 "Cannot create the link %s:%d -> %s:%d\n",
61 const char *start = *buf;
69 "Bad (empty?) label found in the following: \"%s\".\n", start);
73 if (*(*buf)++ !=
']') {
75 "Mismatched '[' found in the following: \"%s\".\n", start);
96 const char *filt_name,
const char *args,
void *log_ctx)
103 snprintf(inst_name,
sizeof(inst_name),
"Parsed_%s_%d", filt_name, index);
109 "No such filter: '%s'\n", filt_name);
116 "Error creating filter '%s'\n", filt_name);
125 if (!strcmp(filt_name,
"scale") && args && !strstr(args,
"flags")
127 snprintf(tmp_args,
sizeof(tmp_args),
"%s:%s",
134 "Error initializing filter '%s' with args '%s'\n", filt_name, args);
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))
388 int index = 0, ret = 0;
402 if ((ret =
parse_inputs(&filters, &curr_inputs, &open_outputs, graph)) < 0)
404 if ((ret =
parse_filter(&filter, &filters, graph, index, 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;
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",
514 if (open_inputs_ptr) *open_inputs_ptr = open_inputs;
516 if (open_outputs_ptr) *open_outputs_ptr = open_outputs;
521 int index = 0, ret = 0;
533 const char *filterchain =
filters;
542 if (filter->input_count == 1 && !curr_inputs && !
index) {
544 const char *tmp =
"[in]";
545 if ((ret =
parse_inputs(&tmp, &curr_inputs, &open_outputs, log_ctx)) < 0)
559 if (chr ==
';' && curr_inputs) {
561 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
567 }
while (chr ==
',' || chr ==
';');
571 "Unable to parse graph description substring: \"%s\"\n",
579 const char *tmp =
"[out]";
580 if ((ret =
parse_outputs(&tmp, &curr_inputs, &open_inputs, &open_outputs,
587 if (open_inputs_ptr) *open_inputs_ptr = open_inputs;
589 if (open_outputs_ptr) *open_outputs_ptr = open_outputs;
594 for (; graph->filter_count > 0; graph->filter_count--)