summaryrefslogtreecommitdiff
path: root/cexports/sdk.py
diff options
context:
space:
mode:
authora1e7cb88 <[email protected]>2021-10-18 00:27:08 +0800
committera1e7cb88 <[email protected]>2021-10-18 00:27:08 +0800
commitf696fba48f3a05c08af71b9e2dceb72bb7c9c024 (patch)
tree7d4af1df2fa20ef09137a7f7e8dd641d49f2c5d0 /cexports/sdk.py
parent113fd8f700015308e663c8904c95ddf374987b78 (diff)
update mod
Diffstat (limited to 'cexports/sdk.py')
-rw-r--r--cexports/sdk.py35
1 files changed, 35 insertions, 0 deletions
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)
+