FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
src_movie.c File Reference

movie video source More...

#include <float.h>
#include <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/avstring.h"
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/timestamp.h"
#include "libavformat/avformat.h"
#include "audio.h"
#include "avcodec.h"
#include "avfilter.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 int movie_request_frame (AVFilterLink *outlink)
 
static AVStreamfind_stream (void *log, AVFormatContext *avf, const char *spec)
 
static int open_stream (void *log, MovieStream *st)
 
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 char * describe_frame_to_str (char *dst, size_t dst_size, AVFrame *frame, enum AVMediaType frame_type, AVFilterLink *link)
 
static int rewind_file (AVFilterContext *ctx)
 
static int movie_push_frame (AVFilterContext *ctx, unsigned out_id)
 Try to push a frame to the requested output.
 

Variables

static const AVOption movie_options []
 

Detailed Description

movie video source

Todo:

use direct rendering (no allocation of a new frame)

support a PTS correction mechanism

Definition in file src_movie.c.

Macro Definition Documentation

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

Definition at line 73 of file src_movie.c.

Definition at line 74 of file src_movie.c.

Function Documentation

static int movie_config_output_props ( AVFilterLink outlink)
static

Definition at line 365 of file src_movie.c.

Referenced by movie_common_init().

static int movie_request_frame ( AVFilterLink outlink)
static

Definition at line 551 of file src_movie.c.

Referenced by movie_common_init().

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

Definition at line 93 of file src_movie.c.

Referenced by movie_common_init().

static int open_stream ( void log,
MovieStream st 
)
static

Definition at line 147 of file src_movie.c.

Referenced by movie_common_init().

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

Definition at line 168 of file src_movie.c.

Referenced by movie_common_init().

static av_cold int movie_common_init ( AVFilterContext ctx)
static

Definition at line 191 of file src_movie.c.

static av_cold void movie_uninit ( AVFilterContext ctx)
static

Definition at line 316 of file src_movie.c.

static int movie_query_formats ( AVFilterContext ctx)
static

Definition at line 333 of file src_movie.c.

static char* describe_frame_to_str ( char *  dst,
size_t  dst_size,
AVFrame frame,
enum AVMediaType  frame_type,
AVFilterLink link 
)
static

Definition at line 388 of file src_movie.c.

Referenced by movie_push_frame().

static int rewind_file ( AVFilterContext ctx)
static

Definition at line 414 of file src_movie.c.

Referenced by movie_push_frame().

static int movie_push_frame ( AVFilterContext ctx,
unsigned  out_id 
)
static

Try to push a frame to the requested output.

Parameters
ctxfilter context
out_idnumber of output where a frame is wanted; if the frame is read from file, used to set the return value; if the codec is being flushed, flush the corresponding stream
Returns
1 if a frame was pushed on the requested output, 0 if another attempt is possible, <0 AVERROR code

Definition at line 448 of file src_movie.c.

Referenced by movie_request_frame().

Variable Documentation

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}, CHAR_MAX, CHAR_MAX, FLAGS },
{ "s", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MAX, CHAR_MAX, FLAGS },
{ "loop", "set loop count", OFFSET(loop_count), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, FLAGS },
{ NULL },
}

Definition at line 76 of file src_movie.c.