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",
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; *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",
266 spec =
av_strtok(stream_specs,
"+", &cursor);
274 movie->
st[i].
st = st;
289 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",
334 int list[] = { 0, -1 };
335 int64_t list64[] = { 0, -1 };
390 switch (frame_type) {
393 "video pts:%s time:%s size:%dx%d aspect:%d/%d",
401 "audio pts:%s time:%s samples:%d",
452 int ret, got_frame = 0, pkt_out_id;
458 if (movie->
st[out_id].
done) {
488 if (pkt_out_id < 0) {
494 st = &movie->
st[pkt_out_id];
495 outlink = ctx->
outputs[pkt_out_id];
502 switch (frame_type) {
526 if (pkt->
size <= 0) {
556 return pkt_out_id == out_id;
568 return FFMIN(ret, 0);
572 #if CONFIG_MOVIE_FILTER
580 .priv_class = &movie_class,
592 #if CONFIG_AMOVIE_FILTER
594 #define amovie_options movie_options
607 .priv_class = &amovie_class,