Debian Codegraph @

src/vapoursynth/VapourSynth4.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2012-2021 Fredrik Mellbin
3 *
4 * This file is part of VapourSynth.
5 *
6 * VapourSynth is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * VapourSynth is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with VapourSynth; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef VAPOURSYNTH4_H
22 #define VAPOURSYNTH4_H
23
24 #include <stdint.h>
25 #include <stddef.h>
26
27 #define VS_MAKE_VERSION(major, minor) (((major) << 16) | (minor))
28 #define VAPOURSYNTH_API_MAJOR 4
29 #define VAPOURSYNTH_API_MINOR 0
30 #define VAPOURSYNTH_API_VERSION VS_MAKE_VERSION(VAPOURSYNTH_API_MAJOR, VAPOURSYNTH_API_MINOR)
31
32 #define VS_AUDIO_FRAME_SAMPLES 3072
33
34 /* Convenience for C++ users. */
35 #ifdef __cplusplus
36 # define VS_EXTERN_C extern "C"
37 # if __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
38 # define VS_NOEXCEPT noexcept
39 # else
40 # define VS_NOEXCEPT
41 # endif
42 #else
43 # define VS_EXTERN_C
44 # define VS_NOEXCEPT
45 #endif
46
47 #if defined(_WIN32) && !defined(_WIN64)
48 # define VS_CC __stdcall
49 #else
50 # define VS_CC
51 #endif
52
53 /* And now for some symbol hide-and-seek... */
54 #if defined(_WIN32) /* Windows being special */
55 # define VS_EXTERNAL_API(ret) VS_EXTERN_C __declspec(dllexport) ret VS_CC
56 #elif defined(__GNUC__) && __GNUC__ >= 4
57 # define VS_EXTERNAL_API(ret) VS_EXTERN_C __attribute__((visibility("default"))) ret VS_CC
58 #else
59 # define VS_EXTERNAL_API(ret) VS_EXTERN_C ret VS_CC
60 #endif
61
62 #if !defined(VS_CORE_EXPORTS) && defined(_WIN32)
63 # define VS_API(ret) VS_EXTERN_C __declspec(dllimport) ret VS_CC
64 #else
65 # define VS_API(ret) VS_EXTERNAL_API(ret)
66 #endif
67
68 typedef struct VSFrame VSFrame;
69 typedef struct VSNode VSNode;
70 typedef struct VSCore VSCore;
71 typedef struct VSPlugin VSPlugin;
72 typedef struct VSPluginFunction VSPluginFunction;
73 typedef struct VSFunction VSFunction;
74 typedef struct VSMap VSMap;
75 typedef struct VSLogHandle VSLogHandle;
76 typedef struct VSFrameContext VSFrameContext;
77 typedef struct VSPLUGINAPI VSPLUGINAPI;
78 typedef struct VSAPI VSAPI;
79
80 typedef enum VSColorFamily {
81 cfUndefined = 0,
82 cfGray = 1,
83 cfRGB = 2,
84 cfYUV = 3
85 } VSColorFamily;
86
87 typedef enum VSSampleType {
88 stInteger = 0,
89 stFloat = 1
90 } VSSampleType;
91
92 #define VS_MAKE_VIDEO_ID(colorFamily, sampleType, bitsPerSample, subSamplingW, subSamplingH) ((colorFamily << 28) | (sampleType << 24) | (bitsPerSample << 16) | (subSamplingW << 8) | (subSamplingH << 0))
93
94 typedef enum VSPresetFormat {
95 pfNone = 0,
96
97 pfGray8 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 8, 0, 0),
98 pfGray16 = VS_MAKE_VIDEO_ID(cfGray, stInteger, 16, 0, 0),
99
100 pfGrayH = VS_MAKE_VIDEO_ID(cfGray, stFloat, 16, 0, 0),
101 pfGrayS = VS_MAKE_VIDEO_ID(cfGray, stFloat, 32, 0, 0),
102
103 pfYUV410P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 2, 2),
104 pfYUV411P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 2, 0),
105 pfYUV440P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 0, 1),
106
107 pfYUV420P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 1, 1),
108 pfYUV422P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 1, 0),
109 pfYUV444P8 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 8, 0, 0),
110
111 pfYUV420P10 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 10, 1, 1),
112 pfYUV422P10 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 10, 1, 0),
113 pfYUV444P10 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 10, 0, 0),
114
115 pfYUV420P12 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 12, 1, 1),
116 pfYUV422P12 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 12, 1, 0),
117 pfYUV444P12 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 12, 0, 0),
118
119 pfYUV420P14 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 14, 1, 1),
120 pfYUV422P14 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 14, 1, 0),
121 pfYUV444P14 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 14, 0, 0),
122
123 pfYUV420P16 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 16, 1, 1),
124 pfYUV422P16 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 16, 1, 0),
125 pfYUV444P16 = VS_MAKE_VIDEO_ID(cfYUV, stInteger, 16, 0, 0),
126
127 pfYUV444PH = VS_MAKE_VIDEO_ID(cfYUV, stFloat, 16, 0, 0),
128 pfYUV444PS = VS_MAKE_VIDEO_ID(cfYUV, stFloat, 32, 0, 0),
129
130 pfRGB24 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 8, 0, 0),
131 pfRGB30 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 10, 0, 0),
132 pfRGB36 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 12, 0, 0),
133 pfRGB42 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 14, 0, 0),
134 pfRGB48 = VS_MAKE_VIDEO_ID(cfRGB, stInteger, 16, 0, 0),
135
136 pfRGBH = VS_MAKE_VIDEO_ID(cfRGB, stFloat, 16, 0, 0),
137 pfRGBS = VS_MAKE_VIDEO_ID(cfRGB, stFloat, 32, 0, 0),
138 } VSPresetFormat;
139
140 #undef VS_MAKE_VIDEO_ID
141
142
143 typedef enum VSFilterMode {
144 fmParallel = 0, /* completely parallel execution */
145 fmParallelRequests = 1, /* for filters that are serial in nature but can request one or more frames they need in advance */
146 fmUnordered = 2, /* for filters that modify their internal state every request like source filters that read a file */
147 fmFrameState = 3 /* DO NOT USE UNLESS ABSOLUTELY NECESSARY, for compatibility with external code that can only keep the processing state of a single frame at a time */
148 } VSFilterMode;
149
150 typedef enum VSMediaType {
151 mtVideo = 1,
152 mtAudio = 2
153 } VSMediaType;
154
155 typedef struct VSVideoFormat {
156 int colorFamily; /* see VSColorFamily */
157 int sampleType; /* see VSSampleType */
158 int bitsPerSample; /* number of significant bits */
159 int bytesPerSample; /* actual storage is always in a power of 2 and the smallest possible that can fit the number of bits used per sample */
160
161 int subSamplingW; /* log2 subsampling factor, applied to second and third plane */
162 int subSamplingH; /* log2 subsampling factor, applied to second and third plane */
163
164 int numPlanes; /* implicit from colorFamily */
165 } VSVideoFormat;
166
167 typedef enum VSAudioChannels {
168 acFrontLeft = 0,
169 acFrontRight = 1,
170 acFrontCenter = 2,
171 acLowFrequency = 3,
172 acBackLeft = 4,
173 acBackRight = 5,
174 acFrontLeftOFCenter = 6,
175 acFrontRightOFCenter = 7,
176 acBackCenter = 8,
177 acSideLeft = 9,
178 acSideRight = 10,
179 acTopCenter = 11,
180 acTopFrontLeft = 12,
181 acTopFrontCenter = 13,
182 acTopFrontRight = 14,
183 acTopBackLeft = 15,
184 acTopBackCenter = 16,
185 acTopBackRight = 17,
186 acStereoLeft = 29,
187 acStereoRight = 30,
188 acWideLeft = 31,
189 acWideRight = 32,
190 acSurroundDirectLeft = 33,
191 acSurroundDirectRight = 34,
192 acLowFrequency2 = 35
193 } VSAudioChannels;
194
195 typedef struct VSAudioFormat {
196 int sampleType;
197 int bitsPerSample;
198 int bytesPerSample; /* implicit from bitsPerSample */
199 int numChannels; /* implicit from channelLayout */
200 uint64_t channelLayout;
201 } VSAudioFormat;
202
203 typedef enum VSFilterFlags {
204 ffStrictSpatial = 1
205 } VSFilterFlags;
206
207 typedef enum VSPropertyType {
208 ptUnset = 0,
209 ptInt = 1,
210 ptFloat = 2,
211 ptData = 3,
212 ptFunction = 4,
213 ptVideoNode = 5,
214 ptAudioNode = 6,
215 ptVideoFrame = 7,
216 ptAudioFrame = 8
217 } VSPropertyType;
218
219 typedef enum VSMapPropertyError {
220 peSuccess = 0,
221 peUnset = 1, /* no key exists */
222 peType = 2, /* key exists but not of a compatible type */
223 peIndex = 4, /* index out of bounds */
224 peError = 3 /* map has error state set */
225 } VSMapPropertyError;
226
227 typedef enum VSMapAppendMode {
228 maReplace = 0,
229 maAppend = 1
230 } VSMapAppendMode;
231
232 typedef struct VSCoreInfo {
233 const char *versionString;
234 int core;
235 int api;
236 int numThreads;
237 int64_t maxFramebufferSize;
238 int64_t usedFramebufferSize;
239 } VSCoreInfo;
240
241 typedef struct VSVideoInfo {
242 VSVideoFormat format;
243 int64_t fpsNum;
244 int64_t fpsDen;
245 int width;
246 int height;
247 int numFrames;
248 } VSVideoInfo;
249
250 typedef struct VSAudioInfo {
251 VSAudioFormat format;
252 int sampleRate;
253 int64_t numSamples;
254 int numFrames; /* the total number of audio frames needed to hold numSamples, implicit from numSamples when calling createAudioFilter */
255 } VSAudioInfo;
256
257 typedef enum VSActivationReason {
258 arInitial = 0,
259 arAllFramesReady = 1,
260 arError = -1
261 } VSActivationReason;
262
263 typedef enum VSMessageType {
264 mtDebug = 0,
265 mtInformation = 1,
266 mtWarning = 2,
267 mtCritical = 3,
268 mtFatal = 4 /* also terminates the process, should generally not be used by normal filters */
269 } VSMessageType;
270
271 typedef enum VSCoreCreationFlags {
272 ccfEnableGraphInspection = 1,
273 ccfDisableAutoLoading = 2,
274 ccfDisableLibraryUnloading = 4
275 } VSCoreCreationFlags;
276
277 typedef enum VSPluginConfigFlags {
278 pcModifiable = 1
279 } VSPluginConfigFlags;
280
281 typedef enum VSDataTypeHint {
282 dtUnknown = -1,
283 dtBinary = 0,
284 dtUtf8 = 1
285 } VSDataTypeHint;
286
287 typedef enum VSRequestPattern {
288 rpGeneral = 0, /* General pattern */
289 rpNoFrameReuse = 1, /* When requesting all output frames from the filter no frame will be requested more than once from this input clip, never requests frames beyond the end of the clip */
290 rpStrictSpatial = 2 /* Always (and only) requests frame n from input clip when generating output frame n, never requests frames beyond the end of the clip */
291 } VSRequestPattern;
292
293 /* Core entry point */
294 typedef const VSAPI *(VS_CC *VSGetVapourSynthAPI)(int version);
295
296 /* Plugin, function and filter related */
297 typedef void (VS_CC *VSPublicFunction)(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi);
298 typedef void (VS_CC *VSInitPlugin)(VSPlugin *plugin, const VSPLUGINAPI *vspapi);
299 typedef void (VS_CC *VSFreeFunctionData)(void *userData);
300 typedef const VSFrame *(VS_CC *VSFilterGetFrame)(int n, int activationReason, void *instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi);
301 typedef void (VS_CC *VSFilterFree)(void *instanceData, VSCore *core, const VSAPI *vsapi);
302
303 /* Other */
304 typedef void (VS_CC *VSFrameDoneCallback)(void *userData, const VSFrame *f, int n, VSNode *node, const char *errorMsg);
305 typedef void (VS_CC *VSLogHandler)(int msgType, const char *msg, void *userData);
306 typedef void (VS_CC *VSLogHandlerFree)(void *userData);
307
308 struct VSPLUGINAPI {
309 int (VS_CC *getAPIVersion)(void) VS_NOEXCEPT; /* returns VAPOURSYNTH_API_VERSION of the library */
310 int (VS_CC *configPlugin)(const char *identifier, const char *pluginNamespace, const char *name, int pluginVersion, int apiVersion, int flags, VSPlugin *plugin) VS_NOEXCEPT; /* use the VS_MAKE_VERSION macro for pluginVersion */
311 int (VS_CC *registerFunction)(const char *name, const char *args, const char *returnType, VSPublicFunction argsFunc, void *functionData, VSPlugin *plugin) VS_NOEXCEPT; /* non-zero return value on success */
312 };
313
314 typedef struct VSFilterDependency {
315 VSNode *source;
316 int requestPattern; /* VSRequestPattern */
317 } VSFilterDependency;
318
319 struct VSAPI {
320 /* Audio and video filter related including nodes */
321 void (VS_CC *createVideoFilter)(VSMap *out, const char *name, const VSVideoInfo *vi, VSFilterGetFrame getFrame, VSFilterFree free, int filterMode, const VSFilterDependency *dependencies, int numDeps, void *instanceData, VSCore *core) VS_NOEXCEPT; /* output nodes are appended to the clip key in the out map */
322 VSNode *(VS_CC *createVideoFilter2)(const char *name, const VSVideoInfo *vi, VSFilterGetFrame getFrame, VSFilterFree free, int filterMode, const VSFilterDependency *dependencies, int numDeps, void *instanceData, VSCore *core) VS_NOEXCEPT; /* same as createVideoFilter but returns a pointer to the VSNode directly or NULL on failure */
323 void (VS_CC *createAudioFilter)(VSMap *out, const char *name, const VSAudioInfo *ai, VSFilterGetFrame getFrame, VSFilterFree free, int filterMode, const VSFilterDependency *dependencies, int numDeps, void *instanceData, VSCore *core) VS_NOEXCEPT; /* output nodes are appended to the clip key in the out map */
324 VSNode *(VS_CC *createAudioFilter2)(const char *name, const VSAudioInfo *ai, VSFilterGetFrame getFrame, VSFilterFree free, int filterMode, const VSFilterDependency *dependencies, int numDeps, void *instanceData, VSCore *core) VS_NOEXCEPT; /* same as createAudioFilter but returns a pointer to the VSNode directly or NULL on failure */
325 int (VS_CC *setLinearFilter)(VSNode *node) VS_NOEXCEPT; /* Use right after create*Filter*, sets the correct cache mode for using the cacheFrame API and returns the recommended upper number of additional frames to cache per request */
326 void (VS_CC *setCacheMode)(VSNode *node, int mode) VS_NOEXCEPT; /* -1: default (auto), 0: force disable, 1: force enable, changing the cache mode also resets all options to their default */
327 void (VS_CC *setCacheOptions)(VSNode *node, int fixedSize, int maxSize, int maxHistorySize) VS_NOEXCEPT; /* passing -1 means no change */
328
329 void (VS_CC *freeNode)(VSNode *node) VS_NOEXCEPT;
330 VSNode *(VS_CC *addNodeRef)(VSNode *node) VS_NOEXCEPT;
331 int (VS_CC *getNodeType)(VSNode *node) VS_NOEXCEPT; /* returns VSMediaType */
332 const VSVideoInfo *(VS_CC *getVideoInfo)(VSNode *node) VS_NOEXCEPT;
333 const VSAudioInfo *(VS_CC *getAudioInfo)(VSNode *node) VS_NOEXCEPT;
334
335 /* Frame related functions */
336 VSFrame *(VS_CC *newVideoFrame)(const VSVideoFormat *format, int width, int height, const VSFrame *propSrc, VSCore *core) VS_NOEXCEPT;
337 VSFrame *(VS_CC *newVideoFrame2)(const VSVideoFormat *format, int width, int height, const VSFrame **planeSrc, const int *planes, const VSFrame *propSrc, VSCore *core) VS_NOEXCEPT; /* same as newVideoFrame but allows the specified planes to be effectively copied from the source frames */
338 VSFrame *(VS_CC *newAudioFrame)(const VSAudioFormat *format, int numSamples, const VSFrame *propSrc, VSCore *core) VS_NOEXCEPT;
339 VSFrame *(VS_CC *newAudioFrame2)(const VSAudioFormat *format, int numSamples, const VSFrame **channelSrc, const int *channels, const VSFrame *propSrc, VSCore *core) VS_NOEXCEPT; /* same as newAudioFrame but allows the specified channels to be effectively copied from the source frames */
340 void (VS_CC *freeFrame)(const VSFrame *f) VS_NOEXCEPT;
341 const VSFrame *(VS_CC *addFrameRef)(const VSFrame *f) VS_NOEXCEPT;
342 VSFrame *(VS_CC *copyFrame)(const VSFrame *f, VSCore *core) VS_NOEXCEPT;
343 const VSMap *(VS_CC *getFramePropertiesRO)(const VSFrame *f) VS_NOEXCEPT;
344 VSMap *(VS_CC *getFramePropertiesRW)(VSFrame *f) VS_NOEXCEPT;
345
346 ptrdiff_t (VS_CC *getStride)(const VSFrame *f, int plane) VS_NOEXCEPT;
347 const uint8_t *(VS_CC *getReadPtr)(const VSFrame *f, int plane) VS_NOEXCEPT;
348 uint8_t *(VS_CC *getWritePtr)(VSFrame *f, int plane) VS_NOEXCEPT; /* calling this function invalidates previously gotten read pointers to the same frame */
349
350 const VSVideoFormat *(VS_CC *getVideoFrameFormat)(const VSFrame *f) VS_NOEXCEPT;
351 const VSAudioFormat *(VS_CC *getAudioFrameFormat)(const VSFrame *f) VS_NOEXCEPT;
352 int (VS_CC *getFrameType)(const VSFrame *f) VS_NOEXCEPT; /* returns VSMediaType */
353 int (VS_CC *getFrameWidth)(const VSFrame *f, int plane) VS_NOEXCEPT;
354 int (VS_CC *getFrameHeight)(const VSFrame *f, int plane) VS_NOEXCEPT;
355 int (VS_CC *getFrameLength)(const VSFrame *f) VS_NOEXCEPT; /* returns the number of samples for audio frames */
356
357 /* General format functions */
358 int (VS_CC *getVideoFormatName)(const VSVideoFormat *format, char *buffer) VS_NOEXCEPT; /* up to 32 characters including terminating null may be written to the buffer, non-zero return value on success */
359 int (VS_CC *getAudioFormatName)(const VSAudioFormat *format, char *buffer) VS_NOEXCEPT; /* up to 32 characters including terminating null may be written to the buffer, non-zero return value on success */
360 int (VS_CC *queryVideoFormat)(VSVideoFormat *format, int colorFamily, int sampleType, int bitsPerSample, int subSamplingW, int subSamplingH, VSCore *core) VS_NOEXCEPT; /* non-zero return value on success */
361 int (VS_CC *queryAudioFormat)(VSAudioFormat *format, int sampleType, int bitsPerSample, uint64_t channelLayout, VSCore *core) VS_NOEXCEPT; /* non-zero return value on success */
362 uint32_t (VS_CC *queryVideoFormatID)(int colorFamily, int sampleType, int bitsPerSample, int subSamplingW, int subSamplingH, VSCore *core) VS_NOEXCEPT; /* returns 0 on failure */
363 int (VS_CC *getVideoFormatByID)(VSVideoFormat *format, uint32_t id, VSCore *core) VS_NOEXCEPT; /* non-zero return value on success */
364
365 /* Frame request and filter getframe functions */
366 const VSFrame *(VS_CC *getFrame)(int n, VSNode *node, char *errorMsg, int bufSize) VS_NOEXCEPT; /* only for external applications using the core as a library or for requesting frames in a filter constructor, do not use inside a filter's getframe function */
367 void (VS_CC *getFrameAsync)(int n, VSNode *node, VSFrameDoneCallback callback, void *userData) VS_NOEXCEPT; /* only for external applications using the core as a library or for requesting frames in a filter constructor, do not use inside a filter's getframe function */
368 const VSFrame *(VS_CC *getFrameFilter)(int n, VSNode *node, VSFrameContext *frameCtx) VS_NOEXCEPT; /* only use inside a filter's getframe function */
369 void (VS_CC *requestFrameFilter)(int n, VSNode *node, VSFrameContext *frameCtx) VS_NOEXCEPT; /* only use inside a filter's getframe function */
370 void (VS_CC *releaseFrameEarly)(VSNode *node, int n, VSFrameContext *frameCtx) VS_NOEXCEPT; /* only use inside a filter's getframe function, unless this function is called a requested frame is kept in memory until the end of processing the current frame */
371 void (VS_CC *cacheFrame)(const VSFrame *frame, int n, VSFrameContext *frameCtx) VS_NOEXCEPT; /* used to store intermediate frames in cache, useful for filters where random access is slow, must call setLinearFilter on the node before using or the result is undefined */
372 void (VS_CC *setFilterError)(const char *errorMessage, VSFrameContext *frameCtx) VS_NOEXCEPT; /* used to signal errors in the filter getframe function */
373
374 /* External functions */
375 VSFunction *(VS_CC *createFunction)(VSPublicFunction func, void *userData, VSFreeFunctionData free, VSCore *core) VS_NOEXCEPT;
376 void (VS_CC *freeFunction)(VSFunction *f) VS_NOEXCEPT;
377 VSFunction *(VS_CC *addFunctionRef)(VSFunction *f) VS_NOEXCEPT;
378 void (VS_CC *callFunction)(VSFunction *func, const VSMap *in, VSMap *out) VS_NOEXCEPT;
379
380 /* Map and property access functions */
381 VSMap *(VS_CC *createMap)(void) VS_NOEXCEPT;
382 void (VS_CC *freeMap)(VSMap *map) VS_NOEXCEPT;
383 void (VS_CC *clearMap)(VSMap *map) VS_NOEXCEPT;
384 void (VS_CC *copyMap)(const VSMap *src, VSMap *dst) VS_NOEXCEPT; /* copies all values in src to dst, if a key already exists in dst it's replaced */
385
386 void (VS_CC *mapSetError)(VSMap *map, const char *errorMessage) VS_NOEXCEPT; /* used to signal errors outside filter getframe function */
387 const char *(VS_CC *mapGetError)(const VSMap *map) VS_NOEXCEPT; /* used to query errors, returns 0 if no error */
388
389 int (VS_CC *mapNumKeys)(const VSMap *map) VS_NOEXCEPT;
390 const char *(VS_CC *mapGetKey)(const VSMap *map, int index) VS_NOEXCEPT;
391 int (VS_CC *mapDeleteKey)(VSMap *map, const char *key) VS_NOEXCEPT;
392 int (VS_CC *mapNumElements)(const VSMap *map, const char *key) VS_NOEXCEPT; /* returns -1 if a key doesn't exist */
393 int (VS_CC *mapGetType)(const VSMap *map, const char *key) VS_NOEXCEPT; /* returns VSPropertyType */
394 int (VS_CC *mapSetEmpty)(VSMap *map, const char *key, int type) VS_NOEXCEPT;
395
396 int64_t (VS_CC *mapGetInt)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
397 int (VS_CC *mapGetIntSaturated)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
398 const int64_t *(VS_CC *mapGetIntArray)(const VSMap *map, const char *key, int *error) VS_NOEXCEPT;
399 int (VS_CC *mapSetInt)(VSMap *map, const char *key, int64_t i, int append) VS_NOEXCEPT;
400 int (VS_CC *mapSetIntArray)(VSMap *map, const char *key, const int64_t *i, int size) VS_NOEXCEPT;
401
402 double (VS_CC *mapGetFloat)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
403 float (VS_CC *mapGetFloatSaturated)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
404 const double *(VS_CC *mapGetFloatArray)(const VSMap *map, const char *key, int *error) VS_NOEXCEPT;
405 int (VS_CC *mapSetFloat)(VSMap *map, const char *key, double d, int append) VS_NOEXCEPT;
406 int (VS_CC *mapSetFloatArray)(VSMap *map, const char *key, const double *d, int size) VS_NOEXCEPT;
407
408 const char *(VS_CC *mapGetData)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
409 int (VS_CC *mapGetDataSize)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
410 int (VS_CC *mapGetDataTypeHint)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT; /* returns VSDataTypeHint */
411 int (VS_CC *mapSetData)(VSMap *map, const char *key, const char *data, int size, int type, int append) VS_NOEXCEPT;
412
413 VSNode *(VS_CC *mapGetNode)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
414 int (VS_CC *mapSetNode)(VSMap *map, const char *key, VSNode *node, int append) VS_NOEXCEPT; /* returns 0 on success */
415 int (VS_CC *mapConsumeNode)(VSMap *map, const char *key, VSNode *node, int append) VS_NOEXCEPT; /* always consumes the reference, even on error */
416
417 const VSFrame *(VS_CC *mapGetFrame)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
418 int (VS_CC *mapSetFrame)(VSMap *map, const char *key, const VSFrame *f, int append) VS_NOEXCEPT; /* returns 0 on success */
419 int (VS_CC *mapConsumeFrame)(VSMap *map, const char *key, const VSFrame *f, int append) VS_NOEXCEPT; /* always consumes the reference, even on error */
420
421 VSFunction *(VS_CC *mapGetFunction)(const VSMap *map, const char *key, int index, int *error) VS_NOEXCEPT;
422 int (VS_CC *mapSetFunction)(VSMap *map, const char *key, VSFunction *func, int append) VS_NOEXCEPT; /* returns 0 on success */
423 int (VS_CC *mapConsumeFunction)(VSMap *map, const char *key, VSFunction *func, int append) VS_NOEXCEPT; /* always consumes the reference, even on error */
424
425 /* Plugin and plugin function related */
426 int (VS_CC *registerFunction)(const char *name, const char *args, const char *returnType, VSPublicFunction argsFunc, void *functionData, VSPlugin *plugin) VS_NOEXCEPT; /* non-zero return value on success */
427 VSPlugin *(VS_CC *getPluginByID)(const char *identifier, VSCore *core) VS_NOEXCEPT;
428 VSPlugin *(VS_CC *getPluginByNamespace)(const char *ns, VSCore *core) VS_NOEXCEPT;
429 VSPlugin *(VS_CC *getNextPlugin)(VSPlugin *plugin, VSCore *core) VS_NOEXCEPT; /* pass NULL to get the first plugin */
430 const char *(VS_CC *getPluginName)(VSPlugin *plugin) VS_NOEXCEPT;
431 const char *(VS_CC *getPluginID)(VSPlugin *plugin) VS_NOEXCEPT;
432 const char *(VS_CC *getPluginNamespace)(VSPlugin *plugin) VS_NOEXCEPT;
433 VSPluginFunction *(VS_CC *getNextPluginFunction)(VSPluginFunction *func, VSPlugin *plugin) VS_NOEXCEPT; /* pass NULL to get the first plugin function */
434 VSPluginFunction *(VS_CC *getPluginFunctionByName)(const char *name, VSPlugin *plugin) VS_NOEXCEPT;
435 const char *(VS_CC *getPluginFunctionName)(VSPluginFunction *func) VS_NOEXCEPT;
436 const char *(VS_CC *getPluginFunctionArguments)(VSPluginFunction *func) VS_NOEXCEPT; /* returns an argument format string */
437 const char *(VS_CC *getPluginFunctionReturnType)(VSPluginFunction *func) VS_NOEXCEPT; /* returns an argument format string */
438 const char *(VS_CC *getPluginPath)(const VSPlugin *plugin) VS_NOEXCEPT; /* the full path to the loaded library file containing the plugin entry point */
439 int (VS_CC *getPluginVersion)(const VSPlugin *plugin) VS_NOEXCEPT;
440 VSMap *(VS_CC *invoke)(VSPlugin *plugin, const char *name, const VSMap *args) VS_NOEXCEPT; /* user must free the returned VSMap */
441
442 /* Core and information */
443 VSCore *(VS_CC *createCore)(int flags) VS_NOEXCEPT; /* flags uses the VSCoreFlags enum */
444 void (VS_CC *freeCore)(VSCore *core) VS_NOEXCEPT; /* only call this function after all node, frame and function references belonging to the core have been freed */
445 int64_t(VS_CC *setMaxCacheSize)(int64_t bytes, VSCore *core) VS_NOEXCEPT; /* the total cache size at which vapoursynth more aggressively tries to reclaim memory, it is not a hard limit */
446 int (VS_CC *setThreadCount)(int threads, VSCore *core) VS_NOEXCEPT; /* setting threads to 0 means automatic detection */
447 void (VS_CC *getCoreInfo)(VSCore *core, VSCoreInfo *info) VS_NOEXCEPT;
448 int (VS_CC *getAPIVersion)(void) VS_NOEXCEPT;
449
450 /* Message handler */
451 void (VS_CC *logMessage)(int msgType, const char *msg, VSCore *core) VS_NOEXCEPT;
452 VSLogHandle *(VS_CC *addLogHandler)(VSLogHandler handler, VSLogHandlerFree free, void *userData, VSCore *core) VS_NOEXCEPT; /* free and userData can be NULL, returns a handle that can be passed to removeLogHandler */
453 int (VS_CC *removeLogHandler)(VSLogHandle *handle, VSCore *core) VS_NOEXCEPT; /* returns non-zero if successfully removed */
454
455 /* Graph information */
456
457 /*
458 * NOT PART OF THE STABLE API!
459 * These functions only exist to retrieve internal details for debug purposes and graph visualization
460 * They will only only work properly when used on a core created with cfEnableGraphInspection and are
461 * not safe to use concurrently with frame requests or other API functions
462 * NOT PART OF THE STABLE API!
463 */
464
465 const char *(VS_CC *getNodeCreationFunctionName)(VSNode *node, int level) VS_NOEXCEPT; /* level=0 returns the name of the function that created the filter, specifying a higher level will retrieve the function above that invoked it or NULL if a non-existent level is requested */
466 const VSMap *(VS_CC *getNodeCreationFunctionArguments)(VSNode *node, int level) VS_NOEXCEPT; /* level=0 returns a copy of the arguments passed to the function that created the filter, returns NULL if a non-existent level is requested */
467 const char *(VS_CC *getNodeName)(VSNode *node) VS_NOEXCEPT; /* the name passed to create*Filter */
468 int (VS_CC *getNodeFilterMode)(VSNode *node) VS_NOEXCEPT; /* VSFilterMode */
469 int64_t (VS_CC *getNodeFilterTime)(VSNode *node) VS_NOEXCEPT; /* time spent processing frames in nanoseconds */
470 const VSFilterDependency *(VS_CC *getNodeDependencies)(VSNode *node) VS_NOEXCEPT;
471 int (VS_CC *getNumNodeDependencies)(VSNode *node) VS_NOEXCEPT;
472 };
473
474 VS_API(const VSAPI *) getVapourSynthAPI(int version) VS_NOEXCEPT;
475
476 #endif /* VAPOURSYNTH4_H */