Thread: Vapoursynth
View Single Post
Old 11th February 2021, 07:32   #4289  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by lansing View Post
Thanks, I'll work on it.
I have created a dummy filter and passed in a list from the script to the filter, but I couldn't figure out the right syntax to retrieve it in C.

script
Code:
core.vsedit.Logger(["message 1", "message 2"])
dummy.c
Code:
static void VS_CC logger(VSMap* in, VSMap* out, void *userData, VSCore* core, const VSAPI* vsapi) {
    char messages[] = vsapi->propGetData(in, "name", 0, NULL);

    int i = 0;
    while (messages[i]) {
        vsapi->logMessage("WARNING", messages[i]);        
        i++;
    }
}

VS_EXTERNAL_API(void) VapourSynthPluginInit(VSConfigPlugin configFunc, VSRegisterFunction registerFunc, VSPlugin* plugin) {
    configFunc("com.vsedit.logger", "vsedit", "VapourSynth Logger", VAPOURSYNTH_API_VERSION, 1, plugin);
    registerFunc("Logger", "name:data[]", &logger, 0, plugin);
}
I couldn't get this to compile.
lansing is offline   Reply With Quote