Einzelnen Beitrag anzeigen

Benutzerbild von Garfield
Garfield

Registriert seit: 9. Jul 2004
Ort: Aken (Anhalt-Bitterfeld)
1.334 Beiträge
 
Delphi XE5 Professional
 
#3

AW: Avisynth 2,5/2,6 Plugin

  Alt 28. Sep 2014, 08:02
Wenn ich das richtig lese, schlägt die Initialisierung fehl.

In dem Beispiel wird so initialisiert:
Code:
// This is the function that created the filter, when the filter has been called.
// This can be used for simple parameter checking, so it is possible to create different filters,
// based on the arguments recieved.

AVSValue __cdecl Create_SimpleSample(AVSValue args, void* user_data, IScriptEnvironment* env) {
    return new SimpleSample(args[0].AsClip(),env);
    // Calls the constructor with the arguments provied.
}


// The following function is the function that actually registers the filter in AviSynth
// It is called automatically, when the plugin is loaded to see which functions this filter contains.

extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env) {
    env->AddFunction("SimpleSample", "c", Create_SimpleSample, 0);
    // The AddFunction has the following paramters:
    // AddFunction(Filtername , Arguments, Function to call,0);

    // Arguments is a string that defines the types and optional names of the arguments for you filter.
    // c - Video Clip
    // i - Integer number
    // f - Float number
    // s - String
    // b - boolean

    return "`SimpleSample' SimpleSample plugin";
    // A freeform name of the plugin.
}
In meinem Delphiprojekt:
Delphi-Quellcode:
function avisynth_c_plugin_init(env: PAVS_ScriptEnvironment): PChar; stdcall;
begin
  avs_add_function(env, 'avsBasic', avsBasic.AviSynthDescription, @create_avsBasic, nil);

  Result := 'avsBasic';
end;

exports
  avisynth_c_plugin_init;
end.
Delphi-Quellcode:
const
  AviSynthDescription = '[src]c';

function create_avsBasic(args: MSVC_AVS_Value; use_inplace: Pointer; env: PAVS_ScriptEnvironment): MSVC_AVS_Value; stdcall;
var
  avsargs : AVS_Value;
begin;
  {
  *  Parameter übernehmen.
  }

  avsargs := AVS_Value(args);
end;
  Mit Zitat antworten Zitat