I'm experimenting with video acceleration in an EGL context, and to get vaapi working I need to pass libmpv a raw pointer to the X11 window using MPV_RENDER_PARAM_X11_DISPLAY. python-mpv has support for this, but it appears broken.
Traceback (most recent call last):
File "simple-test.py", line 4, in <module>
MpvRenderContext(MPV(), 'opengl', x11_display=ctypes.c_void_p(5), opengl_init_params={})
File "/home/marcelm/pyopengl/mpv.py", line 1823, in __init__
_mpv_render_context_create(buf, mpv.handle, kwargs_to_render_param_array(kwargs))
File "/home/marcelm/pyopengl/mpv.py", line 234, in kwargs_to_render_param_array
return t(*kwargs.items(), ('invalid', None))
RuntimeError: (MpvRenderParam) <class 'TypeError'>: _ctypes.PyCSimpleType object argument after ** must be a mapping, not c_void_p
Looking at the code in MpvRenderParam.__init__(), there's no way passing x11_display or wl_display could work; the value is supposed to be a void pointer, but it is handled by the fall-through case where it is used as c_void_p(**value).
I'll make a pull request to handle the c_void_p case.
I'm experimenting with video acceleration in an EGL context, and to get vaapi working I need to pass libmpv a raw pointer to the X11 window using
MPV_RENDER_PARAM_X11_DISPLAY
. python-mpv has support for this, but it appears broken.Simple testcase:
Results in:
Looking at the code in
MpvRenderParam.__init__()
, there's no way passingx11_display
orwl_display
could work; the value is supposed to be a void pointer, but it is handled by the fall-through case where it is used asc_void_p(**value)
.I'll make a pull request to handle the
c_void_p
case.