Example #1
0
        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);
        }
Example #2
0
 private int AvsGetIntVariable(IntPtr avs, string name, ref int val)
 {
     return(GetFunctionDelegate <g_avs_get_int_variable>()(avs, name, ref val));
 }
Example #3
0
 public abstract void DataGetFunction <T>(string name, T defaultValue, GetFunctionDelegate <T> func, bool alwaysWrite = false);
Example #4
0
 private int AvsGetAudioSamples(IntPtr avs, IntPtr buf, long sampleNo, long sampleCount)
 {
     return(GetFunctionDelegate <g_avs_get_audio_frame>()(avs, buf, sampleNo, sampleCount));
 }
Example #5
0
 private int AvsGetVideoFrame(IntPtr avs, IntPtr buf, int stride, int frm)
 {
     return(GetFunctionDelegate <g_avs_get_video_frame>()(avs, buf, stride, frm));
 }
Example #6
0
 private int AvsGetLastError(IntPtr avs, [MarshalAs(UnmanagedType.LPStr)] StringBuilder sb, int len)
 {
     return(GetFunctionDelegate <g_avs_get_last_error>()(avs, sb, len));
 }
Example #7
0
 private int AvsDestroy(ref IntPtr avs)
 {
     return(GetFunctionDelegate <g_avs_destroy>()(ref avs));
 }
Example #8
0
 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));
 }