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. |
|
|
Thread Tools | Search this Thread | Display Modes |
14th August 2020, 23:21 | #181 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Thanks to you both! I'm gonna try it out and see whether it does what it's supposed to do with my source which definitely would have benefited from an hardware time base correction (but the tape is on another site 500 km away and it's not exactly the time to... uh... travel... you know...).
|
15th August 2020, 20:29 | #183 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Yep, Sendspace only keeps them for 30 days after latest download. [ what a silly billy ]
RD, did you update this on Wiki: http://avisynth.nl/index.php/Filter_SDK/Env_SaveString Thats a pretty awful example of env->SaveString() use, eg Code:
Filter SDK/Env SaveString env->SaveString is given to allow users to pass strings to AVSValue, and ensure that they are being deallocated on unload. An Example: fnpluginnew = new char[string_len]; strcpy(fnpluginnew, fnplugin.AsString()); strcat(fnpluginnew, " "); strcat(fnpluginnew, name); env->SetGlobalVar("$PluginFunctions$", AVSValue(env->SaveString(fnpluginnew, string_len))); // Since fnpluginnew has now been saved it can safely be deleted. delete[] fnpluginnew; I think previous example was taken from one of my posts in dev forum, way better [but I'm probably biased a bit]. I'll find it if you want. EDIT: Here:- https://forum.doom9.org/showthread.p...36#post1633936 Quote:
Avisynth and your plugin both have their own heap memory [new/malloc] and when you return a string allocated on your plugin heap, you MUST hand over a string copy to avisynth, you must make a copy on avisynth heap (using avisynth's env->SaveString()) and give it the copy, this gives avisynth full control over the string memory and also the responsibility to delete the memory when avisynth closes down. After you make a string copy for avisynth, you can then delete/free your temp string memory buffer. It is not necessary to use SaveString() on a string literal, "String literals are read only and at constant address and so need not be saved". Set a Global var named MyGlobalString="Some GlobalVar Text" (actually does not need to use SaveString as "Some GlobalVar Text" is a String Literal). Code:
env->SetGlobalVar("MyGlobalString", AVSValue(env->SaveString("Some GlobalVar Text"))); // Set Global [SaveString will use strlen() to establish length of string] ... env->SetVar("MyLocalString", AVSValue(env->SaveString("Some LocalVar Text"))); // Set Local [SaveString will use strlen() to establish length of string] similarly have to use env->SaveString() to make copies of them, and give the copies as the names to SetGlobalVar() and SetVar() functions. Set Global variable MyPi=3.1415926 [again, below MyPiName is a pointer to "MyPi" string literal (text wrapped in double quotes) and does not need env->SaveString, is just for illustration purposes] Code:
char *MyPiName = "MyPi"; float pi=3.1415926f; env->SetGlobalVar(env->SaveString(MyPiName), AVSValue(pi)); ... env->SetGlobalVar(env->SaveString(MyPiName), pi); // Implicit type conversion of float pi to an AVSValue
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 16th August 2020 at 15:28. |
|
Tags |
tbc |
Thread Tools | Search this Thread |
Display Modes | |
|
|