LibVLC, QT and Mac

This forum is about all development around libVLC.
Brit
New Cone
New Cone
Posts: 9
Joined: 30 Mar 2012 07:49

LibVLC, QT and Mac

Postby Brit » 18 Apr 2012 02:25

I have libVLC setup in my QT project and I've finally gotten to a place where it doesn't crash, but I can't seem to play any videos. After I load a video and attempt to play it, the widget just appears blank and has no sound. When I call libvlc_media_player_get_length( m_pMediaPlayer ), I get a return value of 0, which makes me think VLC isn't loading the video at all. I've spent a ton of time searching google for a solution, but haven't found anything that works. I'm about ready to give up.

Rather than post my code, I'll just ask this question: does anyone have LibVLC working on Qt for Mac? Can I look at the code? I'd be happy to update the wiki so other people can get it working, too.

some_birdie
Blank Cone
Blank Cone
Posts: 11
Joined: 26 Jun 2011 18:31
Operating System: Win, Linux, Android

Re: LibVLC, QT and Mac

Postby some_birdie » 19 Apr 2012 15:04

Is this only Mac problem? Does your code work on some other OS?

Brit
New Cone
New Cone
Posts: 9
Joined: 30 Mar 2012 07:49

Re: LibVLC, QT and Mac

Postby Brit » 19 Apr 2012 20:51

Is this only Mac problem? Does your code work on some other OS?
Yes, I have libVLC working on Windows. There are a few mac-specific calls that have to be done to get it up and running on the Mac. I tried using a bunch of variations of code that I found on the web, but haven't gotten it to work. I don't know if that code only worked with older versions of Qt or VLC, though.

Brit
New Cone
New Cone
Posts: 9
Joined: 30 Mar 2012 07:49

Re: LibVLC, QT and Mac

Postby Brit » 24 Apr 2012 22:41

I don't know what happened, but the file loads and plays sound now, but no video appears in the space where it's supposed to. Nobody has gotten this to work in Qt/Mac?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: LibVLC, QT and Mac

Postby Jean-Baptiste Kempf » 25 Apr 2012 13:31

How did you set the nsview?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Brit
New Cone
New Cone
Posts: 9
Joined: 30 Mar 2012 07:49

Re: LibVLC, QT and Mac

Postby Brit » 30 Apr 2012 19:48

Right now, this is the code I'm using. The [this] object is a class I created which is derived from QWidget.

Code: Select all

libvlc_media_player_set_nsobject( m_pMediaPlayer, (void*)this->winId());
I had tried using some other code I found, but it wouldn't compile in C++ (it looks like Objective C to me?):

Code: Select all

_videoWidget = new QMacCocoaViewContainer(0); _wrapperLayout->addWidget(_videoWidget); NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; VLCVideoView *videoView = [[VLCVideoView alloc] init]; _videoWidget->setCocoaView(videoView); //libvlc_media_player_set_nsobject(_media_player, videoView, &VLCException(this) ); libvlc_media_player_set_nsobject( m_pMediaPlayer, videoView ); //[videoView release]; //[pool release];
I tried commenting out the parts that looked like Objective C (everything in brackets), but the "VLCVideoView" class isn't defined.
I tried some other code I found on the internet, too, but couldn't get it to work, either.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: LibVLC, QT and Mac

Postby Jean-Baptiste Kempf » 30 Apr 2012 20:14

You need some obj-C for that, yes.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Brit
New Cone
New Cone
Posts: 9
Joined: 30 Mar 2012 07:49

Re: LibVLC, QT and Mac

Postby Brit » 30 Apr 2012 20:20

You mean that I need objective C to get that particular piece of code to work, or do you mean it's impossible to get VLC to ever work on the Mac without Objective C?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 7 guests