FFmpeg
Data Structures | Macros | Functions | Variables
vapoursynth.c File Reference
#include <limits.h>
#include <vapoursynth/VSScript4.h>
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
#include "libavutil/frame.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include <dlfcn.h>

Go to the source code of this file.

Data Structures

struct  VSState
 
struct  VSContext
 
struct  vsframe_ref_data
 

Macros

#define VSSCRIPT_NAME   "libvapoursynth-script"
 
#define VSSCRIPT_LIB   VSSCRIPT_NAME SLIBSUF
 
#define OFFSET(x)   offsetof(VSContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM
 
#define D   AV_OPT_FLAG_DECODING_PARAM
 

Functions

static av_cold void * vs_load_library (VSScriptGetAPIFunc *get_vssapi)
 
static void free_vss_state (void *opaque, uint8_t *data)
 
static av_cold int read_close_vs (AVFormatContext *s)
 
static av_cold int is_native_endian (enum AVPixelFormat pixfmt)
 
static av_cold enum AVPixelFormat match_pixfmt (const VSVideoFormat *vsf, int c_order[4])
 
static av_cold int read_header_vs (AVFormatContext *s)
 
static void free_frame (void *opaque, uint8_t *data)
 
static int get_vs_prop_int (AVFormatContext *s, const VSMap *map, const char *name, int def)
 
static void free_vsframe_ref (void *opaque, uint8_t *data)
 
static int read_packet_vs (AVFormatContext *s, AVPacket *pkt)
 
static int read_seek_vs (AVFormatContext *s, int stream_idx, int64_t ts, int flags)
 
static av_cold int probe_vs (const AVProbeData *p)
 

Variables

const typedef VSSCRIPTAPI *(* VSScriptGetAPIFunc )(int version)
 
static const AVOption options []
 
static const AVClass class_vs
 
const FFInputFormat ff_vapoursynth_demuxer
 

Detailed Description

VapourSynth demuxer

Synthesizes vapour (?)

Definition in file vapoursynth.c.

Macro Definition Documentation

◆ VSSCRIPT_NAME

#define VSSCRIPT_NAME   "libvapoursynth-script"

Definition at line 51 of file vapoursynth.c.

◆ VSSCRIPT_LIB

#define VSSCRIPT_LIB   VSSCRIPT_NAME SLIBSUF

Definition at line 52 of file vapoursynth.c.

◆ OFFSET

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

Definition at line 81 of file vapoursynth.c.

◆ A

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 82 of file vapoursynth.c.

◆ D

Definition at line 83 of file vapoursynth.c.

Function Documentation

◆ vs_load_library()

static av_cold void* vs_load_library ( VSScriptGetAPIFunc get_vssapi)
static

Definition at line 89 of file vapoursynth.c.

Referenced by read_header_vs().

◆ free_vss_state()

static void free_vss_state ( void *  opaque,
uint8_t *  data 
)
static

Definition at line 123 of file vapoursynth.c.

Referenced by read_header_vs().

◆ read_close_vs()

static av_cold int read_close_vs ( AVFormatContext s)
static

Definition at line 132 of file vapoursynth.c.

◆ is_native_endian()

static av_cold int is_native_endian ( enum AVPixelFormat  pixfmt)
static

Definition at line 150 of file vapoursynth.c.

Referenced by match_pixfmt().

◆ match_pixfmt()

static av_cold enum AVPixelFormat match_pixfmt ( const VSVideoFormat *  vsf,
int  c_order[4] 
)
static

Definition at line 160 of file vapoursynth.c.

Referenced by read_header_vs().

◆ read_header_vs()

static av_cold int read_header_vs ( AVFormatContext s)
static

Definition at line 221 of file vapoursynth.c.

◆ free_frame()

static void free_frame ( void *  opaque,
uint8_t *  data 
)
static

Definition at line 363 of file vapoursynth.c.

Referenced by read_packet_vs().

◆ get_vs_prop_int()

static int get_vs_prop_int ( AVFormatContext s,
const VSMap *  map,
const char *  name,
int  def 
)
static

Definition at line 370 of file vapoursynth.c.

Referenced by read_packet_vs().

◆ free_vsframe_ref()

static void free_vsframe_ref ( void *  opaque,
uint8_t *  data 
)
static

Definition at line 386 of file vapoursynth.c.

Referenced by read_packet_vs().

◆ read_packet_vs()

static int read_packet_vs ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 398 of file vapoursynth.c.

◆ read_seek_vs()

static int read_seek_vs ( AVFormatContext s,
int  stream_idx,
int64_t  ts,
int  flags 
)
static

Definition at line 522 of file vapoursynth.c.

◆ probe_vs()

static av_cold int probe_vs ( const AVProbeData p)
static

Definition at line 533 of file vapoursynth.c.

Variable Documentation

◆ VSScriptGetAPIFunc

const typedef VSSCRIPTAPI*(* VSScriptGetAPIFunc) (int version)

Definition at line 60 of file vapoursynth.c.

Referenced by read_header_vs(), and vs_load_library().

◆ options

const AVOption options[]
static
Initial value:
= {
{"max_script_size", "set max file size supported (in bytes)", OFFSET(max_script_size), AV_OPT_TYPE_INT64, {.i64 = 1 * 1024 * 1024}, 0, SIZE_MAX - 1, A|D},
{NULL}
}

Definition at line 84 of file vapoursynth.c.

◆ class_vs

const AVClass class_vs
static
Initial value:
= {
.class_name = "VapourSynth demuxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 540 of file vapoursynth.c.

◆ ff_vapoursynth_demuxer

const FFInputFormat ff_vapoursynth_demuxer
Initial value:
= {
.p.name = "vapoursynth",
.p.long_name = NULL_IF_CONFIG_SMALL("VapourSynth demuxer"),
.p.priv_class = &class_vs,
.priv_data_size = sizeof(VSContext),
.flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
}

Definition at line 547 of file vapoursynth.c.

OFFSET
#define OFFSET(x)
Definition: vapoursynth.c:81
class_vs
static const AVClass class_vs
Definition: vapoursynth.c:540
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:151
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:143
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
options
static const AVOption options[]
Definition: vapoursynth.c:84
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Underlying C type is int64_t.
Definition: opt.h:263
read_header_vs
static av_cold int read_header_vs(AVFormatContext *s)
Definition: vapoursynth.c:221
FF_INFMT_FLAG_INIT_CLEANUP
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
Definition: demux.h:35
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:540
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
read_seek_vs
static int read_seek_vs(AVFormatContext *s, int stream_idx, int64_t ts, int flags)
Definition: vapoursynth.c:522
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
read_close_vs
static av_cold int read_close_vs(AVFormatContext *s)
Definition: vapoursynth.c:132
read_packet_vs
static int read_packet_vs(AVFormatContext *s, AVPacket *pkt)
Definition: vapoursynth.c:398
VSContext
Definition: vapoursynth.c:62
A
#define A
Definition: vapoursynth.c:82
probe_vs
static av_cold int probe_vs(const AVProbeData *p)
Definition: vapoursynth.c:533
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
D
#define D
Definition: vapoursynth.c:83