static int SeekMediaCallback(IntPtr opaque, ulong offset) { var input = MarshalUtils.GetInstance <MediaInput>(opaque); if (input == null) { return(-1); } return(input.Seek(offset) ? 0 : -1); }
static int ReadMediaCallback(IntPtr opaque, IntPtr buf, uint len) { var input = MarshalUtils.GetInstance <MediaInput>(opaque); if (input == null) { return(-1); } return(input.Read(buf, len)); }
static int OpenMediaCallback(IntPtr opaque, ref IntPtr data, out ulong size) { data = opaque; var input = MarshalUtils.GetInstance <MediaInput>(opaque); if (input == null) { size = 0UL; return(-1); } return(input.Open(out size) ? 0 : -1); }
static void CloseMediaCallback(IntPtr opaque) { var input = MarshalUtils.GetInstance <MediaInput>(opaque); input?.Close(); }
private static void EventCallback(IntPtr evt, IntPtr userData) { var eventManager = MarshalUtils.GetInstance <EventTypeManager>(userData); eventManager?.EventHandler(evt); }