FFmpeg
Data Structures | Macros | Functions | Variables
src_movie.c File Reference
#include "config_components.h"
#include <float.h>
#include <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/timestamp.h"
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  MovieStream
 
struct  MovieContext
 

Macros

#define OFFSET(x)   offsetof(MovieContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
 

Functions

static int movie_config_output_props (AVFilterLink *outlink)
 
static AVStreamfind_stream (void *log, AVFormatContext *avf, const char *spec)
 
static int get_buffer (AVCodecContext *avctx, AVFrame *frame, int flags)
 
static int open_stream (AVFilterContext *ctx, MovieStream *st, int dec_threads)
 
static int guess_channel_layout (MovieStream *st, int st_index, void *log_ctx)
 
static av_cold int movie_common_init (AVFilterContext *ctx)
 
static av_cold void movie_uninit (AVFilterContext *ctx)
 
static int movie_query_formats (AVFilterContext *ctx)
 
static int rewind_file (AVFilterContext *ctx)
 
static int flush_decoder (AVFilterContext *ctx, int i)
 
static int decode_packet (AVFilterContext *ctx, int i)
 
static int activate (AVFilterContext *ctx)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
 AVFILTER_DEFINE_CLASS_EXT (movie, "(a)movie", movie_options)
 

Variables

static const AVOption movie_options []
 

Detailed Description

movie video source

Todo:
support a PTS correction mechanism

Definition in file src_movie.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(MovieContext, x)

Definition at line 87 of file src_movie.c.

◆ FLAGS

Definition at line 88 of file src_movie.c.

Function Documentation

◆ movie_config_output_props()

static int movie_config_output_props ( AVFilterLink outlink)
static

Definition at line 453 of file src_movie.c.

Referenced by movie_common_init().

◆ find_stream()

static AVStream* find_stream ( void *  log,
AVFormatContext avf,
const char *  spec 
)
static

Definition at line 109 of file src_movie.c.

Referenced by movie_common_init().

◆ get_buffer()

static int get_buffer ( AVCodecContext avctx,
AVFrame frame,
int  flags 
)
static

Definition at line 163 of file src_movie.c.

Referenced by open_stream().

◆ open_stream()

static int open_stream ( AVFilterContext ctx,
MovieStream st,
int  dec_threads 
)
static

Definition at line 213 of file src_movie.c.

Referenced by movie_common_init().

◆ guess_channel_layout()

static int guess_channel_layout ( MovieStream st,
int  st_index,
void *  log_ctx 
)
static

Definition at line 246 of file src_movie.c.

Referenced by movie_common_init().

◆ movie_common_init()

static av_cold int movie_common_init ( AVFilterContext ctx)
static

Definition at line 270 of file src_movie.c.

◆ movie_uninit()

static av_cold void movie_uninit ( AVFilterContext ctx)
static

Definition at line 400 of file src_movie.c.

◆ movie_query_formats()

static int movie_query_formats ( AVFilterContext ctx)
static

Definition at line 417 of file src_movie.c.

◆ rewind_file()

static int rewind_file ( AVFilterContext ctx)
static

Definition at line 478 of file src_movie.c.

Referenced by activate().

◆ flush_decoder()

static int flush_decoder ( AVFilterContext ctx,
int  i 
)
static

Definition at line 499 of file src_movie.c.

Referenced by activate().

◆ decode_packet()

static int decode_packet ( AVFilterContext ctx,
int  i 
)
static

Definition at line 507 of file src_movie.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 561 of file src_movie.c.

◆ process_command()

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 632 of file src_movie.c.

◆ AVFILTER_DEFINE_CLASS_EXT()

AVFILTER_DEFINE_CLASS_EXT ( movie  ,
"(a)movie"  ,
movie_options   
)

Variable Documentation

◆ movie_options

const AVOption movie_options[]
static
Initial value:
= {
{ "filename", NULL, OFFSET(file_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "format_name", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "f", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "stream_index", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
{ "si", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
{ "seek_point", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, (INT64_MAX-1) / 1000000, FLAGS },
{ "sp", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, (INT64_MAX-1) / 1000000, FLAGS },
{ "streams", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, 0, 0, FLAGS },
{ "s", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, 0, 0, FLAGS },
{ "loop", "set loop count", OFFSET(loop_count), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, FLAGS },
{ "discontinuity", "set discontinuity threshold", OFFSET(discontinuity_threshold), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, FLAGS },
{ "dec_threads", "set the number of threads for decoding", OFFSET(dec_threads), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
{ "format_opts", "set format options for the opened file", OFFSET(format_opts), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, FLAGS},
{ NULL },
}

Definition at line 90 of file src_movie.c.

FLAGS
#define FLAGS
Definition: src_movie.c:88
format_opts
AVDictionary * format_opts
Definition: cmdutils.c:60
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:239
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:227
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_TYPE_DICT
@ AV_OPT_TYPE_DICT
Definition: opt.h:232
format_name
static int format_name(const char *buf, char **s, int index, const char *varname)
Definition: hlsenc.c:1937
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
OFFSET
#define OFFSET(x)
Definition: src_movie.c:87