build scripts

This commit is contained in:
2025-10-04 13:51:41 +02:00
parent 2b4ece9bee
commit 7ea498edc8
3 changed files with 33 additions and 5 deletions

View File

@ -16,10 +16,17 @@
import errno
import ctypes
from pathlib import PurePath
_avutil = ctypes.cdll.LoadLibrary('libavutil.so')
_avformat = ctypes.cdll.LoadLibrary('libavformat.so')
_avcodec = ctypes.cdll.LoadLibrary('libavcodec.so')
shared_library_path = PurePath(__file__).parent
def load_shared_library(name):
path = str(shared_library_path / ("lib" + name + ".so"))
return ctypes.cdll.LoadLibrary(path)
_avutil = load_shared_library("avutil")
_avformat = load_shared_library("avformat")
_avcodec = load_shared_library("avcodec")
def _errtag(a, b, c, d):
return -(ord(a) | (ord(b) << 8) | (ord(c) << 16) | (ord(d) << 24))