PDA

View Full Version : Plugin Function


Daichi
2nd June 2007, 02:49
Is it possible to write a dll that returns a value like a boolean or string to Avisynth? If so, can someone point me in the right direction.

All the examples I've seen seem to deal with video directly.

ChiDragon
2nd June 2007, 05:01
You can return values like that to the conditional environment; TIVTC's FrameDiff::ConditionalFrameDiff is an example of that.

I believe you can also create global variables within your plugin as side effects, but that isn't really returning the value as you say.

gzarkadas
2nd June 2007, 06:42
All plugin functions return an AVSValue. AVSValue is a union-like class that can contain either a clip or any other type supported by Avisynth (int, float, bool, string). The only trick is that for strings (ie char* in C/C++) you should use env->SaveString to store a copy of your local char buffer and supply its return value to AVSValue constructor.

For more information see the online Filter SDK (http://avisynth.org/mediawiki/Filter_SDK) and also the contents of the "avisynth.h" header file.