58 int i, j, *fmts, count = 0;
60 for (i = 0; i < n; i++) {
66 if (!(fmts =
av_malloc((count+1) *
sizeof(
int))))
68 for (j = 0, i = 0; i < n; i++) {
99 #define FAIL(ERR) { ret = ERR; goto end; }
111 "Only one of the graph or graph_file options must be specified\n");
119 &file_buf, &file_bufsize, 0, avctx);
129 memcpy(graph_buf, file_buf, file_bufsize);
130 graph_buf[file_bufsize] = 0;
143 &input_links, &output_links, avctx)) < 0)
148 "Open inputs in the filtergraph are not acceptable\n");
153 for (n = 0, inout = output_links; inout; n++, inout = inout->next);
162 for (i = 0; i < n; i++)
167 for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
169 if (!strcmp(inout->name,
"out"))
171 else if (sscanf(inout->name,
"out%d\n", &stream_idx) != 1) {
173 "Invalid outpad name '%s'\n", inout->name);
177 if ((
unsigned)stream_idx >= n) {
179 "Invalid index was specified in output '%s', "
180 "must be a non-negative value < %d\n",
186 type = inout->filter_ctx->output_pads[inout->pad_idx].type;
189 "Output '%s' is not a video or audio output, not yet supported\n", inout->name);
195 "An output with stream index %d was already specified\n",
204 for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
216 for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
233 buffersink_params, lavfi->
graph);
249 abuffersink_params, lavfi->
graph);
255 lavfi->
sinks[i] = sink;
256 if ((ret =
avfilter_link(inout->filter_ctx, inout->pad_idx, sink, 0)) < 0)
298 "Could not find PCM codec for sample format %s.\n",
315 double min_pts = DBL_MAX;
316 int stream_idx, min_pts_sink_idx = 0;
335 av_dlog(avctx,
"EOF sink_idx:%d\n", i);
341 av_dlog(avctx,
"sink_idx:%d time:%f\n", i, d);
345 min_pts_sink_idx = i;
348 if (min_pts == DBL_MAX)
351 av_dlog(avctx,
"min_pts_sink_idx:%i\n", min_pts_sink_idx);
366 }
else if (ref->
audio) {
372 memcpy(pkt->
data, ref->
data[0], size);
393 memcpy(metadata, meta_buf.str, meta_buf.len);
405 #define OFFSET(x) offsetof(LavfiContext, x)
407 #define DEC AV_OPT_FLAG_DECODING_PARAM
431 .priv_class = &lavfi_class,