diff options
| author | a1e7cb88 <[email protected]> | 2021-10-18 01:05:57 +0800 |
|---|---|---|
| committer | a1e7cb88 <[email protected]> | 2021-10-18 01:05:57 +0800 |
| commit | 1dbc72c60e4932e5b88ea608c668eea035ac7980 (patch) | |
| tree | ca8eb66270ee5ffbbd75d730152f4b6b4fddc29c /mkvlib/c/sdk.py | |
| parent | f696fba48f3a05c08af71b9e2dceb72bb7c9c024 (diff) | |
update mod
Diffstat (limited to 'mkvlib/c/sdk.py')
| -rw-r--r-- | mkvlib/c/sdk.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mkvlib/c/sdk.py b/mkvlib/c/sdk.py new file mode 100644 index 0000000..a48a55e --- /dev/null +++ b/mkvlib/c/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) + |
