use core::ffi::*;
pub const VS_AUDIO_FRAME_SAMPLES: i32 = 3072;
use super::opaque_struct;
opaque_struct!(
VSFrame,
VSNode,
VSCore,
VSPlugin,
VSPluginFunction,
VSFunction,
VSMap,
VSLogHandle,
VSFrameContext
);
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSColorFamily {
cfUndefined = 0,
cfGray = 1,
cfRGB = 2,
cfYUV = 3,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSSampleType {
stInteger = 0,
stFloat = 1,
}
const fn VS_MAKE_VIDEO_ID(
colorFamily: VSColorFamily,
sampleType: VSSampleType,
bitsPerSample: isize,
subSamplingW: isize,
subSamplingH: isize,
) -> isize {
((colorFamily as isize) << 28)
| ((sampleType as isize) << 24)
| (bitsPerSample << 16)
| (subSamplingW << 8)
| subSamplingH
}
use VSColorFamily::*;
use VSSampleType::*;
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSPresetFormat {
pfNone = 0,
pfGray8 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 8, 0, 0),
pfGray9 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 9, 0, 0),
pfGray10 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 10, 0, 0),
pfGray12 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 12, 0, 0),
pfGray14 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 14, 0, 0),
pfGray16 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 16, 0, 0),
pfGray32 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 32, 0, 0),
pfGrayH = VS_MAKE_VIDEO_ID(cfGray, stFloat, 16, 0, 0),
pfGrayS = VS_MAKE_VIDEO_ID(cfGray, stFloat, 32, 0, 0),
pfYUV410P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 2, 2),
pfYUV411P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 2, 0),
pfYUV440P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 0, 1),
pfYUV420P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 1, 1),
pfYUV422P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 1, 0),
pfYUV444P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 0, 0),
pfYUV420P9 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 9, 1, 1),
pfYUV422P9 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 9, 1, 0),
pfYUV444P9 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 9, 0, 0),
pfYUV420P10 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 10, 1, 1),
pfYUV422P10 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 10, 1, 0),
pfYUV444P10 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 10, 0, 0),
pfYUV420P12 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 12, 1, 1),
pfYUV422P12 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 12, 1, 0),
pfYUV444P12 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 12, 0, 0),
pfYUV420P14 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 14, 1, 1),
pfYUV422P14 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 14, 1, 0),
pfYUV444P14 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 14, 0, 0),
pfYUV420P16 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 16, 1, 1),
pfYUV422P16 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 16, 1, 0),
pfYUV444P16 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 16, 0, 0),
pfYUV444PH = VS_MAKE_VIDEO_ID(cfYUV, stFloat, 16, 0, 0),
pfYUV444PS = VS_MAKE_VIDEO_ID(cfYUV, stFloat, 32, 0, 0),
pfRGB24 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 8, 0, 0),
pfRGB27 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 9, 0, 0),
pfRGB30 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 10, 0, 0),
pfRGB36 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 12, 0, 0),
pfRGB42 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 14, 0, 0),
pfRGB48 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 16, 0, 0),
pfRGBH = VS_MAKE_VIDEO_ID(cfRGB, stFloat, 16, 0, 0),
pfRGBS = VS_MAKE_VIDEO_ID(cfRGB, stFloat, 32, 0, 0),
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSFilterMode {
fmParallel = 0,
fmParallelRequests = 1,
fmUnordered = 2,
fmFrameState = 3,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSMediaType {
mtVideo = 1,
mtAudio = 2,
}
#[repr(C)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct VSVideoFormat {
pub colorFamily: VSColorFamily,
pub sampleType: VSSampleType,
pub bitsPerSample: c_int,
pub bytesPerSample: c_int,
pub subSamplingW: c_int,
pub subSamplingH: c_int,
pub numPlanes: c_int,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSAudioChannels {
acFrontLeft = 0,
acFrontRight = 1,
acFrontCenter = 2,
acLowFrequency = 3,
acBackLeft = 4,
acBackRight = 5,
acFrontLeftOFCenter = 6,
acFrontRightOFCenter = 7,
acBackCenter = 8,
acSideLeft = 9,
acSideRight = 10,
acTopCenter = 11,
acTopFrontLeft = 12,
acTopFrontCenter = 13,
acTopFrontRight = 14,
acTopBackLeft = 15,
acTopBackCenter = 16,
acTopBackRight = 17,
acStereoLeft = 29,
acStereoRight = 30,
acWideLeft = 31,
acWideRight = 32,
acSurroundDirectLeft = 33,
acSurroundDirectRight = 34,
acLowFrequency2 = 35,
}
#[repr(C)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct VSAudioFormat {
pub sampleType: VSSampleType,
pub bitsPerSample: c_int,
pub bytesPerSample: c_int,
pub numChannels: c_int,
pub channelLayout: u64,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSPropertyType {
ptUnset = 0,
ptInt = 1,
ptFloat = 2,
ptData = 3,
ptFunction = 4,
ptVideoNode = 5,
ptAudioNode = 6,
ptVideoFrame = 7,
ptAudioFrame = 8,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSMapPropertyError {
peSuccess = 0,
peUnset = 1,
peType = 2,
peIndex = 4,
peError = 3,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSMapAppendMode {
maReplace = 0,
maAppend = 1,
}
#[repr(C)]
#[derive(Eq, PartialEq, Hash, Debug)]
pub struct VSCoreInfo {
pub versionString: *const c_char, pub core: c_int,
pub api: c_int,
pub numThreads: c_int,
pub maxFramebufferSize: i64,
pub usedFramebufferSize: i64,
}
#[repr(C)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct VSVideoInfo {
pub format: VSVideoFormat,
pub fpsNum: i64,
pub fpsDen: i64,
pub width: c_int,
pub height: c_int,
pub numFrames: c_int,
}
#[repr(C)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct VSAudioInfo {
pub format: VSAudioFormat,
pub sampleRate: c_int,
pub numSamples: i64,
pub numFrames: c_int,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSActivationReason {
arInitial = 0,
arAllFramesReady = 1,
arError = -1,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSMessageType {
mtDebug = 0,
mtInformation = 1,
mtWarning = 2,
mtCritical = 3,
mtFatal = 4,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSCoreCreationFlags {
ccfEnableGraphInspection = 1,
ccfDisableAutoLoading = 2,
ccfDisableLibraryUnloading = 4,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSPluginConfigFlags {
pcModifiable = 1,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSDataTypeHint {
dtUnknown = -1,
dtBinary = 0,
dtUtf8 = 1,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSRequestPattern {
rpGeneral = 0,
rpNoFrameReuse = 1,
rpStrictSpatial = 2,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSCacheMode {
cmAuto = -1,
cmForceDisable = 0,
cmForceEnable = 1,
}
pub type VSGetVapourSynthAPI = unsafe extern "system" fn(version: c_int) -> *const VSAPI;
pub type VSPublicFunction = unsafe extern "system" fn(
in_: *const VSMap,
out: *mut VSMap,
userData: *mut c_void,
core: *mut VSCore,
vsapi: *const VSAPI,
);
pub type VSInitPlugin =
unsafe extern "system" fn(plugin: *mut VSPlugin, vspapi: *const VSPLUGINAPI);
pub type VSFreeFunctionData = Option<unsafe extern "system" fn(userData: *mut c_void)>;
pub type VSFilterGetFrame = unsafe extern "system" fn(
n: c_int,
activationReason: c_int,
instanceData: *mut c_void,
frameData: *mut *mut c_void,
frameCtx: *mut VSFrameContext,
core: *mut VSCore,
vsapi: *const VSAPI,
) -> *const VSFrame;
pub type VSFilterFree =
unsafe extern "system" fn(instanceData: *mut c_void, core: *mut VSCore, vsapi: *const VSAPI);
pub type VSFrameDoneCallback = unsafe extern "system" fn(
userData: *mut c_void,
f: *const VSFrame,
n: c_int,
node: *mut VSNode,
errorMsg: *const c_char,
);
pub type VSLogHandler =
unsafe extern "system" fn(msgType: c_int, msg: *const c_char, userData: *mut c_void);
pub type VSLogHandlerFree = unsafe extern "system" fn(userData: *mut c_void);
#[repr(C)]
pub struct VSPLUGINAPI {
pub getAPIVersion: unsafe extern "system" fn() -> c_int,
pub configPlugin: unsafe extern "system" fn(
identifier: *const c_char,
pluginNamespace: *const c_char,
name: *const c_char,
pluginVersion: c_int,
apiVersion: c_int,
flags: c_int,
plugin: *mut VSPlugin,
) -> c_int,
pub registerFunction: unsafe extern "system" fn(
name: *const c_char,
args: *const c_char,
returnType: *const c_char,
argsFunc: VSPublicFunction,
functionData: *mut c_void,
plugin: *mut VSPlugin,
) -> c_int,
}
#[repr(C)]
#[derive(Eq, PartialEq, Hash, Debug)]
pub struct VSFilterDependency {
source: *mut VSNode,
requestPattern: VSRequestPattern,
}
#[repr(C)]
pub struct VSAPI {
pub createVideoFilter: unsafe extern "system" fn(
out: *mut VSMap,
name: *const c_char,
vi: *const VSVideoInfo,
getFrame: VSFilterGetFrame,
free: VSFilterFree,
filterMode: c_int,
dependencies: *const VSFilterDependency,
numDeps: c_int,
instanceData: *mut c_void,
core: *mut VSCore,
),
pub createVideoFilter2: unsafe extern "system" fn(
name: *const c_char,
vi: *const VSVideoInfo,
getFrame: VSFilterGetFrame,
free: VSFilterFree,
filterMode: c_int,
dependencies: *const VSFilterDependency,
numDeps: c_int,
instanceData: *mut c_void,
core: *mut VSCore,
) -> *mut VSNode,
pub createAudioFilter: unsafe extern "system" fn(
out: *mut VSMap,
name: *const c_char,
ai: *const VSAudioInfo,
getFrame: VSFilterGetFrame,
free: VSFilterFree,
filterMode: c_int,
dependencies: *const VSFilterDependency,
numDeps: c_int,
instanceData: *mut c_void,
core: *mut VSCore,
),
pub createAudioFilter2: unsafe extern "system" fn(
name: *const c_char,
ai: *const VSAudioInfo,
getFrame: VSFilterGetFrame,
free: VSFilterFree,
filterMode: c_int,
dependencies: *const VSFilterDependency,
numDeps: c_int,
instanceData: *mut c_void,
core: *mut VSCore,
) -> *mut VSNode,
pub setLinearFilter: unsafe extern "system" fn(node: *mut VSNode) -> c_int,
pub setCacheMode: unsafe extern "system" fn(node: *mut VSNode, mode: c_int),
pub setCacheOptions: unsafe extern "system" fn(
node: *mut VSNode,
fixedSize: c_int,
maxSize: c_int,
maxHistorySize: c_int,
),
pub freeNode: unsafe extern "system" fn(node: *mut VSNode),
pub addNodeRef: unsafe extern "system" fn(node: *mut VSNode) -> *mut VSNode,
pub getNodeType: unsafe extern "system" fn(node: *mut VSNode) -> VSMediaType,
pub getVideoInfo: unsafe extern "system" fn(node: *mut VSNode) -> *const VSVideoInfo,
pub getAudioInfo: unsafe extern "system" fn(node: *mut VSNode) -> *const VSAudioInfo,
pub newVideoFrame: unsafe extern "system" fn(
format: *const VSVideoFormat,
width: c_int,
height: c_int,
propSrc: *const VSFrame,
core: *mut VSCore,
) -> *mut VSFrame,
pub newVideoFrame2: unsafe extern "system" fn(
format: *const VSVideoFormat,
width: c_int,
height: c_int,
planeSrc: *const *const VSFrame,
planes: *const c_int,
propSrc: *const VSFrame,
core: *mut VSCore,
) -> *mut VSFrame,
pub newAudioFrame: unsafe extern "system" fn(
format: *const VSAudioFormat,
numSamples: c_int,
propSrc: *const VSFrame,
core: *mut VSCore,
) -> *mut VSFrame,
pub newAudioFrame2: unsafe extern "system" fn(
format: *const VSAudioFormat,
numSamples: c_int,
channelSrc: *const *const VSFrame,
channels: *const c_int,
propSrc: *const VSFrame,
core: *mut VSCore,
) -> *mut VSFrame,
pub freeFrame: unsafe extern "system" fn(f: *const VSFrame),
pub addFrameRef: unsafe extern "system" fn(f: *const VSFrame) -> *mut VSFrame,
pub copyFrame: unsafe extern "system" fn(f: *const VSFrame, core: *mut VSCore) -> *mut VSFrame,
pub getFramePropertiesRO: unsafe extern "system" fn(f: *const VSFrame) -> *const VSMap,
pub getFramePropertiesRW: unsafe extern "system" fn(f: *mut VSFrame) -> *mut VSMap,
pub getStride: unsafe extern "system" fn(f: *const VSFrame, plane: c_int) -> isize,
pub getReadPtr: unsafe extern "system" fn(f: *const VSFrame, plane: c_int) -> *const u8,
pub getWritePtr: unsafe extern "system" fn(f: *mut VSFrame, plane: c_int) -> *mut u8,
pub getVideoFrameFormat: unsafe extern "system" fn(f: *const VSFrame) -> *const VSVideoFormat,
pub getAudioFrameFormat: unsafe extern "system" fn(f: *const VSFrame) -> *const VSAudioFormat,
pub getFrameType: unsafe extern "system" fn(f: *const VSFrame) -> c_int,
pub getFrameWidth: unsafe extern "system" fn(f: *const VSFrame, plane: c_int) -> c_int,
pub getFrameHeight: unsafe extern "system" fn(f: *const VSFrame, plane: c_int) -> c_int,
pub getFrameLength: unsafe extern "system" fn(f: *const VSFrame) -> c_int,
pub getVideoFormatName:
unsafe extern "system" fn(format: *const VSVideoFormat, buffer: *mut c_char) -> c_int,
pub getAudioFormatName:
unsafe extern "system" fn(format: *const VSAudioFormat, buffer: *mut c_char) -> c_int,
pub queryVideoFormat: unsafe extern "system" fn(
format: *mut VSVideoFormat,
colorFamily: c_int,
sampleType: c_int,
bitsPerSample: c_int,
subSamplingW: c_int,
subSamplingH: c_int,
core: *mut VSCore,
) -> c_int,
pub queryAudioFormat: unsafe extern "system" fn(
format: *mut VSAudioFormat,
sampleType: c_int,
bitsPerSample: c_int,
channelLayout: u64,
core: *mut VSCore,
) -> c_int,
pub queryVideoFormatID: unsafe extern "system" fn(
colorFamily: VSColorFamily,
sampleType: VSSampleType,
bitsPerSample: c_int,
subSamplingW: c_int,
subSamplingH: c_int,
core: *mut VSCore,
) -> u32,
pub getVideoFormatByID:
unsafe extern "system" fn(format: *mut VSVideoFormat, id: u32, core: *mut VSCore) -> c_int,
pub getFrame: unsafe extern "system" fn(
n: c_int,
node: *mut VSNode,
errorMsg: *mut c_char,
bufSize: c_int,
) -> *const VSFrame,
pub getFrameAsync: unsafe extern "system" fn(
n: c_int,
node: *mut VSNode,
callback: VSFrameDoneCallback,
userData: *mut c_void,
),
pub getFrameFilter: unsafe extern "system" fn(
n: c_int,
node: *mut VSNode,
frameCtx: *mut VSFrameContext,
) -> *const VSFrame,
pub requestFrameFilter:
unsafe extern "system" fn(n: c_int, node: *mut VSNode, frameCtx: *mut VSFrameContext),
pub releaseFrameEarly:
unsafe extern "system" fn(node: *mut VSNode, n: c_int, frameCtx: *mut VSFrameContext),
pub cacheFrame:
unsafe extern "system" fn(frame: *const VSFrame, n: c_int, frameCtx: *mut VSFrameContext),
pub setFilterError:
unsafe extern "system" fn(errorMessage: *const c_char, frameCtx: *mut VSFrameContext),
pub createFunction: unsafe extern "system" fn(
func: VSPublicFunction,
userData: *mut c_void,
free: VSFreeFunctionData,
core: *mut VSCore,
) -> *mut VSFunction,
pub freeFunction: unsafe extern "system" fn(f: *mut VSFunction),
pub addFunctionRef: unsafe extern "system" fn(f: *mut VSFunction) -> *mut VSFunction,
pub callFunction:
unsafe extern "system" fn(func: *mut VSFunction, in_: *const VSMap, out: *mut VSMap),
pub createMap: unsafe extern "system" fn() -> *mut VSMap,
pub freeMap: unsafe extern "system" fn(map: *mut VSMap),
pub clearMap: unsafe extern "system" fn(map: *mut VSMap),
pub copyMap: unsafe extern "system" fn(src: *const VSMap, dst: *mut VSMap),
pub mapSetError: unsafe extern "system" fn(map: *mut VSMap, errorMessage: *const c_char),
pub mapGetError: unsafe extern "system" fn(map: *const VSMap) -> *const c_char,
pub mapNumKeys: unsafe extern "system" fn(map: *const VSMap) -> c_int,
pub mapGetKey: unsafe extern "system" fn(map: *const VSMap, index: c_int) -> *const c_char,
pub mapDeleteKey: unsafe extern "system" fn(map: *mut VSMap, key: *const c_char) -> c_int,
pub mapNumElements: unsafe extern "system" fn(map: *const VSMap, key: *const c_char) -> c_int,
pub mapGetType:
unsafe extern "system" fn(map: *const VSMap, key: *const c_char) -> VSPropertyType,
pub mapSetEmpty:
unsafe extern "system" fn(map: *mut VSMap, key: *const c_char, type_: c_int) -> c_int,
pub mapGetInt: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut c_int,
) -> i64,
pub mapGetIntSaturated: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut c_int,
) -> c_int,
pub mapGetIntArray: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
error: *mut c_int,
) -> *const i64,
pub mapSetInt: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
i: i64,
append: c_int,
) -> c_int,
pub mapSetIntArray: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
i: *const i64,
size: c_int,
) -> c_int,
pub mapGetFloat: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut c_int,
) -> c_double,
pub mapGetFloatSaturated: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut c_int,
) -> c_float,
pub mapGetFloatArray: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
error: *mut c_int,
) -> *const c_double,
pub mapSetFloat: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
d: c_double,
append: c_int,
) -> c_int,
pub mapSetFloatArray: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
d: *const c_double,
size: c_int,
) -> c_int,
pub mapGetData: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut c_int,
) -> *const c_char,
pub mapGetDataSize: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut c_int,
) -> c_int,
pub mapGetDataTypeHint: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut c_int,
) -> VSDataTypeHint,
pub mapSetData: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
data: *const c_char,
size: c_int,
type_: c_int,
append: c_int,
) -> c_int,
pub mapGetNode: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut c_int,
) -> *mut VSNode,
pub mapSetNode: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
node: *mut VSNode,
append: c_int,
) -> c_int,
pub mapConsumeNode: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
node: *mut VSNode,
append: c_int,
) -> c_int,
pub mapGetFrame: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut c_int,
) -> *const VSFrame,
pub mapSetFrame: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
f: *const VSFrame,
append: c_int,
) -> c_int,
pub mapConsumeFrame: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
f: *const VSFrame,
append: c_int,
) -> c_int,
pub mapGetFunction: unsafe extern "system" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut c_int,
) -> *mut VSFunction,
pub mapSetFunction: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
func: *mut VSFunction,
append: c_int,
) -> c_int,
pub mapConsumeFunction: unsafe extern "system" fn(
map: *mut VSMap,
key: *const c_char,
func: *mut VSFunction,
append: c_int,
) -> c_int,
pub registerFunction: unsafe extern "system" fn(
name: *const c_char,
args: *const c_char,
returnType: *const c_char,
argsFunc: VSPublicFunction,
functionData: *mut c_void,
plugin: *mut VSPlugin,
) -> c_int,
pub getPluginByID:
unsafe extern "system" fn(identifier: *const c_char, core: *mut VSCore) -> *mut VSPlugin,
pub getPluginByNamespace:
unsafe extern "system" fn(ns: *const c_char, core: *mut VSCore) -> *mut VSPlugin,
pub getNextPlugin:
unsafe extern "system" fn(plugin: *mut VSPlugin, core: *mut VSCore) -> *mut VSPlugin,
pub getPluginName: unsafe extern "system" fn(plugin: *mut VSPlugin) -> *const c_char,
pub getPluginID: unsafe extern "system" fn(plugin: *mut VSPlugin) -> *const c_char,
pub getPluginNamespace: unsafe extern "system" fn(plugin: *mut VSPlugin) -> *const c_char,
pub getNextPluginFunction: unsafe extern "system" fn(
func: *mut VSPluginFunction,
plugin: *mut VSPlugin,
) -> *mut VSPluginFunction,
pub getPluginFunctionByName: unsafe extern "system" fn(
name: *const c_char,
plugin: *mut VSPlugin,
) -> *mut VSPluginFunction,
pub getPluginFunctionName:
unsafe extern "system" fn(func: *mut VSPluginFunction) -> *const c_char,
pub getPluginFunctionArguments:
unsafe extern "system" fn(func: *mut VSPluginFunction) -> *const c_char,
pub getPluginFunctionReturnType:
unsafe extern "system" fn(func: *mut VSPluginFunction) -> *const c_char,
pub getPluginPath: unsafe extern "system" fn(plugin: *const VSPlugin) -> *const c_char,
pub getPluginVersion: unsafe extern "system" fn(plugin: *const VSPlugin) -> c_int,
pub invoke: unsafe extern "system" fn(
plugin: *mut VSPlugin,
name: *const c_char,
args: *const VSMap,
) -> *mut VSMap,
pub createCore: unsafe extern "system" fn(flags: VSCoreCreationFlags) -> *mut VSCore,
pub freeCore: unsafe extern "system" fn(core: *mut VSCore),
pub setMaxCacheSize: unsafe extern "system" fn(bytes: i64, core: *mut VSCore) -> i64,
pub setThreadCount: unsafe extern "system" fn(threads: c_int, core: *mut VSCore) -> c_int,
pub getCoreInfo: unsafe extern "system" fn(core: *mut VSCore, info: *mut VSCoreInfo),
pub getAPIVersion: unsafe extern "system" fn() -> c_int,
pub logMessage:
unsafe extern "system" fn(msgType: c_int, msg: *const c_char, core: *mut VSCore),
pub addLogHandler: unsafe extern "system" fn(
handler: VSLogHandler,
free: Option<VSLogHandlerFree>,
userData: *mut c_void,
core: *mut VSCore,
) -> *mut VSLogHandle,
pub removeLogHandler:
unsafe extern "system" fn(handle: *mut VSLogHandle, core: *mut VSCore) -> c_int,
#[cfg(feature = "vs-graph")]
pub getNodeCreationFunctionName:
unsafe extern "system" fn(node: *mut VSNode, level: c_int) -> *const c_char,
#[cfg(feature = "vs-graph")]
pub getNodeCreationFunctionArguments:
unsafe extern "system" fn(node: *mut VSNode, level: c_int) -> *const VSMap,
#[cfg(feature = "vs-graph")]
pub getNodeName: unsafe extern "system" fn(node: *mut VSNode) -> *const c_char,
#[cfg(feature = "vs-graph")]
pub getNodeFilterMode: unsafe extern "system" fn(node: *mut VSNode) -> VSFilterMode,
#[cfg(feature = "vs-graph")]
pub getNodeFilterTime: unsafe extern "system" fn(node: *mut VSNode) -> i64,
#[cfg(feature = "vs-graph")]
pub getNodeDependencies:
unsafe extern "system" fn(node: *mut VSNode) -> *const VSFilterDependency,
#[cfg(feature = "vs-graph")]
pub getNumNodeDependencies: unsafe extern "system" fn(node: *mut VSNode) -> c_int,
}
extern "system" {
pub fn getVapourSynthAPI(version: c_int) -> *const VSAPI;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_layout() {
assert_eq!(
std::mem::size_of::<VSPresetFormat>(),
std::mem::size_of::<c_int>(),
"VSPresetFormat"
);
assert_eq!(
std::mem::size_of::<VSDataTypeHint>(),
std::mem::size_of::<c_int>(),
"VSDataTypeHint"
);
assert_eq!(
std::mem::size_of::<VSCoreCreationFlags>(),
std::mem::size_of::<c_int>(),
"VSCoreCreationFlags"
);
assert_eq!(
std::mem::size_of::<VSFilterMode>(),
std::mem::size_of::<c_int>(),
"VSFilterMode"
);
}
}