Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th June 2015, 07:57   #1  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 733
help coding transition plugin

Trying to code a transition. Input are 2 clips output 1 clip.
in init section do I create a new node as output using
typedef VSNodeRef *(VS_CC *VSCloneNodeRef)(VSNodeRef *node);
and
d.vi = vsapi->getVideoInfo(d.node);
use
vsapi->setVideoInfo(d->vi, 1, node);

Will I not get a constant vi pointer that prevents me in modifying a value in vi?
Request help with a small example code or a reference to a code in the vapoursynth in Gthub!
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 26th June 2015, 11:24   #2  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 723
Summary:
Code:
struct FilterData {
    VSVideoInfo vi; // not a pointer
    // ...
};

filterInit() {
    vsapi->setVideoInfo(&d->vi, 1, node); // take its address
}

filterCreate() {
    d.vi = *vsapi->getVideoInfo(node); // dereference to get a copy
    d.vi.numFrames += 42;
}
Real code: https://github.com/vapoursynth/vapou...rfilters.c#L75

Also, createFilter() creates the output node for you. Calling cloneNodeRef() is not necessary.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 26th June 2015, 13:44   #3  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 733
thanks for helping.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.