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. |
28th May 2016, 15:13 | #10 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
From what I understand,
MT_NICE_FILTER means there is one class instance and GetFrame gets called several times at once from various threads on the same class. When Pinterf went through my code, he wrote "Say no to globalism!" No global variables unless they are read-only. All working buffers must be created within GetFrame. MT_MULTI_INSTANCE means that one instance of the class gets created for each thread and each instance is single-threaded. One thread may process frames 1, 4, 7 and 9 while other threads process other frames. I'm not yet sure what impact MT_SERIALIZED has on the code. The way to define it is in the Init function Code:
extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit3(IScriptEnvironment* env, const AVS_Linkage* const vectors) { AVS_linkage = vectors; env->AddFunction("ConvertToShader", "c[Precision]i[lsb]b", Create_ConvertToShader, 0); env->AddFunction("ConvertFromShader", "c[Precision]i[Format]s[lsb]b", Create_ConvertFromShader, 0); env->AddFunction("Shader", "c[Path]s[EntryPoint]s[ShaderModel]s[Param0]s[Param1]s[Param2]s[Param3]s[Param4]s[Param5]s[Param6]s[Param7]s[Param8]s[Clip1]i[Clip2]i[Clip3]i[Clip4]i[Clip5]i[Clip6]i[Clip7]i[Clip8]i[Clip9]i[Output]i[Width]i[Height]i", Create_Shader, 0); env->AddFunction("ExecuteShader", "c[Clip1]c[Clip2]c[Clip3]c[Clip4]c[Clip5]c[Clip6]c[Clip7]c[Clip8]c[Clip9]c[Clip1Precision]i[Clip2Precision]i[Clip3Precision]i[Clip4Precision]i[Clip5Precision]i[Clip6Precision]i[Clip7Precision]i[Clip8Precision]i[Clip9Precision]i[Precision]i[OutputPrecision]i", Create_ExecuteShader, 0); void* is_plus = env->FunctionExists("SetFilterMTMode") ? "true" : nullptr; if (is_plus != nullptr) { auto env2 = static_cast<IScriptEnvironment2*>(env); env2->SetFilterMTMode("ConvertToShader", MT_NICE_FILTER, true); env2->SetFilterMTMode("ConvertFromShader", MT_NICE_FILTER, true); env2->SetFilterMTMode("Shader", MT_NICE_FILTER, true); env2->SetFilterMTMode("ExecuteShader", MT_MULTI_INSTANCE, true); } return "Shader plugin"; } |
Thread Tools | Search this Thread |
Display Modes | |
|
|