Apr-28-2019, 07:46 PM
I just need help understanding how to provide the right variable types, by referring to the Python API for LibVLC.
I'm using the vlc.py Python wrapper, and I can't work out what format the parameters need to be in when calling "libvlc_video_set_aspect_ratio".
vlc.libvlc_video_set_aspect_ratio(player, "16:9")
Gives the error;
ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type
vlc.libvlc_video_set_aspect_ratio(player, c_char_p('16:9'))
Gives the error;
"builtins.TypeError: bytes or integer address expected instead of str instance"
Here is the documentation for libvlc_video_set_aspect_ratio:
I'm using the vlc.py Python wrapper, and I can't work out what format the parameters need to be in when calling "libvlc_video_set_aspect_ratio".
vlc.libvlc_video_set_aspect_ratio(player, "16:9")
Gives the error;
ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type
vlc.libvlc_video_set_aspect_ratio(player, c_char_p('16:9'))
Gives the error;
"builtins.TypeError: bytes or integer address expected instead of str instance"
Here is the documentation for libvlc_video_set_aspect_ratio:
def libvlc_video_set_aspect_ratio(p_mi, psz_aspect): '''Set new video aspect ratio. @param p_mi: the media player. @param psz_aspect: new video aspect-ratio or None to reset to default @note Invalid aspect ratios are ignored. ''' f = _Cfunctions.get('libvlc_video_set_aspect_ratio', None) or \ _Cfunction('libvlc_video_set_aspect_ratio', ((1,), (1,),), None, None, MediaPlayer, ctypes.c_char_p) return f(p_mi, psz_aspect)