CTYPES error on OSX

This forum is about all development around libVLC.
akelian
New Cone
New Cone
Posts: 4
Joined: 14 Jan 2018 17:06

CTYPES error on OSX

Postby akelian » 14 Jan 2018 17:11

Hello,


I'm trying to implement a video widget in one of my apps.
In order to familiarise myself with the lib I edited the Qt4 example to Qt5 but I have the following error:


File "xxx/xxx/vlc.py", line 6894, in libvlc_media_player_set_nsobject
return f(p_mi, drawable)

ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type


Process finished with exit code 134 (interrupted by signal 6: SIGABRT)




Any clues ?

Thanks

akelian
New Cone
New Cone
Posts: 4
Joined: 14 Jan 2018 17:06

Re: CTYPES error on OSX

Postby akelian » 19 Jan 2018 13:24

Nobody else know, or have this problem ?

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: CTYPES error on OSX

Postby Rémi Denis-Courmont » 19 Jan 2018 21:27

I think that there are not that many Python devs on this forum.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

ghalter
New Cone
New Cone
Posts: 5
Joined: 12 Jan 2018 06:30

Re: CTYPES error on OSX

Postby ghalter » 20 Jan 2018 11:45

I happen to have embedded libVLC into a cross-platform PyQt Application, although PyQt5, could you show how you embed vlc player into pyqt?

akelian
New Cone
New Cone
Posts: 4
Joined: 14 Jan 2018 17:06

Re: CTYPES error on OSX

Postby akelian » 20 Jan 2018 13:46

Yes sorry, here is the converted example code (from Qt4 to Qt5) that triggers that error:

https://pastebin.com/j0QPsBUt

If you have any idea shoutout ;)

ghalter
New Cone
New Cone
Posts: 5
Joined: 12 Jan 2018 06:30

Re: CTYPES error on OSX

Postby ghalter » 20 Jan 2018 19:20

Ah, you have to cast the winID to int:

the line:

Code: Select all

self.mediaplayer.set_nsobject(self.videoframe.winId())
should be:

Code: Select all

self.mediaplayer.set_nsobject(int(self.videoframe.winId()))
your code works fine then on my machine.

akelian
New Cone
New Cone
Posts: 4
Joined: 14 Jan 2018 17:06

Re: CTYPES error on OSX

Postby akelian » 23 Jan 2018 01:07

@ghalter Thanks a lot, I don't know how you found that needle but that was it!

To be honest it was not my first attempt but never took the time to post or search more than that. It's been a longtime drawback so big thanks.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 25 guests