32 #define WHITESPACES " \n\t"
46 "Cannot create the link %s:%d -> %s:%d\n",
62 const char *start = *buf;
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)
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);
126 if (!strcmp(filt_name,
"scale") && args && !strstr(args,
"flags") &&
128 snprintf(tmp_args,
sizeof(tmp_args),
"%s:%s",
135 "Error initializing filter '%s' with args '%s'\n", filt_name, args);
159 int index,
void *log_ctx)
170 ret =
create_filter(filt_ctx, graph, index, name, opts, log_ctx);
195 while (*links && (!(*links)->name || strcmp((*links)->name, label)))
196 links = &((*links)->next);
210 element->
next = *inouts;
216 while (*inouts && (*inouts)->
next)
217 inouts = &((*inouts)->next);
222 (*inouts)->
next = *element;
232 for (pad = 0; pad < filt_ctx->
nb_inputs; pad++) {
236 *curr_inputs = (*curr_inputs)->
next;
256 "Too many inputs specified for the \"%s\" filter.\n",
280 while (**buf ==
'[') {
309 *curr_inputs = parsed_inputs;
320 while (**buf ==
'[') {
331 "No output pad can be associated to link label '%s'.\n", name);
335 *curr_inputs = (*curr_inputs)->
next;
364 char *p = strchr(*buf,
';');
366 if (strncmp(*buf,
"sws_flags=", 10))
389 int index = 0, ret = 0;
403 if ((ret =
parse_inputs(&filters, &curr_inputs, &open_outputs, graph)) < 0)
405 if ((ret =
parse_filter(&filter, &filters, graph, index, graph)) < 0)
412 if ((ret =
parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
419 if (chr ==
';' && curr_inputs)
422 }
while (chr ==
',' || chr ==
';');
426 "Unable to parse graph description substring: \"%s\"\n",
435 *inputs = open_inputs;
436 *outputs = open_outputs;
467 if (inputs && !inputs->
name)
469 for (cur = inputs; cur; cur = cur->
next) {
472 "Not enough inputs specified for the \"%s\" filter.\n",
487 if (outputs && !outputs->name)
489 for (cur = outputs; cur; cur = cur->
next) {
492 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
515 if (open_inputs_ptr) *open_inputs_ptr = open_inputs;
517 if (open_outputs_ptr) *open_outputs_ptr = open_outputs;
522 int index = 0, ret = 0;
534 const char *filterchain =
filters;
543 if (filter->input_count == 1 && !curr_inputs && !
index) {
545 const char *tmp =
"[in]";
546 if ((ret =
parse_inputs(&tmp, &curr_inputs, &open_outputs, log_ctx)) < 0)
560 if (chr ==
';' && curr_inputs) {
562 "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
568 }
while (chr ==
',' || chr ==
';');
572 "Unable to parse graph description substring: \"%s\"\n",
580 const char *tmp =
"[out]";
581 if ((ret =
parse_outputs(&tmp, &curr_inputs, &open_inputs, &open_outputs,
588 if (open_inputs_ptr) *open_inputs_ptr = open_inputs;
590 if (open_outputs_ptr) *open_outputs_ptr = open_outputs;
595 for (; graph->filter_count > 0; graph->filter_count--)