public static int IMOS_XP_SetDecodeVideoMediaDataCB(int port, DecodeVideoDataCallback onDecodeVideoData, bool bContinue) { _decVideoCallbacks[port] = onDecodeVideoData; if (onDecodeVideoData != null) { IntPtr userParam = Marshal.GetFunctionPointerForDelegate(onDecodeVideoData); if (_isX64) { return(Native64.IMOS_XP_SetDecodeVideoMediaDataCB((uint)port, _onDecVideoData, bContinue, userParam)); } else { return(Native32.IMOS_XP_SetDecodeVideoMediaDataCB((uint)port, _onDecVideoData, bContinue, userParam)); } } else { if (_isX64) { return(Native64.IMOS_XP_SetDecodeVideoMediaDataCB((uint)port, null, bContinue, IntPtr.Zero)); } else { return(Native32.IMOS_XP_SetDecodeVideoMediaDataCB((uint)port, null, bContinue, IntPtr.Zero)); } } }