use std::ffi::{c_char, c_double, c_float, c_int, c_void};
use super::{opaque_struct, vs_make_version};
pub const VAPOURSYNTH_API_MAJOR: u16 = 4;
pub const VAPOURSYNTH_API_MINOR: u16 = if cfg!(feature = "vs-41") { 1 } else { 0 };
pub const VAPOURSYNTH_API_VERSION: i32 =
vs_make_version(VAPOURSYNTH_API_MAJOR, VAPOURSYNTH_API_MINOR);
pub const VS_AUDIO_FRAME_SAMPLES: i32 = 3072;
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 {
Undefined = 0,
Gray = 1,
RGB = 2,
YUV = 3,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSSampleType {
Integer = 0,
Float = 1,
}
const fn vs_make_video_id(
color_family: VSColorFamily,
sample_type: VSSampleType,
bits_per_sample: isize,
sub_sampling_w: isize,
sub_sampling_h: isize,
) -> isize {
((color_family as isize) << 28)
| ((sample_type as isize) << 24)
| (bits_per_sample << 16)
| (sub_sampling_w << 8)
| sub_sampling_h
}
use VSColorFamily::{Gray, RGB, YUV};
use VSSampleType::{Float, Integer};
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSPresetVideoFormat {
None = 0,
Gray8 = vs_make_video_id(Gray, Integer, 8, 0, 0),
Gray9 = vs_make_video_id(Gray, Integer, 9, 0, 0),
Gray10 = vs_make_video_id(Gray, Integer, 10, 0, 0),
Gray12 = vs_make_video_id(Gray, Integer, 12, 0, 0),
Gray14 = vs_make_video_id(Gray, Integer, 14, 0, 0),
Gray16 = vs_make_video_id(Gray, Integer, 16, 0, 0),
Gray32 = vs_make_video_id(Gray, Integer, 32, 0, 0),
GrayH = vs_make_video_id(Gray, Float, 16, 0, 0),
GrayS = vs_make_video_id(Gray, Float, 32, 0, 0),
YUV410P8 = vs_make_video_id(YUV, Integer, 8, 2, 2),
YUV411P8 = vs_make_video_id(YUV, Integer, 8, 2, 0),
YUV440P8 = vs_make_video_id(YUV, Integer, 8, 0, 1),
YUV420P8 = vs_make_video_id(YUV, Integer, 8, 1, 1),
YUV422P8 = vs_make_video_id(YUV, Integer, 8, 1, 0),
YUV444P8 = vs_make_video_id(YUV, Integer, 8, 0, 0),
YUV420P9 = vs_make_video_id(YUV, Integer, 9, 1, 1),
YUV422P9 = vs_make_video_id(YUV, Integer, 9, 1, 0),
YUV444P9 = vs_make_video_id(YUV, Integer, 9, 0, 0),
YUV420P10 = vs_make_video_id(YUV, Integer, 10, 1, 1),
YUV422P10 = vs_make_video_id(YUV, Integer, 10, 1, 0),
YUV444P10 = vs_make_video_id(YUV, Integer, 10, 0, 0),
YUV420P12 = vs_make_video_id(YUV, Integer, 12, 1, 1),
YUV422P12 = vs_make_video_id(YUV, Integer, 12, 1, 0),
YUV444P12 = vs_make_video_id(YUV, Integer, 12, 0, 0),
YUV420P14 = vs_make_video_id(YUV, Integer, 14, 1, 1),
YUV422P14 = vs_make_video_id(YUV, Integer, 14, 1, 0),
YUV444P14 = vs_make_video_id(YUV, Integer, 14, 0, 0),
YUV420P16 = vs_make_video_id(YUV, Integer, 16, 1, 1),
YUV422P16 = vs_make_video_id(YUV, Integer, 16, 1, 0),
YUV444P16 = vs_make_video_id(YUV, Integer, 16, 0, 0),
YUV420PH = vs_make_video_id(YUV, Float, 16, 1, 1),
YUV420PS = vs_make_video_id(YUV, Float, 32, 1, 1),
YUV422PH = vs_make_video_id(YUV, Float, 16, 1, 0),
YUV422PS = vs_make_video_id(YUV, Float, 32, 1, 0),
YUV444PH = vs_make_video_id(YUV, Float, 16, 0, 0),
YUV444PS = vs_make_video_id(YUV, Float, 32, 0, 0),
RGB24 = vs_make_video_id(RGB, Integer, 8, 0, 0),
RGB27 = vs_make_video_id(RGB, Integer, 9, 0, 0),
RGB30 = vs_make_video_id(RGB, Integer, 10, 0, 0),
RGB36 = vs_make_video_id(RGB, Integer, 12, 0, 0),
RGB42 = vs_make_video_id(RGB, Integer, 14, 0, 0),
RGB48 = vs_make_video_id(RGB, Integer, 16, 0, 0),
RGBH = vs_make_video_id(RGB, Float, 16, 0, 0),
RGBS = vs_make_video_id(RGB, Float, 32, 0, 0),
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSFilterMode {
Parallel = 0,
ParallelRequests = 1,
Unordered = 2,
FrameState = 3,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSMediaType {
Video = 1,
Audio = 2,
}
#[repr(C)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct VSVideoFormat {
pub color_family: VSColorFamily,
pub sample_type: VSSampleType,
pub bits_per_sample: c_int,
pub bytes_per_sample: c_int,
pub sub_sampling_w: c_int,
pub sub_sampling_h: c_int,
pub num_planes: c_int,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSAudioChannels {
FrontLeft = 0,
FrontRight = 1,
FrontCenter = 2,
LowFrequency = 3,
BackLeft = 4,
BackRight = 5,
FrontLeftOFCenter = 6,
FrontRightOFCenter = 7,
BackCenter = 8,
SideLeft = 9,
SideRight = 10,
TopCenter = 11,
TopFrontLeft = 12,
TopFrontCenter = 13,
TopFrontRight = 14,
TopBackLeft = 15,
TopBackCenter = 16,
TopBackRight = 17,
StereoLeft = 29,
StereoRight = 30,
WideLeft = 31,
WideRight = 32,
SurroundDirectLeft = 33,
SurroundDirectRight = 34,
LowFrequency2 = 35,
}
#[repr(C)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct VSAudioFormat {
pub sample_type: VSSampleType,
pub bits_per_sample: c_int,
pub bytes_per_sample: c_int,
pub num_channels: c_int,
pub channel_layout: u64,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSPropertyType {
Unset = 0,
Int = 1,
Float = 2,
Data = 3,
Function = 4,
VideoNode = 5,
AudioNode = 6,
VideoFrame = 7,
AudioFrame = 8,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSMapPropertyError {
Success = 0,
Unset = 1,
Type = 2,
Index = 4,
Error = 3,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSMapAppendMode {
Replace = 0,
Append = 1,
}
#[repr(C)]
#[derive(Eq, PartialEq, Hash, Debug)]
pub struct VSCoreInfo {
pub version_string: *const c_char,
pub core: c_int,
pub api: c_int,
pub num_threads: c_int,
pub max_framebuffer_size: i64,
pub used_framebuffer_size: i64,
}
#[repr(C)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct VSVideoInfo {
pub format: VSVideoFormat,
pub fps_num: i64,
pub fps_den: i64,
pub width: c_int,
pub height: c_int,
pub num_frames: c_int,
}
#[repr(C)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct VSAudioInfo {
pub format: VSAudioFormat,
pub sample_rate: c_int,
pub num_samples: i64,
pub num_frames: c_int,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSActivationReason {
Initial = 0,
AllFramesReady = 1,
Error = -1,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSMessageType {
Debug = 0,
Information = 1,
Warning = 2,
Critical = 3,
Fatal = 4,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSCoreCreationFlags {
EnableGraphInspection = 1,
DisableAutoLoading = 2,
DisableLibraryUnloading = 4,
}
impl std::ops::BitOr for VSCoreCreationFlags {
type Output = c_int;
fn bitor(self, rhs: Self) -> Self::Output {
self as c_int | rhs as c_int
}
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSPluginConfigFlags {
Modifiable = 1,
}
impl std::ops::BitOr for VSPluginConfigFlags {
type Output = c_int;
fn bitor(self, rhs: Self) -> Self::Output {
self as c_int | rhs as c_int
}
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSDataTypeHint {
Unknown = -1,
Binary = 0,
Utf8 = 1,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSRequestPattern {
General = 0,
NoFrameReuse = 1,
StrictSpatial = 2,
}
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum VSCacheMode {
Auto = -1,
ForceDisable = 0,
ForceEnable = 1,
}
pub type VSGetVapourSynthAPI = unsafe extern "system-unwind" fn(version: c_int) -> *const VSAPI;
pub type VSPublicFunction = unsafe extern "system-unwind" fn(
in_: *const VSMap,
out: *mut VSMap,
user_data: *mut c_void,
core: *mut VSCore,
vsapi: *const VSAPI,
);
pub type VSInitPlugin =
unsafe extern "system-unwind" fn(plugin: *mut VSPlugin, vspapi: *const VSPLUGINAPI);
pub type VSFreeFunctionData = Option<unsafe extern "system-unwind" fn(user_data: *mut c_void)>;
pub type VSFilterGetFrame = unsafe extern "system-unwind" fn(
n: c_int,
activation_reason: VSActivationReason,
instance_data: *mut c_void,
frame_data: *mut *mut c_void,
frame_ctx: *mut VSFrameContext,
core: *mut VSCore,
vsapi: *const VSAPI,
) -> *const VSFrame;
pub type VSFilterFree = Option<
unsafe extern "system-unwind" fn(
instance_data: *mut c_void,
core: *mut VSCore,
vsapi: *const VSAPI,
),
>;
pub type VSFrameDoneCallback = unsafe extern "system-unwind" fn(
user_data: *mut c_void,
f: *const VSFrame,
n: c_int,
node: *mut VSNode,
error_msg: *const c_char,
);
pub type VSLogHandler = Option<
unsafe extern "system-unwind" fn(msg_type: c_int, msg: *const c_char, user_data: *mut c_void),
>;
pub type VSLogHandlerFree = Option<unsafe extern "system-unwind" fn(user_data: *mut c_void)>;
#[allow(non_snake_case)]
#[repr(C)]
pub struct VSPLUGINAPI {
pub getAPIVersion: unsafe extern "system-unwind" fn() -> c_int,
pub configPlugin: unsafe extern "system-unwind" fn(
identifier: *const c_char,
plugin_namespace: *const c_char,
name: *const c_char,
plugin_version: c_int,
api_version: c_int,
flags: c_int,
plugin: *mut VSPlugin,
) -> c_int,
pub registerFunction: unsafe extern "system-unwind" 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 {
pub source: *mut VSNode,
pub request_pattern: VSRequestPattern,
}
#[allow(non_snake_case)]
#[repr(C)]
pub struct VSAPI {
pub createVideoFilter: unsafe extern "system-unwind" fn(
out: *mut VSMap,
name: *const c_char,
vi: *const VSVideoInfo,
getFrame: VSFilterGetFrame,
free: VSFilterFree,
filterMode: VSFilterMode,
dependencies: *const VSFilterDependency,
numDeps: c_int,
instanceData: *mut c_void,
core: *mut VSCore,
),
pub createVideoFilter2: unsafe extern "system-unwind" fn(
name: *const c_char,
vi: *const VSVideoInfo,
getFrame: VSFilterGetFrame,
free: VSFilterFree,
filterMode: VSFilterMode,
dependencies: *const VSFilterDependency,
numDeps: c_int,
instanceData: *mut c_void,
core: *mut VSCore,
) -> *mut VSNode,
pub createAudioFilter: unsafe extern "system-unwind" fn(
out: *mut VSMap,
name: *const c_char,
ai: *const VSAudioInfo,
getFrame: VSFilterGetFrame,
free: VSFilterFree,
filterMode: VSFilterMode,
dependencies: *const VSFilterDependency,
numDeps: c_int,
instanceData: *mut c_void,
core: *mut VSCore,
),
pub createAudioFilter2: unsafe extern "system-unwind" fn(
name: *const c_char,
ai: *const VSAudioInfo,
getFrame: VSFilterGetFrame,
free: VSFilterFree,
filterMode: VSFilterMode,
dependencies: *const VSFilterDependency,
numDeps: c_int,
instanceData: *mut c_void,
core: *mut VSCore,
) -> *mut VSNode,
pub setLinearFilter: unsafe extern "system-unwind" fn(node: *mut VSNode) -> c_int,
pub setCacheMode: unsafe extern "system-unwind" fn(node: *mut VSNode, mode: VSCacheMode),
pub setCacheOptions: unsafe extern "system-unwind" fn(
node: *mut VSNode,
fixedSize: c_int,
maxSize: c_int,
maxHistorySize: c_int,
),
pub freeNode: unsafe extern "system-unwind" fn(node: *mut VSNode),
pub addNodeRef: unsafe extern "system-unwind" fn(node: *mut VSNode) -> *mut VSNode,
pub getNodeType: unsafe extern "system-unwind" fn(node: *mut VSNode) -> VSMediaType,
pub getVideoInfo: unsafe extern "system-unwind" fn(node: *mut VSNode) -> *const VSVideoInfo,
pub getAudioInfo: unsafe extern "system-unwind" fn(node: *mut VSNode) -> *const VSAudioInfo,
pub newVideoFrame: unsafe extern "system-unwind" fn(
format: *const VSVideoFormat,
width: c_int,
height: c_int,
propSrc: *const VSFrame,
core: *mut VSCore,
) -> *mut VSFrame,
pub newVideoFrame2: unsafe extern "system-unwind" 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-unwind" fn(
format: *const VSAudioFormat,
numSamples: c_int,
propSrc: *const VSFrame,
core: *mut VSCore,
) -> *mut VSFrame,
pub newAudioFrame2: unsafe extern "system-unwind" 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-unwind" fn(f: *const VSFrame),
pub addFrameRef: unsafe extern "system-unwind" fn(f: *const VSFrame) -> *mut VSFrame,
pub copyFrame:
unsafe extern "system-unwind" fn(f: *const VSFrame, core: *mut VSCore) -> *mut VSFrame,
pub getFramePropertiesRO: unsafe extern "system-unwind" fn(f: *const VSFrame) -> *const VSMap,
pub getFramePropertiesRW: unsafe extern "system-unwind" fn(f: *mut VSFrame) -> *mut VSMap,
pub getStride: unsafe extern "system-unwind" fn(f: *const VSFrame, plane: c_int) -> isize,
pub getReadPtr: unsafe extern "system-unwind" fn(f: *const VSFrame, plane: c_int) -> *const u8,
pub getWritePtr: unsafe extern "system-unwind" fn(f: *mut VSFrame, plane: c_int) -> *mut u8,
pub getVideoFrameFormat:
unsafe extern "system-unwind" fn(f: *const VSFrame) -> *const VSVideoFormat,
pub getAudioFrameFormat:
unsafe extern "system-unwind" fn(f: *const VSFrame) -> *const VSAudioFormat,
pub getFrameType: unsafe extern "system-unwind" fn(f: *const VSFrame) -> VSMediaType,
pub getFrameWidth: unsafe extern "system-unwind" fn(f: *const VSFrame, plane: c_int) -> c_int,
pub getFrameHeight: unsafe extern "system-unwind" fn(f: *const VSFrame, plane: c_int) -> c_int,
pub getFrameLength: unsafe extern "system-unwind" fn(f: *const VSFrame) -> c_int,
pub getVideoFormatName: unsafe extern "system-unwind" fn(
format: *const VSVideoFormat,
buffer: *mut c_char,
) -> c_int,
pub getAudioFormatName: unsafe extern "system-unwind" fn(
format: *const VSAudioFormat,
buffer: *mut c_char,
) -> c_int,
pub queryVideoFormat: unsafe extern "system-unwind" fn(
format: *mut VSVideoFormat,
colorFamily: VSColorFamily,
sampleType: VSSampleType,
bitsPerSample: c_int,
subSamplingW: c_int,
subSamplingH: c_int,
core: *mut VSCore,
) -> c_int,
pub queryAudioFormat: unsafe extern "system-unwind" fn(
format: *mut VSAudioFormat,
sampleType: VSSampleType,
bitsPerSample: c_int,
channelLayout: u64,
core: *mut VSCore,
) -> c_int,
pub queryVideoFormatID: unsafe extern "system-unwind" fn(
colorFamily: VSColorFamily,
sampleType: VSSampleType,
bitsPerSample: c_int,
subSamplingW: c_int,
subSamplingH: c_int,
core: *mut VSCore,
) -> u32,
pub getVideoFormatByID: unsafe extern "system-unwind" fn(
format: *mut VSVideoFormat,
id: u32,
core: *mut VSCore,
) -> c_int,
pub getFrame: unsafe extern "system-unwind" fn(
n: c_int,
node: *mut VSNode,
errorMsg: *mut c_char,
bufSize: c_int,
) -> *const VSFrame,
pub getFrameAsync: unsafe extern "system-unwind" fn(
n: c_int,
node: *mut VSNode,
callback: VSFrameDoneCallback,
userData: *mut c_void,
),
pub getFrameFilter: unsafe extern "system-unwind" fn(
n: c_int,
node: *mut VSNode,
frameCtx: *mut VSFrameContext,
) -> *const VSFrame,
pub requestFrameFilter: unsafe extern "system-unwind" fn(
n: c_int,
node: *mut VSNode,
frameCtx: *mut VSFrameContext,
),
pub releaseFrameEarly: unsafe extern "system-unwind" fn(
node: *mut VSNode,
n: c_int,
frameCtx: *mut VSFrameContext,
),
pub cacheFrame: unsafe extern "system-unwind" fn(
frame: *const VSFrame,
n: c_int,
frameCtx: *mut VSFrameContext,
),
pub setFilterError: unsafe extern "system-unwind" fn(
errorMessage: *const c_char,
frameCtx: *mut VSFrameContext,
),
pub createFunction: unsafe extern "system-unwind" fn(
func: VSPublicFunction,
userData: *mut c_void,
free: VSFreeFunctionData,
core: *mut VSCore,
) -> *mut VSFunction,
pub freeFunction: unsafe extern "system-unwind" fn(f: *mut VSFunction),
pub addFunctionRef: unsafe extern "system-unwind" fn(f: *mut VSFunction) -> *mut VSFunction,
pub callFunction:
unsafe extern "system-unwind" fn(func: *mut VSFunction, in_: *const VSMap, out: *mut VSMap),
pub createMap: unsafe extern "system-unwind" fn() -> *mut VSMap,
pub freeMap: unsafe extern "system-unwind" fn(map: *mut VSMap),
pub clearMap: unsafe extern "system-unwind" fn(map: *mut VSMap),
pub copyMap: unsafe extern "system-unwind" fn(src: *const VSMap, dst: *mut VSMap),
pub mapSetError: unsafe extern "system-unwind" fn(map: *mut VSMap, errorMessage: *const c_char),
pub mapGetError: unsafe extern "system-unwind" fn(map: *const VSMap) -> *const c_char,
pub mapNumKeys: unsafe extern "system-unwind" fn(map: *const VSMap) -> c_int,
pub mapGetKey:
unsafe extern "system-unwind" fn(map: *const VSMap, index: c_int) -> *const c_char,
pub mapDeleteKey:
unsafe extern "system-unwind" fn(map: *mut VSMap, key: *const c_char) -> c_int,
pub mapNumElements:
unsafe extern "system-unwind" fn(map: *const VSMap, key: *const c_char) -> c_int,
pub mapGetType:
unsafe extern "system-unwind" fn(map: *const VSMap, key: *const c_char) -> VSPropertyType,
pub mapSetEmpty: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
type_: VSPropertyType,
) -> c_int,
pub mapGetInt: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut VSMapPropertyError,
) -> i64,
pub mapGetIntSaturated: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut VSMapPropertyError,
) -> c_int,
pub mapGetIntArray: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
error: *mut VSMapPropertyError,
) -> *const i64,
pub mapSetInt: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
i: i64,
append: VSMapAppendMode,
) -> c_int,
pub mapSetIntArray: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
i: *const i64,
size: c_int,
) -> c_int,
pub mapGetFloat: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut VSMapPropertyError,
) -> c_double,
pub mapGetFloatSaturated: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut VSMapPropertyError,
) -> c_float,
pub mapGetFloatArray: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
error: *mut VSMapPropertyError,
) -> *const c_double,
pub mapSetFloat: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
d: c_double,
append: VSMapAppendMode,
) -> c_int,
pub mapSetFloatArray: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
d: *const c_double,
size: c_int,
) -> c_int,
pub mapGetData: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut VSMapPropertyError,
) -> *const c_char,
pub mapGetDataSize: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut VSMapPropertyError,
) -> c_int,
pub mapGetDataTypeHint: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut VSMapPropertyError,
) -> VSDataTypeHint,
pub mapSetData: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
data: *const c_char,
size: c_int,
type_: VSDataTypeHint,
append: VSMapAppendMode,
) -> c_int,
pub mapGetNode: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut VSMapPropertyError,
) -> *mut VSNode,
pub mapSetNode: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
node: *mut VSNode,
append: VSMapAppendMode,
) -> c_int,
pub mapConsumeNode: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
node: *mut VSNode,
append: VSMapAppendMode,
) -> c_int,
pub mapGetFrame: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut VSMapPropertyError,
) -> *const VSFrame,
pub mapSetFrame: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
f: *const VSFrame,
append: VSMapAppendMode,
) -> c_int,
pub mapConsumeFrame: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
f: *const VSFrame,
append: VSMapAppendMode,
) -> c_int,
pub mapGetFunction: unsafe extern "system-unwind" fn(
map: *const VSMap,
key: *const c_char,
index: c_int,
error: *mut VSMapPropertyError,
) -> *mut VSFunction,
pub mapSetFunction: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
func: *mut VSFunction,
append: VSMapAppendMode,
) -> c_int,
pub mapConsumeFunction: unsafe extern "system-unwind" fn(
map: *mut VSMap,
key: *const c_char,
func: *mut VSFunction,
append: VSMapAppendMode,
) -> c_int,
pub registerFunction: unsafe extern "system-unwind" 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-unwind" fn(
identifier: *const c_char,
core: *mut VSCore,
) -> *mut VSPlugin,
pub getPluginByNamespace:
unsafe extern "system-unwind" fn(ns: *const c_char, core: *mut VSCore) -> *mut VSPlugin,
pub getNextPlugin:
unsafe extern "system-unwind" fn(plugin: *mut VSPlugin, core: *mut VSCore) -> *mut VSPlugin,
pub getPluginName: unsafe extern "system-unwind" fn(plugin: *mut VSPlugin) -> *const c_char,
pub getPluginID: unsafe extern "system-unwind" fn(plugin: *mut VSPlugin) -> *const c_char,
pub getPluginNamespace:
unsafe extern "system-unwind" fn(plugin: *mut VSPlugin) -> *const c_char,
pub getNextPluginFunction: unsafe extern "system-unwind" fn(
func: *mut VSPluginFunction,
plugin: *mut VSPlugin,
) -> *mut VSPluginFunction,
pub getPluginFunctionByName: unsafe extern "system-unwind" fn(
name: *const c_char,
plugin: *mut VSPlugin,
) -> *mut VSPluginFunction,
pub getPluginFunctionName:
unsafe extern "system-unwind" fn(func: *mut VSPluginFunction) -> *const c_char,
pub getPluginFunctionArguments:
unsafe extern "system-unwind" fn(func: *mut VSPluginFunction) -> *const c_char,
pub getPluginFunctionReturnType:
unsafe extern "system-unwind" fn(func: *mut VSPluginFunction) -> *const c_char,
pub getPluginPath: unsafe extern "system-unwind" fn(plugin: *const VSPlugin) -> *const c_char,
pub getPluginVersion: unsafe extern "system-unwind" fn(plugin: *const VSPlugin) -> c_int,
pub invoke: unsafe extern "system-unwind" fn(
plugin: *mut VSPlugin,
name: *const c_char,
args: *const VSMap,
) -> *mut VSMap,
pub createCore: unsafe extern "system-unwind" fn(flags: c_int) -> *mut VSCore,
pub freeCore: unsafe extern "system-unwind" fn(core: *mut VSCore),
pub setMaxCacheSize: unsafe extern "system-unwind" fn(bytes: i64, core: *mut VSCore) -> i64,
pub setThreadCount:
unsafe extern "system-unwind" fn(threads: c_int, core: *mut VSCore) -> c_int,
pub getCoreInfo: unsafe extern "system-unwind" fn(core: *mut VSCore, info: *mut VSCoreInfo),
pub getAPIVersion: unsafe extern "system-unwind" fn() -> c_int,
pub logMessage: unsafe extern "system-unwind" fn(
msgType: VSMessageType,
msg: *const c_char,
core: *mut VSCore,
),
pub addLogHandler: unsafe extern "system-unwind" fn(
handler: VSLogHandler,
free: VSLogHandlerFree,
userData: *mut c_void,
core: *mut VSCore,
) -> *mut VSLogHandle,
pub removeLogHandler:
unsafe extern "system-unwind" fn(handle: *mut VSLogHandle, core: *mut VSCore) -> c_int,
#[cfg(feature = "vs-41")]
pub clearNodeCache: unsafe extern "system-unwind" fn(node: *mut VSNode),
#[cfg(feature = "vs-41")]
pub clearCoreCaches: unsafe extern "system-unwind" fn(core: *mut VSCore),
#[cfg(feature = "vs-41")]
pub getNodeName: unsafe extern "system-unwind" fn(node: *mut VSNode) -> *const c_char,
#[cfg(feature = "vs-41")]
pub getNodeFilterMode: unsafe extern "system-unwind" fn(node: *mut VSNode) -> VSFilterMode,
#[cfg(feature = "vs-41")]
pub getNumNodeDependencies: unsafe extern "system-unwind" fn(node: *mut VSNode) -> c_int,
#[cfg(feature = "vs-41")]
pub getNodeDependencies:
unsafe extern "system-unwind" fn(node: *mut VSNode) -> *const VSFilterDependency,
pub getCoreNodeTiming: unsafe extern "system-unwind" fn(core: *mut VSCore) -> c_int,
pub setCoreNodeTiming: unsafe extern "system-unwind" fn(core: *mut VSCore, enable: c_int),
pub getNodeProcessingTime:
unsafe extern "system-unwind" fn(node: *mut VSNode, reset: c_int) -> i64,
pub getFreedNodeProcessingTime:
unsafe extern "system-unwind" fn(core: *mut VSCore, reset: c_int) -> i64,
#[cfg(feature = "vs-graph")]
pub getNodeCreationFunctionName:
unsafe extern "system-unwind" fn(node: *mut VSNode, level: c_int) -> *const c_char,
#[cfg(feature = "vs-graph")]
pub getNodeCreationFunctionArguments:
unsafe extern "system-unwind" fn(node: *mut VSNode, level: c_int) -> *const VSMap,
}
#[cfg(feature = "link-library")]
#[link(name = "vapoursynth")]
unsafe extern "system-unwind" {
pub fn getVapourSynthAPI(version: c_int) -> *const VSAPI;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn layout() {
assert_eq!(
std::mem::size_of::<VSPresetVideoFormat>(),
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"
);
assert_eq!(
std::mem::size_of::<VSColorFamily>(),
std::mem::size_of::<c_int>(),
"VSColorFamily"
);
assert_eq!(
std::mem::size_of::<VSSampleType>(),
std::mem::size_of::<c_int>(),
"VSSampleType"
);
assert_eq!(
std::mem::size_of::<VSMapAppendMode>(),
std::mem::size_of::<c_int>(),
"VSMapAppendMode"
);
assert_eq!(
std::mem::size_of::<VSMessageType>(),
std::mem::size_of::<c_int>(),
"VSMessageType"
);
assert_eq!(
std::mem::size_of::<VSCacheMode>(),
std::mem::size_of::<c_int>(),
"VSCacheMode"
);
}
}