You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

614 lines
20KB

  1. /*
  2. * Copyright (c) 2010 Stefano Sabatini
  3. * Copyright (c) 2008 Victor Paesa
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file
  23. * movie video source
  24. *
  25. * @todo use direct rendering (no allocation of a new frame)
  26. * @todo support a PTS correction mechanism
  27. */
  28. #include <float.h>
  29. #include <stdint.h>
  30. #include "libavutil/attributes.h"
  31. #include "libavutil/avstring.h"
  32. #include "libavutil/avassert.h"
  33. #include "libavutil/opt.h"
  34. #include "libavutil/imgutils.h"
  35. #include "libavutil/timestamp.h"
  36. #include "libavformat/avformat.h"
  37. #include "audio.h"
  38. #include "avcodec.h"
  39. #include "avfilter.h"
  40. #include "formats.h"
  41. #include "internal.h"
  42. #include "video.h"
  43. typedef struct MovieStream {
  44. AVStream *st;
  45. int done;
  46. } MovieStream;
  47. typedef struct MovieContext {
  48. /* common A/V fields */
  49. const AVClass *class;
  50. int64_t seek_point; ///< seekpoint in microseconds
  51. double seek_point_d;
  52. char *format_name;
  53. char *file_name;
  54. char *stream_specs; /**< user-provided list of streams, separated by + */
  55. int stream_index; /**< for compatibility */
  56. int loop_count;
  57. AVFormatContext *format_ctx;
  58. int eof;
  59. AVPacket pkt, pkt0;
  60. AVFrame *frame; ///< video frame to store the decoded images in
  61. int max_stream_index; /**< max stream # actually used for output */
  62. MovieStream *st; /**< array of all streams, one per output */
  63. int *out_index; /**< stream number -> output number map, or -1 */
  64. } MovieContext;
  65. #define OFFSET(x) offsetof(MovieContext, x)
  66. #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
  67. static const AVOption movie_options[]= {
  68. { "filename", NULL, OFFSET(file_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
  69. { "format_name", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
  70. { "f", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
  71. { "stream_index", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
  72. { "si", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
  73. { "seek_point", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, (INT64_MAX-1) / 1000000, FLAGS },
  74. { "sp", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, (INT64_MAX-1) / 1000000, FLAGS },
  75. { "streams", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MAX, CHAR_MAX, FLAGS },
  76. { "s", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MAX, CHAR_MAX, FLAGS },
  77. { "loop", "set loop count", OFFSET(loop_count), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, FLAGS },
  78. { NULL },
  79. };
  80. static int movie_config_output_props(AVFilterLink *outlink);
  81. static int movie_request_frame(AVFilterLink *outlink);
  82. static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec)
  83. {
  84. int i, ret, already = 0, stream_id = -1;
  85. char type_char[2], dummy;
  86. AVStream *found = NULL;
  87. enum AVMediaType type;
  88. ret = sscanf(spec, "d%1[av]%d%c", type_char, &stream_id, &dummy);
  89. if (ret >= 1 && ret <= 2) {
  90. type = type_char[0] == 'v' ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;
  91. ret = av_find_best_stream(avf, type, stream_id, -1, NULL, 0);
  92. if (ret < 0) {
  93. av_log(log, AV_LOG_ERROR, "No %s stream with index '%d' found\n",
  94. av_get_media_type_string(type), stream_id);
  95. return NULL;
  96. }
  97. return avf->streams[ret];
  98. }
  99. for (i = 0; i < avf->nb_streams; i++) {
  100. ret = avformat_match_stream_specifier(avf, avf->streams[i], spec);
  101. if (ret < 0) {
  102. av_log(log, AV_LOG_ERROR,
  103. "Invalid stream specifier \"%s\"\n", spec);
  104. return NULL;
  105. }
  106. if (!ret)
  107. continue;
  108. if (avf->streams[i]->discard != AVDISCARD_ALL) {
  109. already++;
  110. continue;
  111. }
  112. if (found) {
  113. av_log(log, AV_LOG_WARNING,
  114. "Ambiguous stream specifier \"%s\", using #%d\n", spec, i);
  115. break;
  116. }
  117. found = avf->streams[i];
  118. }
  119. if (!found) {
  120. av_log(log, AV_LOG_WARNING, "Stream specifier \"%s\" %s\n", spec,
  121. already ? "matched only already used streams" :
  122. "did not match any stream");
  123. return NULL;
  124. }
  125. if (found->codec->codec_type != AVMEDIA_TYPE_VIDEO &&
  126. found->codec->codec_type != AVMEDIA_TYPE_AUDIO) {
  127. av_log(log, AV_LOG_ERROR, "Stream specifier \"%s\" matched a %s stream,"
  128. "currently unsupported by libavfilter\n", spec,
  129. av_get_media_type_string(found->codec->codec_type));
  130. return NULL;
  131. }
  132. return found;
  133. }
  134. static int open_stream(void *log, MovieStream *st)
  135. {
  136. AVCodec *codec;
  137. int ret;
  138. codec = avcodec_find_decoder(st->st->codec->codec_id);
  139. if (!codec) {
  140. av_log(log, AV_LOG_ERROR, "Failed to find any codec\n");
  141. return AVERROR(EINVAL);
  142. }
  143. st->st->codec->refcounted_frames = 1;
  144. if ((ret = avcodec_open2(st->st->codec, codec, NULL)) < 0) {
  145. av_log(log, AV_LOG_ERROR, "Failed to open codec\n");
  146. return ret;
  147. }
  148. return 0;
  149. }
  150. static int guess_channel_layout(MovieStream *st, int st_index, void *log_ctx)
  151. {
  152. AVCodecContext *dec_ctx = st->st->codec;
  153. char buf[256];
  154. int64_t chl = av_get_default_channel_layout(dec_ctx->channels);
  155. if (!chl) {
  156. av_log(log_ctx, AV_LOG_ERROR,
  157. "Channel layout is not set in stream %d, and could not "
  158. "be guessed from the number of channels (%d)\n",
  159. st_index, dec_ctx->channels);
  160. return AVERROR(EINVAL);
  161. }
  162. av_get_channel_layout_string(buf, sizeof(buf), dec_ctx->channels, chl);
  163. av_log(log_ctx, AV_LOG_WARNING,
  164. "Channel layout is not set in output stream %d, "
  165. "guessed channel layout is '%s'\n",
  166. st_index, buf);
  167. dec_ctx->channel_layout = chl;
  168. return 0;
  169. }
  170. static av_cold int movie_common_init(AVFilterContext *ctx)
  171. {
  172. MovieContext *movie = ctx->priv;
  173. AVInputFormat *iformat = NULL;
  174. int64_t timestamp;
  175. int nb_streams, ret, i;
  176. char default_streams[16], *stream_specs, *spec, *cursor;
  177. char name[16];
  178. AVStream *st;
  179. if (!movie->file_name) {
  180. av_log(ctx, AV_LOG_ERROR, "No filename provided!\n");
  181. return AVERROR(EINVAL);
  182. }
  183. movie->seek_point = movie->seek_point_d * 1000000 + 0.5;
  184. stream_specs = movie->stream_specs;
  185. if (!stream_specs) {
  186. snprintf(default_streams, sizeof(default_streams), "d%c%d",
  187. !strcmp(ctx->filter->name, "amovie") ? 'a' : 'v',
  188. movie->stream_index);
  189. stream_specs = default_streams;
  190. }
  191. for (cursor = stream_specs, nb_streams = 1; *cursor; cursor++)
  192. if (*cursor == '+')
  193. nb_streams++;
  194. if (movie->loop_count != 1 && nb_streams != 1) {
  195. av_log(ctx, AV_LOG_ERROR,
  196. "Loop with several streams is currently unsupported\n");
  197. return AVERROR_PATCHWELCOME;
  198. }
  199. av_register_all();
  200. // Try to find the movie format (container)
  201. iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
  202. movie->format_ctx = NULL;
  203. if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
  204. av_log(ctx, AV_LOG_ERROR,
  205. "Failed to avformat_open_input '%s'\n", movie->file_name);
  206. return ret;
  207. }
  208. if ((ret = avformat_find_stream_info(movie->format_ctx, NULL)) < 0)
  209. av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
  210. // if seeking requested, we execute it
  211. if (movie->seek_point > 0) {
  212. timestamp = movie->seek_point;
  213. // add the stream start time, should it exist
  214. if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
  215. if (timestamp > INT64_MAX - movie->format_ctx->start_time) {
  216. av_log(ctx, AV_LOG_ERROR,
  217. "%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\n",
  218. movie->file_name, movie->format_ctx->start_time, movie->seek_point);
  219. return AVERROR(EINVAL);
  220. }
  221. timestamp += movie->format_ctx->start_time;
  222. }
  223. if ((ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD)) < 0) {
  224. av_log(ctx, AV_LOG_ERROR, "%s: could not seek to position %"PRId64"\n",
  225. movie->file_name, timestamp);
  226. return ret;
  227. }
  228. }
  229. for (i = 0; i < movie->format_ctx->nb_streams; i++)
  230. movie->format_ctx->streams[i]->discard = AVDISCARD_ALL;
  231. movie->st = av_calloc(nb_streams, sizeof(*movie->st));
  232. if (!movie->st)
  233. return AVERROR(ENOMEM);
  234. for (i = 0; i < nb_streams; i++) {
  235. spec = av_strtok(stream_specs, "+", &cursor);
  236. if (!spec)
  237. return AVERROR_BUG;
  238. stream_specs = NULL; /* for next strtok */
  239. st = find_stream(ctx, movie->format_ctx, spec);
  240. if (!st)
  241. return AVERROR(EINVAL);
  242. st->discard = AVDISCARD_DEFAULT;
  243. movie->st[i].st = st;
  244. movie->max_stream_index = FFMAX(movie->max_stream_index, st->index);
  245. }
  246. if (av_strtok(NULL, "+", &cursor))
  247. return AVERROR_BUG;
  248. movie->out_index = av_calloc(movie->max_stream_index + 1,
  249. sizeof(*movie->out_index));
  250. if (!movie->out_index)
  251. return AVERROR(ENOMEM);
  252. for (i = 0; i <= movie->max_stream_index; i++)
  253. movie->out_index[i] = -1;
  254. for (i = 0; i < nb_streams; i++)
  255. movie->out_index[movie->st[i].st->index] = i;
  256. for (i = 0; i < nb_streams; i++) {
  257. AVFilterPad pad = { 0 };
  258. snprintf(name, sizeof(name), "out%d", i);
  259. pad.type = movie->st[i].st->codec->codec_type;
  260. pad.name = av_strdup(name);
  261. pad.config_props = movie_config_output_props;
  262. pad.request_frame = movie_request_frame;
  263. ff_insert_outpad(ctx, i, &pad);
  264. ret = open_stream(ctx, &movie->st[i]);
  265. if (ret < 0)
  266. return ret;
  267. if ( movie->st[i].st->codec->codec->type == AVMEDIA_TYPE_AUDIO &&
  268. !movie->st[i].st->codec->channel_layout) {
  269. ret = guess_channel_layout(&movie->st[i], i, ctx);
  270. if (ret < 0)
  271. return ret;
  272. }
  273. }
  274. av_log(ctx, AV_LOG_VERBOSE, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\n",
  275. movie->seek_point, movie->format_name, movie->file_name,
  276. movie->stream_index);
  277. return 0;
  278. }
  279. static av_cold void movie_uninit(AVFilterContext *ctx)
  280. {
  281. MovieContext *movie = ctx->priv;
  282. int i;
  283. for (i = 0; i < ctx->nb_outputs; i++) {
  284. av_freep(&ctx->output_pads[i].name);
  285. if (movie->st[i].st)
  286. avcodec_close(movie->st[i].st->codec);
  287. }
  288. av_freep(&movie->st);
  289. av_freep(&movie->out_index);
  290. av_frame_free(&movie->frame);
  291. if (movie->format_ctx)
  292. avformat_close_input(&movie->format_ctx);
  293. }
  294. static int movie_query_formats(AVFilterContext *ctx)
  295. {
  296. MovieContext *movie = ctx->priv;
  297. int list[] = { 0, -1 };
  298. int64_t list64[] = { 0, -1 };
  299. int i;
  300. for (i = 0; i < ctx->nb_outputs; i++) {
  301. MovieStream *st = &movie->st[i];
  302. AVCodecContext *c = st->st->codec;
  303. AVFilterLink *outlink = ctx->outputs[i];
  304. switch (c->codec_type) {
  305. case AVMEDIA_TYPE_VIDEO:
  306. list[0] = c->pix_fmt;
  307. ff_formats_ref(ff_make_format_list(list), &outlink->in_formats);
  308. break;
  309. case AVMEDIA_TYPE_AUDIO:
  310. list[0] = c->sample_fmt;
  311. ff_formats_ref(ff_make_format_list(list), &outlink->in_formats);
  312. list[0] = c->sample_rate;
  313. ff_formats_ref(ff_make_format_list(list), &outlink->in_samplerates);
  314. list64[0] = c->channel_layout;
  315. ff_channel_layouts_ref(avfilter_make_format64_list(list64),
  316. &outlink->in_channel_layouts);
  317. break;
  318. }
  319. }
  320. return 0;
  321. }
  322. static int movie_config_output_props(AVFilterLink *outlink)
  323. {
  324. AVFilterContext *ctx = outlink->src;
  325. MovieContext *movie = ctx->priv;
  326. unsigned out_id = FF_OUTLINK_IDX(outlink);
  327. MovieStream *st = &movie->st[out_id];
  328. AVCodecContext *c = st->st->codec;
  329. outlink->time_base = st->st->time_base;
  330. switch (c->codec_type) {
  331. case AVMEDIA_TYPE_VIDEO:
  332. outlink->w = c->width;
  333. outlink->h = c->height;
  334. outlink->frame_rate = st->st->r_frame_rate;
  335. break;
  336. case AVMEDIA_TYPE_AUDIO:
  337. break;
  338. }
  339. return 0;
  340. }
  341. static char *describe_frame_to_str(char *dst, size_t dst_size,
  342. AVFrame *frame, enum AVMediaType frame_type,
  343. AVFilterLink *link)
  344. {
  345. switch (frame_type) {
  346. case AVMEDIA_TYPE_VIDEO:
  347. snprintf(dst, dst_size,
  348. "video pts:%s time:%s size:%dx%d aspect:%d/%d",
  349. av_ts2str(frame->pts), av_ts2timestr(frame->pts, &link->time_base),
  350. frame->width, frame->height,
  351. frame->sample_aspect_ratio.num,
  352. frame->sample_aspect_ratio.den);
  353. break;
  354. case AVMEDIA_TYPE_AUDIO:
  355. snprintf(dst, dst_size,
  356. "audio pts:%s time:%s samples:%d",
  357. av_ts2str(frame->pts), av_ts2timestr(frame->pts, &link->time_base),
  358. frame->nb_samples);
  359. break;
  360. default:
  361. snprintf(dst, dst_size, "%s BUG", av_get_media_type_string(frame_type));
  362. break;
  363. }
  364. return dst;
  365. }
  366. static int rewind_file(AVFilterContext *ctx)
  367. {
  368. MovieContext *movie = ctx->priv;
  369. int64_t timestamp = movie->seek_point;
  370. int ret, i;
  371. if (movie->format_ctx->start_time != AV_NOPTS_VALUE)
  372. timestamp += movie->format_ctx->start_time;
  373. ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD);
  374. if (ret < 0) {
  375. av_log(ctx, AV_LOG_ERROR, "Unable to loop: %s\n", av_err2str(ret));
  376. movie->loop_count = 1; /* do not try again */
  377. return ret;
  378. }
  379. for (i = 0; i < ctx->nb_outputs; i++) {
  380. avcodec_flush_buffers(movie->st[i].st->codec);
  381. movie->st[i].done = 0;
  382. }
  383. movie->eof = 0;
  384. return 0;
  385. }
  386. /**
  387. * Try to push a frame to the requested output.
  388. *
  389. * @param ctx filter context
  390. * @param out_id number of output where a frame is wanted;
  391. * if the frame is read from file, used to set the return value;
  392. * if the codec is being flushed, flush the corresponding stream
  393. * @return 1 if a frame was pushed on the requested output,
  394. * 0 if another attempt is possible,
  395. * <0 AVERROR code
  396. */
  397. static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
  398. {
  399. MovieContext *movie = ctx->priv;
  400. AVPacket *pkt = &movie->pkt;
  401. enum AVMediaType frame_type;
  402. MovieStream *st;
  403. int ret, got_frame = 0, pkt_out_id;
  404. AVFilterLink *outlink;
  405. if (!pkt->size) {
  406. if (movie->eof) {
  407. if (movie->st[out_id].done) {
  408. if (movie->loop_count != 1) {
  409. ret = rewind_file(ctx);
  410. if (ret < 0)
  411. return ret;
  412. movie->loop_count -= movie->loop_count > 1;
  413. av_log(ctx, AV_LOG_VERBOSE, "Stream finished, looping.\n");
  414. return 0; /* retry */
  415. }
  416. return AVERROR_EOF;
  417. }
  418. pkt->stream_index = movie->st[out_id].st->index;
  419. /* packet is already ready for flushing */
  420. } else {
  421. ret = av_read_frame(movie->format_ctx, &movie->pkt0);
  422. if (ret < 0) {
  423. av_init_packet(&movie->pkt0); /* ready for flushing */
  424. *pkt = movie->pkt0;
  425. if (ret == AVERROR_EOF) {
  426. movie->eof = 1;
  427. return 0; /* start flushing */
  428. }
  429. return ret;
  430. }
  431. *pkt = movie->pkt0;
  432. }
  433. }
  434. pkt_out_id = pkt->stream_index > movie->max_stream_index ? -1 :
  435. movie->out_index[pkt->stream_index];
  436. if (pkt_out_id < 0) {
  437. av_free_packet(&movie->pkt0);
  438. pkt->size = 0; /* ready for next run */
  439. pkt->data = NULL;
  440. return 0;
  441. }
  442. st = &movie->st[pkt_out_id];
  443. outlink = ctx->outputs[pkt_out_id];
  444. movie->frame = av_frame_alloc();
  445. if (!movie->frame)
  446. return AVERROR(ENOMEM);
  447. frame_type = st->st->codec->codec_type;
  448. switch (frame_type) {
  449. case AVMEDIA_TYPE_VIDEO:
  450. ret = avcodec_decode_video2(st->st->codec, movie->frame, &got_frame, pkt);
  451. break;
  452. case AVMEDIA_TYPE_AUDIO:
  453. ret = avcodec_decode_audio4(st->st->codec, movie->frame, &got_frame, pkt);
  454. break;
  455. default:
  456. ret = AVERROR(ENOSYS);
  457. break;
  458. }
  459. if (ret < 0) {
  460. av_log(ctx, AV_LOG_WARNING, "Decode error: %s\n", av_err2str(ret));
  461. av_frame_free(&movie->frame);
  462. av_free_packet(&movie->pkt0);
  463. movie->pkt.size = 0;
  464. movie->pkt.data = NULL;
  465. return 0;
  466. }
  467. if (!ret || st->st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
  468. ret = pkt->size;
  469. pkt->data += ret;
  470. pkt->size -= ret;
  471. if (pkt->size <= 0) {
  472. av_free_packet(&movie->pkt0);
  473. pkt->size = 0; /* ready for next run */
  474. pkt->data = NULL;
  475. }
  476. if (!got_frame) {
  477. if (!ret)
  478. st->done = 1;
  479. av_frame_free(&movie->frame);
  480. return 0;
  481. }
  482. movie->frame->pts = av_frame_get_best_effort_timestamp(movie->frame);
  483. av_dlog(ctx, "movie_push_frame(): file:'%s' %s\n", movie->file_name,
  484. describe_frame_to_str((char[1024]){0}, 1024, movie->frame, frame_type, outlink));
  485. if (st->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
  486. if (movie->frame->format != outlink->format) {
  487. av_log(ctx, AV_LOG_ERROR, "Format changed %s -> %s, discarding frame\n",
  488. av_get_pix_fmt_name(outlink->format),
  489. av_get_pix_fmt_name(movie->frame->format)
  490. );
  491. av_frame_free(&movie->frame);
  492. return 0;
  493. }
  494. }
  495. ret = ff_filter_frame(outlink, movie->frame);
  496. movie->frame = NULL;
  497. if (ret < 0)
  498. return ret;
  499. return pkt_out_id == out_id;
  500. }
  501. static int movie_request_frame(AVFilterLink *outlink)
  502. {
  503. AVFilterContext *ctx = outlink->src;
  504. unsigned out_id = FF_OUTLINK_IDX(outlink);
  505. int ret;
  506. while (1) {
  507. ret = movie_push_frame(ctx, out_id);
  508. if (ret)
  509. return FFMIN(ret, 0);
  510. }
  511. }
  512. #if CONFIG_MOVIE_FILTER
  513. AVFILTER_DEFINE_CLASS(movie);
  514. AVFilter ff_avsrc_movie = {
  515. .name = "movie",
  516. .description = NULL_IF_CONFIG_SMALL("Read from a movie source."),
  517. .priv_size = sizeof(MovieContext),
  518. .priv_class = &movie_class,
  519. .init = movie_common_init,
  520. .uninit = movie_uninit,
  521. .query_formats = movie_query_formats,
  522. .inputs = NULL,
  523. .outputs = NULL,
  524. .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
  525. };
  526. #endif /* CONFIG_MOVIE_FILTER */
  527. #if CONFIG_AMOVIE_FILTER
  528. #define amovie_options movie_options
  529. AVFILTER_DEFINE_CLASS(amovie);
  530. AVFilter ff_avsrc_amovie = {
  531. .name = "amovie",
  532. .description = NULL_IF_CONFIG_SMALL("Read audio from a movie source."),
  533. .priv_size = sizeof(MovieContext),
  534. .init = movie_common_init,
  535. .uninit = movie_uninit,
  536. .query_formats = movie_query_formats,
  537. .inputs = NULL,
  538. .outputs = NULL,
  539. .priv_class = &amovie_class,
  540. .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
  541. };
  542. #endif /* CONFIG_AMOVIE_FILTER */