public override void DataGetFunction <T>(string name, T defaultValue, GetFunctionDelegate <T> func, bool alwaysWrite = false) { if (Reading) { return; } var value = func.Invoke(); // don't write if value is null or default if (!alwaysWrite && (value != null || defaultValue == null) && (value == null || value.Equals(defaultValue))) { return; } var key = name; var val = value == null?TypeToNode(defaultValue) : TypeToNode(value); _curMap.Add(key, val); }
private int AvsGetIntVariable(IntPtr avs, string name, ref int val) { return(GetFunctionDelegate <g_avs_get_int_variable>()(avs, name, ref val)); }
public abstract void DataGetFunction <T>(string name, T defaultValue, GetFunctionDelegate <T> func, bool alwaysWrite = false);
private int AvsGetAudioSamples(IntPtr avs, IntPtr buf, long sampleNo, long sampleCount) { return(GetFunctionDelegate <g_avs_get_audio_frame>()(avs, buf, sampleNo, sampleCount)); }
private int AvsGetVideoFrame(IntPtr avs, IntPtr buf, int stride, int frm) { return(GetFunctionDelegate <g_avs_get_video_frame>()(avs, buf, stride, frm)); }
private int AvsGetLastError(IntPtr avs, [MarshalAs(UnmanagedType.LPStr)] StringBuilder sb, int len) { return(GetFunctionDelegate <g_avs_get_last_error>()(avs, sb, len)); }
private int AvsDestroy(ref IntPtr avs) { return(GetFunctionDelegate <g_avs_destroy>()(ref avs)); }
private int AvsInit(ref IntPtr avs, string func, string arg, ref AvsWrapperVideoInfo vi, ref AvsVideoColorspace originalColorspace, ref AvsAudioSampleType originalSampleType, string cs) { return(GetFunctionDelegate <g_avs_init>()(ref avs, func, arg, ref vi, ref originalColorspace, ref originalSampleType, cs)); }