From f696fba48f3a05c08af71b9e2dceb72bb7c9c024 Mon Sep 17 00:00:00 2001 From: a1e7cb88 Date: Mon, 18 Oct 2021 00:27:08 +0800 Subject: update mod --- cexports/sdk.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 cexports/sdk.py (limited to 'cexports/sdk.py') diff --git a/cexports/sdk.py b/cexports/sdk.py new file mode 100644 index 0000000..a48a55e --- /dev/null +++ b/cexports/sdk.py @@ -0,0 +1,35 @@ +from ctypes import * +from json import * + +libpath="./mkvlib.so" +lib=CDLL(libpath) + +def checkInstance(): + call=lib.CheckInstance + return call() + +def getMKVInfo(file): + call=lib.GetMKVInfo + call.restype=c_char_p + return call(file.encode()) + +def dumpMKV(file,output,subset,dirSafe): + call=lib.DumpMKV + return call(file.encode(),output.encode(),subset,dirSafe) + +def checkSubset(file): + call=lib.CheckSubset + call.restype=c_char_p + return call(file.encode()) + +def createMKV(file,tracks,attachments,output,slang,stitle,clean): + call=lib.CreateMKV + _tracks=dumps(tracks) + _attachments=dumps(attachments) + return call(file.encode(),_tracks.encode(),_attachments.encode(),output.encode(),slang.encode(),stitle.encode(),clean) + +def assFontSubset(files,fonts,output,dirSafe): + call=lib.ASSFontSubset + _files=dumps(files) + return call(_files.encode(),fonts.encode(),output.encode(),dirSafe) + -- cgit v1.2.1