FFmpeg
src_movie.c
Go to the documentation of this file.
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 /**
23  * @file
24  * movie video source
25  *
26  * @todo support a PTS correction mechanism
27  */
28 
29 #include "config_components.h"
30 
31 #include <stdint.h>
32 
33 #include "libavutil/attributes.h"
34 #include "libavutil/avstring.h"
36 #include "libavutil/mem.h"
37 #include "libavutil/opt.h"
38 #include "libavutil/internal.h"
39 
40 #include "libavcodec/avcodec.h"
41 
42 #include "libavformat/avformat.h"
43 
44 #include "audio.h"
45 #include "avfilter.h"
46 #include "filters.h"
47 #include "formats.h"
48 #include "video.h"
49 
50 typedef struct MovieStream {
57  int eof;
58 } MovieStream;
59 
60 typedef struct MovieContext {
61  /* common A/V fields */
62  const AVClass *class;
63  int64_t seek_point; ///< seekpoint in microseconds
64  double seek_point_d;
65  char *format_name;
66  char *file_name;
67  char *stream_specs; /**< user-provided list of streams, separated by + */
68  int stream_index; /**< for compatibility */
73 
76 
77  int eof;
78  int max_stream_index; /**< max stream # actually used for output */
79  MovieStream *st; /**< array of all streams, one per output */
80  int *out_index; /**< stream number -> output number map, or -1 */
82 } MovieContext;
83 
84 #define OFFSET(x) offsetof(MovieContext, x)
85 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
86 
87 static const AVOption movie_options[]= {
88  { "filename", NULL, OFFSET(file_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
89  { "format_name", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
90  { "f", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
91  { "stream_index", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
92  { "si", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
93  { "seek_point", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, (INT64_MAX-1) / 1000000, FLAGS },
94  { "sp", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, (INT64_MAX-1) / 1000000, FLAGS },
95  { "streams", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, 0, 0, FLAGS },
96  { "s", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, 0, 0, FLAGS },
97  { "loop", "set loop count", OFFSET(loop_count), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, FLAGS },
98  { "discontinuity", "set discontinuity threshold", OFFSET(discontinuity_threshold), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, FLAGS },
99  { "dec_threads", "set the number of threads for decoding", OFFSET(dec_threads), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
100  { "format_opts", "set format options for the opened file", OFFSET(format_opts), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, FLAGS},
101  { NULL },
102 };
103 
104 static int movie_config_output_props(AVFilterLink *outlink);
105 
106 static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec)
107 {
108  int i, ret, already = 0, stream_id = -1;
109  char type_char[2], dummy;
110  AVStream *found = NULL;
111  enum AVMediaType type;
112 
113  ret = sscanf(spec, "d%1[av]%d%c", type_char, &stream_id, &dummy);
114  if (ret >= 1 && ret <= 2) {
115  type = type_char[0] == 'v' ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;
116  ret = av_find_best_stream(avf, type, stream_id, -1, NULL, 0);
117  if (ret < 0) {
118  av_log(log, AV_LOG_ERROR, "No %s stream with index '%d' found\n",
119  av_get_media_type_string(type), stream_id);
120  return NULL;
121  }
122  return avf->streams[ret];
123  }
124  for (i = 0; i < avf->nb_streams; i++) {
125  ret = avformat_match_stream_specifier(avf, avf->streams[i], spec);
126  if (ret < 0) {
128  "Invalid stream specifier \"%s\"\n", spec);
129  return NULL;
130  }
131  if (!ret)
132  continue;
133  if (avf->streams[i]->discard != AVDISCARD_ALL) {
134  already++;
135  continue;
136  }
137  if (found) {
139  "Ambiguous stream specifier \"%s\", using #%d\n", spec, i);
140  break;
141  }
142  found = avf->streams[i];
143  }
144  if (!found) {
145  av_log(log, AV_LOG_WARNING, "Stream specifier \"%s\" %s\n", spec,
146  already ? "matched only already used streams" :
147  "did not match any stream");
148  return NULL;
149  }
150  if (found->codecpar->codec_type != AVMEDIA_TYPE_VIDEO &&
152  av_log(log, AV_LOG_ERROR, "Stream specifier \"%s\" matched a %s stream,"
153  "currently unsupported by libavfilter\n", spec,
155  return NULL;
156  }
157  return found;
158 }
159 
160 static int get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
161 {
162  int linesize_align[AV_NUM_DATA_POINTERS];
163  MovieStream *st = avctx->opaque;
164  AVFilterLink *outlink = st->link;
165  int w, h, ow, oh, copy = 0;
166  AVFrame *new;
167 
168  h = oh = frame->height;
169  w = ow = frame->width;
170 
171  copy = frame->format != outlink->format;
172  switch (avctx->codec_type) {
173  case AVMEDIA_TYPE_VIDEO:
174  if (w != outlink->w || h != outlink->h)
175  copy |= 1;
176  break;
177  case AVMEDIA_TYPE_AUDIO:
178  if (outlink->sample_rate != frame->sample_rate ||
179  av_channel_layout_compare(&outlink->ch_layout, &frame->ch_layout))
180  copy |= 1;
181  break;
182  }
183 
184  if (copy || !(avctx->codec->capabilities & AV_CODEC_CAP_DR1))
185  return avcodec_default_get_buffer2(avctx, frame, flags);
186 
187  switch (avctx->codec_type) {
188  case AVMEDIA_TYPE_VIDEO:
189  avcodec_align_dimensions2(avctx, &w, &h, linesize_align);
190  new = ff_default_get_video_buffer(outlink, w, h);
191  break;
192  case AVMEDIA_TYPE_AUDIO:
193  new = ff_default_get_audio_buffer(outlink, frame->nb_samples);
194  break;
195  default:
196  return -1;
197  }
198 
201  av_frame_move_ref(frame, new);
202  av_frame_free(&new);
203 
204  frame->width = ow;
205  frame->height = oh;
206 
207  return 0;
208 }
209 
210 static int open_stream(AVFilterContext *ctx, MovieStream *st, int dec_threads)
211 {
212  const AVCodec *codec;
213  int ret;
214 
215  codec = avcodec_find_decoder(st->st->codecpar->codec_id);
216  if (!codec) {
217  av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\n");
218  return AVERROR(EINVAL);
219  }
220 
221  st->codec_ctx = avcodec_alloc_context3(codec);
222  if (!st->codec_ctx)
223  return AVERROR(ENOMEM);
224 
225  st->codec_ctx->opaque = st;
228  if (ret < 0)
229  return ret;
230 
231  if (!dec_threads)
232  dec_threads = ff_filter_get_nb_threads(ctx);
233  st->codec_ctx->thread_count = dec_threads;
234 
235  if ((ret = avcodec_open2(st->codec_ctx, codec, NULL)) < 0) {
236  av_log(ctx, AV_LOG_ERROR, "Failed to open codec\n");
237  return ret;
238  }
239 
240  return 0;
241 }
242 
243 static int guess_channel_layout(MovieStream *st, int st_index, void *log_ctx)
244 {
245  AVCodecParameters *dec_par = st->st->codecpar;
246  char buf[256];
247  AVChannelLayout chl = { 0 };
248 
250 
251  if (!KNOWN(&chl)) {
252  av_log(log_ctx, AV_LOG_WARNING,
253  "Channel layout is not set in stream %d, and could not "
254  "be guessed from the number of channels (%d)\n",
255  st_index, dec_par->ch_layout.nb_channels);
256  return av_channel_layout_copy(&dec_par->ch_layout, &chl);
257  }
258 
259  av_channel_layout_describe(&chl, buf, sizeof(buf));
260  av_log(log_ctx, AV_LOG_WARNING,
261  "Channel layout is not set in output stream %d, "
262  "guessed channel layout is '%s'\n",
263  st_index, buf);
264  return av_channel_layout_copy(&dec_par->ch_layout, &chl);
265 }
266 
268 {
269  MovieContext *movie = ctx->priv;
270  const AVInputFormat *iformat = NULL;
271  int64_t timestamp;
272  int nb_streams = 1, ret, i;
273  char default_streams[16], *stream_specs, *spec, *cursor;
274  AVStream *st;
275 
276  if (!movie->file_name) {
277  av_log(ctx, AV_LOG_ERROR, "No filename provided!\n");
278  return AVERROR(EINVAL);
279  }
280 
281  movie->seek_point = movie->seek_point_d * 1000000 + 0.5;
282 
283  stream_specs = movie->stream_specs;
284  if (!stream_specs) {
285  snprintf(default_streams, sizeof(default_streams), "d%c%d",
286  !strcmp(ctx->filter->name, "amovie") ? 'a' : 'v',
287  movie->stream_index);
288  stream_specs = default_streams;
289  }
290  for (cursor = stream_specs; *cursor; cursor++)
291  if (*cursor == '+')
292  nb_streams++;
293 
294  if (movie->loop_count != 1 && nb_streams != 1) {
296  "Loop with several streams is currently unsupported\n");
297  return AVERROR_PATCHWELCOME;
298  }
299 
300  // Try to find the movie format (container)
302 
303  movie->format_ctx = NULL;
304  if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, &movie->format_opts)) < 0) {
306  "Failed to avformat_open_input '%s'\n", movie->file_name);
307  return ret;
308  }
309  if ((ret = avformat_find_stream_info(movie->format_ctx, NULL)) < 0)
310  av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
311 
312  // if seeking requested, we execute it
313  if (movie->seek_point > 0) {
314  timestamp = movie->seek_point;
315  // add the stream start time, should it exist
316  if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
317  if (timestamp > 0 && movie->format_ctx->start_time > INT64_MAX - timestamp) {
319  "%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\n",
320  movie->file_name, movie->format_ctx->start_time, movie->seek_point);
321  return AVERROR(EINVAL);
322  }
323  timestamp += movie->format_ctx->start_time;
324  }
325  if ((ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD)) < 0) {
326  av_log(ctx, AV_LOG_ERROR, "%s: could not seek to position %"PRId64"\n",
327  movie->file_name, timestamp);
328  return ret;
329  }
330  }
331 
332  for (i = 0; i < movie->format_ctx->nb_streams; i++)
334 
335  movie->pkt = av_packet_alloc();
336  if (!movie->pkt)
337  return AVERROR(ENOMEM);
338  movie->st = av_calloc(nb_streams, sizeof(*movie->st));
339  if (!movie->st)
340  return AVERROR(ENOMEM);
341 
342  for (i = 0; i < nb_streams; i++) {
343  spec = av_strtok(stream_specs, "+", &cursor);
344  if (!spec)
345  return AVERROR_BUG;
346  stream_specs = NULL; /* for next strtok */
347  st = find_stream(ctx, movie->format_ctx, spec);
348  if (!st)
349  return AVERROR(EINVAL);
351  movie->st[i].st = st;
352  movie->max_stream_index = FFMAX(movie->max_stream_index, st->index);
353  movie->st[i].discontinuity_threshold =
355 
356  movie->st[i].frame = av_frame_alloc();
357  if (!movie->st[i].frame)
358  return AVERROR(ENOMEM);
359  }
360  if (av_strtok(NULL, "+", &cursor))
361  return AVERROR_BUG;
362 
363  movie->out_index = av_calloc(movie->max_stream_index + 1,
364  sizeof(*movie->out_index));
365  if (!movie->out_index)
366  return AVERROR(ENOMEM);
367  for (i = 0; i <= movie->max_stream_index; i++)
368  movie->out_index[i] = -1;
369  for (i = 0; i < nb_streams; i++) {
370  AVFilterPad pad = { 0 };
371  movie->out_index[movie->st[i].st->index] = i;
372  pad.type = movie->st[i].st->codecpar->codec_type;
373  pad.name = av_asprintf("out%d", i);
374  if (!pad.name)
375  return AVERROR(ENOMEM);
377  if ((ret = ff_append_outpad_free_name(ctx, &pad)) < 0)
378  return ret;
379  if ( movie->st[i].st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
380  !KNOWN(&movie->st[i].st->codecpar->ch_layout)) {
381  ret = guess_channel_layout(&movie->st[i], i, ctx);
382  if (ret < 0)
383  return ret;
384  }
385  ret = open_stream(ctx, &movie->st[i], movie->dec_threads);
386  if (ret < 0)
387  return ret;
388  }
389 
390  av_log(ctx, AV_LOG_VERBOSE, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\n",
391  movie->seek_point, movie->format_name, movie->file_name,
392  movie->stream_index);
393 
394  return 0;
395 }
396 
398 {
399  MovieContext *movie = ctx->priv;
400  int i;
401 
402  for (i = 0; i < ctx->nb_outputs; i++) {
403  if (movie->st[i].st)
405  av_frame_free(&movie->st[i].frame);
406  }
407  av_packet_free(&movie->pkt);
408  av_freep(&movie->st);
409  av_freep(&movie->out_index);
410  if (movie->format_ctx)
412 }
413 
415  AVFilterFormatsConfig **cfg_in,
416  AVFilterFormatsConfig **cfg_out)
417 {
418  const MovieContext *movie = ctx->priv;
419  int list[] = { 0, -1 };
420  AVChannelLayout list64[] = { { 0 }, { 0 } };
421  int i, ret;
422 
423  for (i = 0; i < ctx->nb_outputs; i++) {
424  const MovieStream *st = &movie->st[i];
425  const AVCodecParameters *c = st->st->codecpar;
426  AVFilterFormatsConfig *cfg = cfg_out[i];
427 
428  switch (c->codec_type) {
429  case AVMEDIA_TYPE_VIDEO:
430  list[0] = c->format;
431  if ((ret = ff_formats_ref(ff_make_format_list(list), &cfg->formats)) < 0)
432  return ret;
433  list[0] = c->color_space;
435  return ret;
436  list[0] = c->color_range;
438  return ret;
439  break;
440  case AVMEDIA_TYPE_AUDIO:
441  list[0] = c->format;
442  if ((ret = ff_formats_ref(ff_make_format_list(list), &cfg->formats)) < 0)
443  return ret;
444  list[0] = c->sample_rate;
446  return ret;
447  list64[0] = c->ch_layout;
449  &cfg->channel_layouts)) < 0)
450  return ret;
451  break;
452  }
453  }
454 
455  return 0;
456 }
457 
459 {
460  FilterLink *l = ff_filter_link(outlink);
461  AVFilterContext *ctx = outlink->src;
462  MovieContext *movie = ctx->priv;
463  unsigned out_id = FF_OUTLINK_IDX(outlink);
464  MovieStream *st = &movie->st[out_id];
465  AVCodecParameters *c = st->st->codecpar;
466 
467  outlink->time_base = st->st->time_base;
468 
469  switch (c->codec_type) {
470  case AVMEDIA_TYPE_VIDEO:
471  outlink->w = c->width;
472  outlink->h = c->height;
473  l->frame_rate = st->st->r_frame_rate;
474  break;
475  case AVMEDIA_TYPE_AUDIO:
476  break;
477  }
478 
479  st->link = outlink;
480 
481  return 0;
482 }
483 
485 {
486  MovieContext *movie = ctx->priv;
487  int64_t timestamp = movie->seek_point;
488  int ret, i;
489 
490  if (movie->format_ctx->start_time != AV_NOPTS_VALUE)
491  timestamp += movie->format_ctx->start_time;
492  ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD);
493  if (ret < 0) {
494  av_log(ctx, AV_LOG_ERROR, "Unable to loop: %s\n", av_err2str(ret));
495  movie->loop_count = 1; /* do not try again */
496  return ret;
497  }
498 
499  for (i = 0; i < ctx->nb_outputs; i++) {
501  }
502  return 0;
503 }
504 
506 {
507  MovieContext *movie = ctx->priv;
508  AVCodecContext *dec = movie->st[i].codec_ctx;
509 
510  return avcodec_send_packet(dec, NULL);
511 }
512 
514 {
515  AVFilterLink *outlink = ctx->outputs[i];
516  MovieContext *movie = ctx->priv;
517  MovieStream *st = &movie->st[i];
518  AVCodecContext *dec = movie->st[i].codec_ctx;
519  AVFrame *frame = movie->st[i].frame;
520  AVPacket *pkt = movie->pkt;
521  int ret = 0;
522 
523  // submit the packet to the decoder
524  if (!movie->eof) {
525  ret = avcodec_send_packet(dec, pkt);
526  if (ret < 0)
527  return ret;
528  }
529 
530  // get all the available frames from the decoder
531  if (ret >= 0) {
533  if (ret < 0) {
534  // those two return values are special and mean there is no output
535  // frame available, but there were no errors during decoding
536  if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN))
537  return 0;
538  return ret;
539  }
540 
541  frame->pts = frame->best_effort_timestamp;
542  if (frame->pts != AV_NOPTS_VALUE) {
543  if (movie->ts_offset)
545  if (st->discontinuity_threshold) {
546  if (st->last_pts != AV_NOPTS_VALUE) {
547  int64_t diff = frame->pts - st->last_pts;
548  if (diff < 0 || diff > st->discontinuity_threshold) {
549  av_log(ctx, AV_LOG_VERBOSE, "Discontinuity in stream:%d diff:%"PRId64"\n", i, diff);
551  frame->pts -= diff;
552  }
553  }
554  }
555  st->last_pts = frame->pts;
556  }
558  if (ret < 0)
559  return ret;
560  if (ret == 0)
561  return 1;
562  }
563 
564  return 0;
565 }
566 
568 {
569  MovieContext *movie = ctx->priv;
570  int wanted = 0, ret;
571 
572  for (int i = 0; i < ctx->nb_outputs; i++) {
573  if (ff_outlink_frame_wanted(ctx->outputs[i]))
574  wanted++;
575  }
576 
577  if (wanted == 0)
578  return FFERROR_NOT_READY;
579 
580  if (!movie->eof) {
581  ret = av_read_frame(movie->format_ctx, movie->pkt);
582  if (ret < 0) {
583  movie->eof = 1;
584  for (int i = 0; i < ctx->nb_outputs; i++)
585  flush_decoder(ctx, i);
586  ff_filter_set_ready(ctx, 100);
587  return 0;
588  } else {
589  int pkt_out_id = movie->pkt->stream_index > movie->max_stream_index ? -1 :
590  movie->out_index[movie->pkt->stream_index];
591 
592  if (pkt_out_id >= 0) {
593  ret = decode_packet(ctx, pkt_out_id);
594  }
595  av_packet_unref(movie->pkt);
596  ff_filter_set_ready(ctx, 100);
597  return (ret <= 0) ? ret : 0;
598  }
599  } else {
600  int nb_eofs = 0;
601 
602  for (int i = 0; i < ctx->nb_outputs; i++) {
603  if (!movie->st[i].eof) {
604  ret = decode_packet(ctx, i);
605  if (ret <= 0)
606  movie->st[i].eof = 1;
607  }
608  nb_eofs += movie->st[i].eof == 1;
609  }
610  if (nb_eofs == ctx->nb_outputs && movie->loop_count != 1) {
611  ret = rewind_file(ctx);
612  if (ret < 0)
613  return ret;
614  movie->loop_count -= movie->loop_count > 1;
615  av_log(ctx, AV_LOG_VERBOSE, "Stream finished, looping.\n");
616  ff_filter_set_ready(ctx, 100);
617  for (int i = 0; i < ctx->nb_outputs; i++)
618  movie->st[i].eof = 0;
619  movie->eof = 0;
620  return 0;
621  } else {
622  for (int i = 0; i < ctx->nb_outputs; i++) {
623  if (movie->st[i].eof) {
624  ff_outlink_set_status(ctx->outputs[i], AVERROR_EOF, movie->st[i].last_pts);
625  nb_eofs++;
626  }
627  }
628  }
629 
630  if (nb_eofs < ctx->nb_outputs)
631  ff_filter_set_ready(ctx, 100);
632  return 0;
633  }
634 
635  return FFERROR_NOT_READY;
636 }
637 
638 static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
639  char *res, int res_len, int flags)
640 {
641  MovieContext *movie = ctx->priv;
642  int ret = AVERROR(ENOSYS);
643 
644  if (!strcmp(cmd, "seek")) {
645  int idx, flags, i;
646  int64_t ts;
647  char tail[2];
648 
649  if (sscanf(args, "%i|%"SCNi64"|%i %1s", &idx, &ts, &flags, tail) != 3)
650  return AVERROR(EINVAL);
651 
652  ret = av_seek_frame(movie->format_ctx, idx, ts, flags);
653  if (ret < 0)
654  return ret;
655 
656  for (i = 0; i < ctx->nb_outputs; i++) {
658  }
659  return ret;
660  } else if (!strcmp(cmd, "get_duration")) {
661  int print_len;
662  char tail[2];
663 
664  if (!res || res_len <= 0)
665  return AVERROR(EINVAL);
666 
667  if (args && sscanf(args, "%1s", tail) == 1)
668  return AVERROR(EINVAL);
669 
670  print_len = snprintf(res, res_len, "%"PRId64, movie->format_ctx->duration);
671  if (print_len < 0 || print_len >= res_len)
672  return AVERROR(EINVAL);
673 
674  return 0;
675  }
676 
677  return ret;
678 }
679 
680 AVFILTER_DEFINE_CLASS_EXT(movie, "(a)movie", movie_options);
681 
682 #if CONFIG_MOVIE_FILTER
683 
684 const AVFilter ff_avsrc_movie = {
685  .name = "movie",
686  .description = NULL_IF_CONFIG_SMALL("Read from a movie source."),
687  .priv_size = sizeof(MovieContext),
688  .priv_class = &movie_class,
690  .activate = activate,
691  .uninit = movie_uninit,
693 
694  .inputs = NULL,
695  .outputs = NULL,
697  .process_command = process_command
698 };
699 
700 #endif /* CONFIG_MOVIE_FILTER */
701 
702 #if CONFIG_AMOVIE_FILTER
703 
704 const AVFilter ff_avsrc_amovie = {
705  .name = "amovie",
706  .description = NULL_IF_CONFIG_SMALL("Read audio from a movie source."),
707  .priv_class = &movie_class,
708  .priv_size = sizeof(MovieContext),
710  .activate = activate,
711  .uninit = movie_uninit,
713 
714  .inputs = NULL,
715  .outputs = NULL,
717  .process_command = process_command,
718 };
719 
720 #endif /* CONFIG_AMOVIE_FILTER */
av_packet_unref
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Definition: packet.c:429
AV_ROUND_UP
@ AV_ROUND_UP
Round toward +infinity.
Definition: mathematics.h:134
AVCodec
AVCodec.
Definition: codec.h:187
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:215
AVFilterFormatsConfig::samplerates
AVFilterFormats * samplerates
Lists of supported sample rates, only for audio.
Definition: avfilter.h:121
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:51
FF_OUTLINK_IDX
#define FF_OUTLINK_IDX(link)
Definition: filters.h:214
ff_make_format_list
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:435
AVFilterFormatsConfig::channel_layouts
AVFilterChannelLayouts * channel_layouts
Lists of supported channel layouts, only for audio.
Definition: avfilter.h:126
av_find_best_stream
int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type, int wanted_stream_nb, int related_stream, const AVCodec **decoder_ret, int flags)
Definition: avformat.c:455
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:47
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1062
ff_channel_layouts_ref
int ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
Add *ref as a new reference to f.
Definition: formats.c:673
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
FFERROR_NOT_READY
return FFERROR_NOT_READY
Definition: filter_design.txt:204
AVStream::discard
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
Definition: avformat.h:819
MovieContext::eof
int eof
Definition: src_movie.c:77
AV_TIME_BASE_Q
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
Definition: avutil.h:264
int64_t
long long int64_t
Definition: coverity.c:34
MovieContext::stream_index
int stream_index
for compatibility
Definition: src_movie.c:68
av_asprintf
char * av_asprintf(const char *fmt,...)
Definition: avstring.c:115
FLAGS
#define FLAGS
Definition: src_movie.c:85
normalize.log
log
Definition: normalize.py:21
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:162
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
AVFormatContext::streams
AVStream ** streams
A list of all streams in the file.
Definition: avformat.h:1368
AVCodec::capabilities
int capabilities
Codec capabilities.
Definition: codec.h:206
w
uint8_t w
Definition: llviddspenc.c:38
AVOption
AVOption.
Definition: opt.h:429
format_opts
AVDictionary * format_opts
Definition: cmdutils.c:58
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Underlying C type is int64_t.
Definition: opt.h:319
MovieStream::link
AVFilterLink * link
Definition: src_movie.c:51
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:225
movie_options
static const AVOption movie_options[]
Definition: src_movie.c:87
MovieStream::eof
int eof
Definition: src_movie.c:57
AVDictionary
Definition: dict.c:34
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:205
av_read_frame
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
Definition: demux.c:1547
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:327
video.h
guess_channel_layout
static int guess_channel_layout(MovieStream *st, int st_index, void *log_ctx)
Definition: src_movie.c:243
av_packet_free
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
Definition: packet.c:74
ff_avsrc_movie
const AVFilter ff_avsrc_movie
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: src_movie.c:638
formats.h
MovieContext::out_index
int * out_index
stream number -> output number map, or -1
Definition: src_movie.c:80
avformat_close_input
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
Definition: demux.c:366
ff_default_get_video_buffer
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
Definition: video.c:111
MovieContext::file_name
char * file_name
Definition: src_movie.c:66
AVCodecContext::codec
const struct AVCodec * codec
Definition: avcodec.h:460
decode_packet
static int decode_packet(AVFilterContext *ctx, int i)
Definition: src_movie.c:513
AVCodecContext::thread_count
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
Definition: avcodec.h:1593
MovieStream::frame
AVFrame * frame
Definition: src_movie.c:56
dummy
int dummy
Definition: motion.c:66
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
ff_avsrc_amovie
const AVFilter ff_avsrc_amovie
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:38
av_frame_alloc
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition: frame.c:150
AVCodecContext::get_buffer2
int(* get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags)
This callback is called at the beginning of each frame to get data buffer(s) for it.
Definition: avcodec.h:1232
pkt
AVPacket * pkt
Definition: movenc.c:60
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
AVInputFormat
Definition: avformat.h:548
av_cold
#define av_cold
Definition: attributes.h:90
avformat_open_input
int avformat_open_input(AVFormatContext **ps, const char *url, const AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
Definition: demux.c:216
av_channel_layout_describe
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
Definition: channel_layout.c:651
ff_outlink_set_status
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
Definition: filters.h:424
avcodec_alloc_context3
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
Definition: options.c:149
av_seek_frame
int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Seek to the keyframe at timestamp.
Definition: seek.c:641
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition: opt.h:267
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
ff_formats_ref
int ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
Add *ref as a new reference to formats.
Definition: formats.c:678
av_strtok
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok().
Definition: avstring.c:178
avcodec_receive_frame
int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Return decoded output data from a decoder or encoder (when the AV_CODEC_FLAG_RECON_FRAME flag is used...
Definition: avcodec.c:713
MovieContext::ts_offset
int64_t ts_offset
Definition: src_movie.c:71
filters.h
ctx
AVFormatContext * ctx
Definition: movenc.c:49
get_buffer
static int get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Definition: src_movie.c:160
nb_streams
static int nb_streams
Definition: ffprobe.c:384
av_frame_clone
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition: frame.c:597
av_rescale_q
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
Definition: mathematics.c:142
AVFilterFormatsConfig::color_spaces
AVFilterFormats * color_spaces
Lists of supported YUV color metadata, only for YUV video.
Definition: avfilter.h:131
avcodec_align_dimensions2
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS])
Modify width and height values so that they will result in a memory buffer that is acceptable for the...
Definition: utils.c:144
MovieContext::format_ctx
AVFormatContext * format_ctx
Definition: src_movie.c:75
MovieContext
Definition: src_movie.c:60
find_stream
static AVStream * find_stream(void *log, AVFormatContext *avf, const char *spec)
Definition: src_movie.c:106
AVDISCARD_ALL
@ AVDISCARD_ALL
discard all
Definition: defs.h:221
AVFormatContext
Format I/O context.
Definition: avformat.h:1300
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:771
avcodec_parameters_to_context
int avcodec_parameters_to_context(AVCodecContext *codec, const struct AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
AVSEEK_FLAG_BACKWARD
#define AVSEEK_FLAG_BACKWARD
Definition: avformat.h:2498
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
AVStream::time_base
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
Definition: avformat.h:787
NULL
#define NULL
Definition: coverity.c:32
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
av_frame_copy_props
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:713
MovieStream::discontinuity_threshold
int64_t discontinuity_threshold
Definition: src_movie.c:54
avcodec_free_context
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
Definition: options.c:164
MovieContext::discontinuity_threshold
int64_t discontinuity_threshold
Definition: src_movie.c:70
AVFILTER_DEFINE_CLASS_EXT
AVFILTER_DEFINE_CLASS_EXT(movie, "(a)movie", movie_options)
AV_OPT_TYPE_DICT
@ AV_OPT_TYPE_DICT
Underlying C type is AVDictionary*.
Definition: opt.h:290
MovieStream::last_pts
int64_t last_pts
Definition: src_movie.c:55
list
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
Definition: filter_design.txt:25
avcodec_open2
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
Definition: avcodec.c:143
movie_query_formats
static int movie_query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: src_movie.c:414
AVCodecParameters::ch_layout
AVChannelLayout ch_layout
Audio only.
Definition: codec_par.h:180
MovieStream::codec_ctx
AVCodecContext * codec_ctx
Definition: src_movie.c:53
MovieContext::format_name
char * format_name
Definition: src_movie.c:65
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
MovieStream::st
AVStream * st
Definition: src_movie.c:52
AVFilterFormatsConfig
Lists of formats / etc.
Definition: avfilter.h:111
ff_filter_link
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition: filters.h:197
MovieContext::seek_point_d
double seek_point_d
Definition: src_movie.c:64
avcodec_find_decoder
const AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
Definition: allcodecs.c:1012
AVFILTER_FLAG_DYNAMIC_OUTPUTS
#define AVFILTER_FLAG_DYNAMIC_OUTPUTS
The number of the filter outputs is not determined just by AVFilter.outputs.
Definition: avfilter.h:147
AVFormatContext::nb_streams
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
Definition: avformat.h:1356
AVFilterPad::config_props
int(* config_props)(AVFilterLink *link)
Link configuration callback.
Definition: filters.h:118
avformat_find_stream_info
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
Read packets of a media file to get stream information.
Definition: demux.c:2525
movie_common_init
static av_cold int movie_common_init(AVFilterContext *ctx)
Definition: src_movie.c:267
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AVMediaType
AVMediaType
Definition: avutil.h:199
movie_uninit
static av_cold void movie_uninit(AVFilterContext *ctx)
Definition: src_movie.c:397
avformat_match_stream_specifier
int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the stream st contained in s is matched by the stream specifier spec.
Definition: avformat.c:693
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
copy
static void copy(const float *p1, float *p2, const int length)
Definition: vf_vaguedenoiser.c:186
AVDISCARD_DEFAULT
@ AVDISCARD_DEFAULT
discard useless packets like 0 size packets in avi
Definition: defs.h:216
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:317
av_err2str
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
Definition: error.h:122
MovieContext::loop_count
int loop_count
Definition: src_movie.c:69
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
AV_NUM_DATA_POINTERS
#define AV_NUM_DATA_POINTERS
Definition: frame.h:390
AV_NOPTS_VALUE
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248
diff
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)
Definition: vf_paletteuse.c:166
attributes.h
AVFilterFormatsConfig::color_ranges
AVFilterFormats * color_ranges
AVColorRange.
Definition: avfilter.h:132
av_packet_alloc
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
Definition: packet.c:63
MovieContext::pkt
AVPacket * pkt
Definition: src_movie.c:74
av_channel_layout_compare
int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1)
Check whether two channel layouts are semantically the same, i.e.
Definition: channel_layout.c:807
MovieContext::format_opts
AVDictionary * format_opts
Definition: src_movie.c:81
iformat
static const AVInputFormat * iformat
Definition: ffprobe.c:360
av_channel_layout_default
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
Definition: channel_layout.c:837
avcodec_default_get_buffer2
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
Definition: get_buffer.c:250
avcodec_send_packet
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
Definition: decode.c:728
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
rewind_file
static int rewind_file(AVFilterContext *ctx)
Definition: src_movie.c:484
internal.h
ff_filter_get_nb_threads
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:841
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
av_frame_move_ref
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
Definition: frame.c:637
av_frame_unref
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
Definition: frame.c:610
MovieContext::max_stream_index
int max_stream_index
max stream # actually used for output
Definition: src_movie.c:78
AVFilterPad::name
const char * name
Pad name.
Definition: filters.h:44
av_calloc
void * av_calloc(size_t nmemb, size_t size)
Definition: mem.c:264
avcodec.h
AVFilter
Filter definition.
Definition: avfilter.h:201
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:748
AVFilterPad::type
enum AVMediaType type
AVFilterPad type.
Definition: filters.h:49
avcodec_flush_buffers
void avcodec_flush_buffers(AVCodecContext *avctx)
Reset the internal codec state / flush internal buffers.
Definition: avcodec.c:374
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
AVCodecContext::opaque
void * opaque
Private data of the user, can be used to carry app specific stuff.
Definition: avcodec.h:493
avformat.h
activate
static int activate(AVFilterContext *ctx)
Definition: src_movie.c:567
movie_config_output_props
static int movie_config_output_props(AVFilterLink *outlink)
Definition: src_movie.c:458
av_get_media_type_string
const char * av_get_media_type_string(enum AVMediaType media_type)
Return a string describing the media_type enum, NULL if media_type is unknown.
Definition: utils.c:28
AVCodecContext
main external API structure.
Definition: avcodec.h:451
AVStream::index
int index
stream index in AVFormatContext
Definition: avformat.h:754
format_name
static int format_name(const char *buf, char **s, int index, const char *varname)
Definition: hlsenc.c:1996
channel_layout.h
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
avfilter.h
flush_decoder
static int flush_decoder(AVFilterContext *ctx, int i)
Definition: src_movie.c:505
AVStream::r_frame_rate
AVRational r_frame_rate
Real base framerate of the stream.
Definition: avformat.h:914
KNOWN
#define KNOWN(l)
Definition: formats.h:111
av_find_input_format
const AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
Definition: format.c:144
MovieContext::stream_specs
char * stream_specs
user-provided list of streams, separated by +
Definition: src_movie.c:67
AVFormatContext::duration
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
Definition: avformat.h:1435
AVPacket::stream_index
int stream_index
Definition: packet.h:541
AVFilterContext
An instance of a filter.
Definition: avfilter.h:457
av_channel_layout_copy
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
Definition: channel_layout.c:447
MovieContext::st
MovieStream * st
array of all streams, one per output
Definition: src_movie.c:79
AVCodecContext::codec_type
enum AVMediaType codec_type
Definition: avcodec.h:459
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
mem.h
audio.h
ff_default_get_audio_buffer
AVFrame * ff_default_get_audio_buffer(AVFilterLink *link, int nb_samples)
default handler for get_audio_buffer() for audio inputs
Definition: audio.c:46
AVFilterFormatsConfig::formats
AVFilterFormats * formats
List of supported formats (pixel or sample).
Definition: avfilter.h:116
MovieContext::dec_threads
int dec_threads
Definition: src_movie.c:72
AVCodecParameters::codec_id
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: codec_par.h:55
AVPacket
This structure stores compressed data.
Definition: packet.h:516
ff_append_outpad_free_name
int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p)
Definition: avfilter.c:143
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
ff_make_channel_layout_list
AVFilterChannelLayouts * ff_make_channel_layout_list(const AVChannelLayout *fmts)
Definition: formats.c:444
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
AVERROR_BUG
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Definition: error.h:52
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
MovieContext::seek_point
int64_t seek_point
seekpoint in microseconds
Definition: src_movie.c:63
AVFormatContext::start_time
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds.
Definition: avformat.h:1425
h
h
Definition: vp9dsp_template.c:2070
ff_outlink_frame_wanted
the definition of that something depends on the semantic of the filter The callback must examine the status of the filter s links and proceed accordingly The status of output links is stored in the status_in and status_out fields and tested by the ff_outlink_frame_wanted() function. If this function returns true
avstring.h
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276
MovieStream
Definition: src_movie.c:50
snprintf
#define snprintf
Definition: snprintf.h:34
OFFSET
#define OFFSET(x)
Definition: src_movie.c:84
open_stream
static int open_stream(AVFilterContext *ctx, MovieStream *st, int dec_threads)
Definition: src_movie.c:210
av_rescale_q_rnd
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, enum AVRounding rnd)
Rescale a 64-bit integer by 2 rational numbers with specified rounding.
Definition: mathematics.c:134
ff_filter_set_ready
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.
Definition: avfilter.c:239