62 int i, j, *fmts,
count = 0;
64 for (i = 0; i <
n; i++) {
70 if (!(fmts =
av_malloc((count+1) *
sizeof(
int))))
72 for (j = 0, i = 0; i <
n; i++) {
100 int stream_idx, sink_idx;
102 for (stream_idx = 0; stream_idx < lavfi->
nb_sinks; stream_idx++) {
126 #define FAIL(ERR) { ret = ERR; goto end; }
138 "Only one of the graph or graph_file options must be specified\n");
143 AVBPrint graph_file_pb;
170 &input_links, &output_links, avctx)) < 0)
175 "Open inputs in the filtergraph are not acceptable\n");
180 for (n = 0, inout = output_links; inout; n++, inout = inout->next);
192 for (i = 0; i <
n; i++)
197 for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
198 int stream_idx = 0, suffix = 0, use_subcc = 0;
199 sscanf(inout->name,
"out%n%d%n", &suffix, &stream_idx, &suffix);
202 "Invalid outpad name '%s'\n", inout->name);
205 if (inout->name[suffix]) {
206 if (!strcmp(inout->name + suffix,
"+subcc")) {
210 "Invalid outpad suffix '%s'\n", inout->name);
215 if ((
unsigned)stream_idx >= n) {
217 "Invalid index was specified in output '%s', "
218 "must be a non-negative value < %d\n",
225 "An output with stream index %d was already specified\n",
235 for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
247 for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
286 "Output '%s' is not a video or audio output, not yet supported\n", inout->name);
290 lavfi->
sinks[i] = sink;
291 if ((ret =
avfilter_link(inout->filter_ctx, inout->pad_idx, sink, 0)) < 0)
307 for (i = 0; i < lavfi->
nb_sinks; i++) {
333 "Could not find PCM codec for sample format %s.\n",
358 int stream_idx, i,
ret;
380 double min_pts = DBL_MAX;
381 int stream_idx, min_pts_sink_idx = 0;
398 for (i = 0; i < lavfi->
nb_sinks; i++) {
409 av_dlog(avctx,
"EOF sink_idx:%d\n", i);
415 av_dlog(avctx,
"sink_idx:%d time:%f\n", i, d);
420 min_pts_sink_idx = i;
423 if (min_pts == DBL_MAX)
426 av_dlog(avctx,
"min_pts_sink_idx:%i\n", min_pts_sink_idx);
436 memcpy(pict.
data, frame->
data, 4*
sizeof(frame->
data[0]));
446 memcpy(pkt->
data, frame->
data[0], size);
450 if (frame_metadata) {
468 memcpy(metadata, meta_buf.str, meta_buf.len);
486 #define OFFSET(x) offsetof(LavfiContext, x)
488 #define DEC AV_OPT_FLAG_DECODING_PARAM
513 .priv_class = &lavfi_class,