def __init__(self, vlc_instance):
# Cast this container to a c pointer to use in the callbacks
self._opaque = ctypes.cast(ctypes.pointer(
ctypes.py_object(self)), ctypes.c_void_p)
# Create the vlc callbacks, these will in turn call the methods defined
# in this container
self.media = vlc_instance.media_new_callbacks(
cb.CALLBACKS["read"],
cb.CALLBACKS["open"],
cb.CALLBACKS["seek"],
cb.CALLBACKS["close"],
self._opaque
)
评论列表
文章目录