72 #define OFFSET(x) offsetof(MovieContext, x)
73 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
94 int i,
ret, already = 0, stream_id = -1;
95 char type_char[2],
dummy;
99 ret = sscanf(spec,
"d%1[av]%d%c", type_char, &stream_id, &dummy);
100 if (ret >= 1 && ret <= 2) {
114 "Invalid stream specifier \"%s\"\n", spec);
125 "Ambiguous stream specifier \"%s\", using #%d\n", spec, i);
132 already ?
"matched only already used streams" :
133 "did not match any stream");
139 "currently unsupported by libavfilter\n", spec,
175 "Channel layout is not set in stream %d, and could not "
176 "be guessed from the number of channels (%d)\n",
183 "Channel layout is not set in output stream %d, "
184 "guessed channel layout is '%s'\n",
195 int nb_streams,
ret, i;
196 char default_streams[16], *stream_specs, *spec, *cursor;
209 snprintf(default_streams,
sizeof(default_streams),
"d%c%d",
210 !strcmp(ctx->
filter->
name,
"amovie") ?
'a' :
'v',
212 stream_specs = default_streams;
214 for (cursor = stream_specs, nb_streams = 1; *cursor; cursor++)
218 if (movie->
loop_count != 1 && nb_streams != 1) {
220 "Loop with several streams is currently unsupported\n");
232 "Failed to avformat_open_input '%s'\n", movie->
file_name);
245 "%s: seek value overflow with start_time:%"PRId64
" seek_point:%"PRId64
"\n",
265 for (i = 0; i < nb_streams; i++) {
266 spec =
av_strtok(stream_specs,
"+", &cursor);
274 movie->
st[i].
st = st;
286 for (i = 0; i < nb_streams; i++)
289 for (i = 0; i < nb_streams; i++) {
291 snprintf(name,
sizeof(name),
"out%d", i);
308 av_log(ctx,
AV_LOG_VERBOSE,
"seek_point:%"PRIi64
" format_name:%s file_name:%s stream_index:%d\n",
335 int list[] = { 0, -1 };
336 int64_t list64[] = { 0, -1 };
391 switch (frame->
type) {
394 "video pts:%s time:%s size:%dx%d aspect:%d/%d",
402 "audio pts:%s time:%s samples:%d",
413 #define describe_frameref(f, link) \
414 describe_frame_to_str((char[1024]){0}, 1024, f, link)
455 int ret, got_frame = 0, pkt_out_id;
460 if (movie->
st[out_id].
done) {
490 if (pkt_out_id < 0) {
496 st = &movie->
st[pkt_out_id];
497 outlink = ctx->
outputs[pkt_out_id];
527 if (pkt->
size <= 0) {
548 return pkt_out_id == out_id;
560 return FFMIN(ret, 0);
564 #if CONFIG_MOVIE_FILTER
572 .priv_class = &movie_class,
584 #if CONFIG_AMOVIE_FILTER
586 #define amovie_options movie_options
599 .priv_class = &amovie_class,