59 int i, j, *fmts,
count = 0;
61 for (i = 0; i <
n; i++) {
67 if (!(fmts =
av_malloc((count+1) *
sizeof(
int))))
69 for (j = 0, i = 0; i <
n; i++) {
95 AVFilterInOut *input_links = NULL, *output_links = NULL, *inout;
101 #define FAIL(ERR) { ret = ERR; goto end; }
113 "Only one of the graph or graph_file options must be specified\n");
121 &file_buf, &file_bufsize, 0, avctx);
131 memcpy(graph_buf, file_buf, file_bufsize);
132 graph_buf[file_bufsize] = 0;
145 &input_links, &output_links, avctx)) < 0)
150 "Open inputs in the filtergraph are not acceptable\n");
155 for (n = 0, inout = output_links; inout; n++, inout = inout->next);
164 for (i = 0; i <
n; i++)
169 for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
171 if (!strcmp(inout->name,
"out"))
173 else if (sscanf(inout->name,
"out%d\n", &stream_idx) != 1) {
175 "Invalid outpad name '%s'\n", inout->name);
179 if ((
unsigned)stream_idx >= n) {
181 "Invalid index was specified in output '%s', "
182 "must be a non-negative value < %d\n",
188 type = inout->filter_ctx->output_pads[inout->pad_idx].type;
191 "Output '%s' is not a video or audio output, not yet supported\n", inout->name);
197 "An output with stream index %d was already specified\n",
206 for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
218 for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
253 lavfi->
sinks[i] = sink;
254 if ((ret =
avfilter_link(inout->filter_ctx, inout->pad_idx, sink, 0)) < 0)
296 "Could not find PCM codec for sample format %s.\n",
316 double min_pts = DBL_MAX;
317 int stream_idx, min_pts_sink_idx = 0;
337 av_dlog(avctx,
"EOF sink_idx:%d\n", i);
343 av_dlog(avctx,
"sink_idx:%d time:%f\n", i, d);
348 min_pts_sink_idx = i;
351 if (min_pts == DBL_MAX)
354 av_dlog(avctx,
"min_pts_sink_idx:%i\n", min_pts_sink_idx);
364 memcpy(pict.
data, frame->
data, 4*
sizeof(frame->
data[0]));
374 memcpy(pkt->
data, frame->
data[0], size);
378 if (frame_metadata) {
396 memcpy(metadata, meta_buf.str, meta_buf.len);
408 #define OFFSET(x) offsetof(LavfiContext, x)
410 #define DEC AV_OPT_FLAG_DECODING_PARAM
434 .priv_class = &lavfi_class,