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.

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