VLCKit - build issues and version advice, please

macOS specific usage questions
packetship
Blank Cone
Blank Cone
Posts: 17
Joined: 20 Aug 2008 13:21
Location: Cornwall UK
Contact:

VLCKit - build issues and version advice, please

Postby packetship » 09 Apr 2013 14:38

Hi Folks,

I'm doing a proof-of-concept at the moment that needs multicast and RTSP MPEG-2 video streaming integrated with a browser on a Mac, so I of course thought of VLC, since QT doesn't seem to do either. Initially I was looking at the Mac plugin but I note there are issues with Mountain Lion, and there are certain advantages to a full-blown application anyway, so I then turned to VLCKit. The idea would be to run VLCKit alongside a UIWebView. If we can get this working we might be able to put some development resource into helping with VLCKit generally.

First up, as a sanity check, I can build full VLC on the Mac (OS 10.6, XCode 4.2) from 2.0.5 fine, using the instructions at http://wiki.videolan.org/OSXCompile, but with the 2.0.5 source tarball rather than the git fetch. Here's roughly what I did - note I had to set SDKROOT which wasn't set before, otherwise the tool build failed.

Code: Select all

export CC=/Developer/usr/bin/llvm-gcc-4.2 export CXX=/Developer/usr/bin/llvm-g++-4.2 export OBJC=/Developer/usr/bin/llvm-gcc-4.2 export SDKROOT=/Developer/SDKs/ mkdir build cd build ../extras/package/macosx/build.sh
The resulting VLC 2.0.5 plays my test MPEG-2 TS files and multicast streams just fine.

So onto VLCKit... I see that VLCKit has moved to its own repo sometime before 2.0.5 (no projects/macosx directory), but I can't work out quite when, and the git logs suggest this was a 2.1 change - slightly confused here... So I tried the instructions at http://wiki.videolan.org/Mac_OS_X_Framework using the git master. This was not quite so painless, but I got there eventually :-)

To save anyone else the pain the main things I had to fix were:

0) (Stupid) - start with a clean shell because the CC etc. exports from the 2.0.5 build stuff things up

1) Fix deployment target to 10.6 in VLCKit/xcodeproj/project.pbxproj (3 places)

2) The "Run VLC configure" target didn't seem to run the first script (631A...) which bootstrapped vlc-unstable, so I ran this manually.

3) Remove calls to VKLog in
  • Sources/VLCMediaPlayer.m
    Sources/VLCMediaThumbnailer.m
    Sources/VLCEventManager.m
Looks like a version control problem, I couldn't find any definition of VKLog anywhere.

So with these fixes the actual build commands were:

Code: Select all

xcodebuild -project VLCKit.xcodeproj -verbose -target "Fetch libvlc" xcodebuild -project VLCKit.xcodeproj -verbose -target "Setup VLC contribs" -configuration Release export PATH=$PWD/vlc-unstable/extras/tools/build/bin:$PATH cd vlc-unstable ./bootstrap cd .. xcodebuild -project VLCKit.xcodeproj -verbose -target "Run VLC configure" -configuration Release xcodebuild -project VLCKit.xcodeproj -verbose -target "Make VLC" -configuration Release xcodebuild -project VLCKit.xcodeproj -verbose -target "Build just VLCKit" -configuration Release
Then I built the Examples/test application. To make this run I had to softlink the VLCKit.Framework in build/Release into a Frameworks directory in the app's Contents:

Code: Select all

cd Examples/test xcodebuild -project test.xcodeproj -arch x86_64 -target test -configuration Release cd ../.. cd build/Release/test.app/Contents mkdir Frameworks cd Frameworks ln -sf ../../../VLCKit.framework .
That gave me a running test application - hooray! Problem is as soon as I dragged anything onto the list view pane (which didn't update to show it, incidentally) and pressed Play, it would crash. With a simple MPEG-2 TS file it crashed out with a SEGV, in thread 11:

Code: Select all

Thread 11 Crashed: 0 libvlccore.5.dylib 0x00000001000c9d6d vout_window_Control + 333 1 libvout_macosx_plugin.dylib 0x00000001184af964 vout_window_SetState + 36 2 libvout_macosx_plugin.dylib 0x00000001184af24b Control + 395 3 libvlccore.5.dylib 0x00000001000b631d vout_display_Control + 349 4 libvlccore.5.dylib 0x00000001000b55e4 vout_ManageDisplay + 1956 5 libvlccore.5.dylib 0x00000001000ccd29 vout_ManageWrapper + 137 6 libvlccore.5.dylib 0x00000001000bfee6 ThreadManage + 166 7 libvlccore.5.dylib 0x00000001000be48a Thread + 762 8 libSystem.B.dylib 0x00007fff841fefd6 _pthread_start + 331 9 libSystem.B.dylib 0x00007fff841fee89 thread_start + 13
With an H.264 MOV it did get as far as showing the first frame perfectly but then crashed in the same way.

Any clues from that? I'm afraid I don't (yet) know much about Mac debugging to get any further, although I can swing gdb with the best of them in Linux...

More generally, though, I'm a bit nervous of using the bleeding edge code, and I fully understand it might be completely broken. What would be the best stable version to go for to build a basic VLCKit? We don't really need any features beyond 0.8.x, just multicast and RTSP MPEG-2/H.264 in TS. I have a feeling I may need a recent VLCKit (ObjC code) combined with an older base VLC release. Would such a thing work or are there too many dependencies on 2.1 features?

Many thanks

Paul

packetship
Blank Cone
Blank Cone
Posts: 17
Joined: 20 Aug 2008 13:21
Location: Cornwall UK
Contact:

Re: VLCKit - build issues and version advice, please

Postby packetship » 09 Apr 2013 18:28

Answering at least one of my own questions...

The 2.0 branch in git does still contain projects/macosx, which builds just fine, none of the problems I had with master. Why isn't this in the 2.0.5 source release tarball, I wonder?

But this still crashes in exactly the same way, in vout_window_Control(), but this time in thread#9 (so the threads have moved around a bit, no problem).

So, take-home message so far, folks, don't try to get this to work from git master, use vlc-2.0.git instead! git://git.videolan.org/vlc/vlc-2.0.git

packetship
Blank Cone
Blank Cone
Posts: 17
Joined: 20 Aug 2008 13:21
Location: Cornwall UK
Contact:

Re: VLCKit - build issues and version advice, please

Postby packetship » 09 Apr 2013 20:01

Well, gdb on the app binary just works :-) This confirms the crash in vout_window_Control() but I can't work out how to get source through the dylibs to trace it any further.

So to summarise:

- VLC 2.0.5 builds and works
- VLCKit builds fine from git-2.0 but multiple issues in master
- Test app crashes in GL window management as soon as video received

Platform: Ancient Mac mini, OS 10.6, XCode 4.2 tools (if we can get this to work we may be able to afford something rather better ;-) )

Any ideas?

fkuehne
Developer
Developer
Posts: 7260
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: VLCKit - build issues and version advice, please

Postby fkuehne » 10 Apr 2013 00:19

Just a quick response to show that you are on my radar - I'll come back with a longer response tomorrow.

VLCKit in master is currently under development, same for vlc.git itself. So for now, you should be using VLCKit as of March 2012 with VLC's 2.0 branch or directly the version included. Regrettably, there is no exact source snapshot for VLC and VLCKit 2.0.

We are currently working on adding proper release management to VLCKit, so you'll get stable releases (and out-of-the box SDKs) starting with VLC(Kit) 2.1.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

packetship
Blank Cone
Blank Cone
Posts: 17
Joined: 20 Aug 2008 13:21
Location: Cornwall UK
Contact:

Re: VLCKit - build issues and version advice, please

Postby packetship » 10 Apr 2013 09:50

Thanks Felix,

The 2.0 branch fixes the build issues, as you say, so we're just left with this crash... I was going to raise a ticket for it but then found this...

http://trac.videolan.org/vlc/ticket/7937

Sounds identical, and confirms my my hunch that the window ptr was simply NULL. I'll press on with the debugger to see if I can trace why. Maybe a timing/race issue on setup? Should I continue this in that ticket?

Many thanks

Paul

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: VLCKit - build issues and version advice, please

Postby Jean-Baptiste Kempf » 10 Apr 2013 11:24

Yep, this is the same issue.
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.

packetship
Blank Cone
Blank Cone
Posts: 17
Joined: 20 Aug 2008 13:21
Location: Cornwall UK
Contact:

Re: VLCKit - build issues and version advice, please

Postby packetship » 10 Apr 2013 11:54


fkuehne
Developer
Developer
Posts: 7260
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: VLCKit - build issues and version advice, please

Postby fkuehne » 10 Apr 2013 17:15

I committed a fix for this issue to vlc.git (unstable, master). The ticket will be closed automatically in a few minutes. Thanks for the report!

In addition, I also fixed the other issues you reported with VLCKit, so it should be stable again on the Mac. I'm using it daily on embedded Darwin platforms and as far as I can tell, it should be ready for further tests, so you can deploy it within the 2 months when it will be released.
On the public API side, there are noticeable differences between 2.0 and 2.1, but nothing terrible. The transition can be smoothly done within an hour. However, there are a few advantages, especially with regard to audio/video/subtitle stream selection, so I'd recommend you to have a look at 2.1 for new projects.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

packetship
Blank Cone
Blank Cone
Posts: 17
Joined: 20 Aug 2008 13:21
Location: Cornwall UK
Contact:

Re: VLCKit - build issues and version advice, please

Postby packetship » 10 Apr 2013 19:52

OK, that's great, thanks Felix.

Now I know it will work with the fix I will switch back to 2.1, no point in working to an old API.

Best regards

Paul

packetship
Blank Cone
Blank Cone
Posts: 17
Joined: 20 Aug 2008 13:21
Location: Cornwall UK
Contact:

Re: VLCKit - build issues and version advice, please

Postby packetship » 10 Apr 2013 22:25

OK, git master does now build out of the box for me, but for one tiny problem introduced today in your commit dc7fe584:

.. Examples/test/Controller.m:134: error: 'for' loop initial declaration used outside C99 mode

Maybe an older compiler (XCode 4.2, llvm-gcc-4.2) is more fussy?

Trivial patch:

Code: Select all

diff --git a/Examples/test/Controller.m b/Examples/test/Controller.m index d337ee2..9e7d057 100644 --- a/Examples/test/Controller.m +++ b/Examples/test/Controller.m @@ -131,7 +131,8 @@ { NSArray *droppedItems = [[info draggingPasteboard] propertyListForType:NSFilenamesPboardType]; - for (int i = 0; i < [droppedItems count]; i++) { + int i; + for (i = 0; i < [droppedItems count]; i++) { NSString * filename = [droppedItems objectAtIndex:i]; VLCMedia * media = [VLCMedia mediaWithPath:filename]; [playlist addMedia:media];

packetship
Blank Cone
Blank Cone
Posts: 17
Joined: 20 Aug 2008 13:21
Location: Cornwall UK
Contact:

Re: VLCKit - build issues and version advice, please

Postby packetship » 10 Apr 2013 22:53

GDB symbols too! Awesome :-)

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: VLCKit - build issues and version advice, please

Postby Jean-Baptiste Kempf » 11 Apr 2013 00:30

--std=c99 maybe?
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.

fkuehne
Developer
Developer
Posts: 7260
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: VLCKit - build issues and version advice, please

Postby fkuehne » 11 Apr 2013 15:40

@Paul: must be the old Xcode. Make sure that C99 is enabled in the target's build settings..
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

packetship
Blank Cone
Blank Cone
Posts: 17
Joined: 20 Aug 2008 13:21
Location: Cornwall UK
Contact:

Re: VLCKit - build issues and version advice, please

Postby packetship » 11 Apr 2013 18:53

Sure, just reporting that this was the only thing stopping it being built out of the box - maybe the shipped xcodeproj could include the flag?

Thanks

Paul

fkuehne
Developer
Developer
Posts: 7260
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: VLCKit - build issues and version advice, please

Postby fkuehne » 11 Apr 2013 22:09

Good point. C99 is now enforced for GCC-based compilers. Thanks!
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: No registered users and 7 guests