internal static void DecodeGif(int taskId, string filepath, System.Threading.ThreadPriority workerPriority, DecodeCompleteCallback completeCallback) { DecodeGif(taskId, filepath, -1, workerPriority, completeCallback); // framesToRead == -1: read whole GIF }
internal static void DecodeGif(int taskId, string filepath, int framesToRead, System.Threading.ThreadPriority workerPriority, DecodeCompleteCallback completeCallback) { var decodeTask = new GifDecodeTask() { taskId = taskId, filepath = filepath, framesToRead = framesToRead, threadPriority = workerPriority, completeCallback = completeCallback }; var instance = new AndroidNativeGif(decodeTask); var worker = new Thread(instance.DoDecodeGif); worker.Priority = decodeTask.threadPriority; worker.Start(); }
internal static void DecodeGif(int taskId, string filepath, int framesToRead, System.Threading.ThreadPriority workerPriority, DecodeCompleteCallback completeCallback) { var gifMetaHolderHandle = GCHandle.Alloc(new GifMetadata(), GCHandleType.Pinned); DecodeTasks[taskId] = new GifDecodeResources() { gifMetadataHandle = gifMetaHolderHandle, completeCallback = completeCallback }; C.EM_DecodeGif(taskId, filepath, framesToRead, EncodeThreadPriority(workerPriority), gifMetaHolderHandle.AddrOfPinnedObject(), GetFrameMetadataHolderFunc, GetImageDataHolderFunc, GifDecodingCompleteCallback); }