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) {
257 lavfi->
sinks[i] = sink;
258 if ((ret =
avfilter_link(inout->filter_ctx, inout->pad_idx, sink, 0)) < 0)
300 "Could not find PCM codec for sample format %s.\n",
320 double min_pts = DBL_MAX;
321 int stream_idx, min_pts_sink_idx = 0;
341 av_dlog(avctx,
"EOF sink_idx:%d\n", i);
347 av_dlog(avctx,
"sink_idx:%d time:%f\n", i, d);
352 min_pts_sink_idx = i;
355 if (min_pts == DBL_MAX)
358 av_dlog(avctx,
"min_pts_sink_idx:%i\n", min_pts_sink_idx);
368 memcpy(pict.
data, frame->
data, 4*
sizeof(frame->
data[0]));
378 memcpy(pkt->
data, frame->
data[0], size);
382 if (frame_metadata) {
400 memcpy(metadata, meta_buf.str, meta_buf.len);
412 #define OFFSET(x) offsetof(LavfiContext, x)
414 #define DEC AV_OPT_FLAG_DECODING_PARAM
439 .priv_class = &lavfi_class,