Recent

Author Topic: VideoLAN (VLC) use in MacOS Apps?  (Read 23450 times)

Hansaplast

  • Hero Member
  • *****
  • Posts: 539
  • Tweaking4All.com
    • Tweaking4All
Re: VideoLAN (VLC) use in MacOS Apps?
« Reply #15 on: July 20, 2012, 06:23:28 am »
Maybe more progress:

For Windows VLClib uses:

Code: [Select]
libvlc_media_player_set_hwnd
For Linux:

Code: [Select]
libvlc_media_player_set_xwindow
And ... there is a function which I believe might be for MacOS use:

Code: [Select]
libvlc_media_player_set_nsobject
Which appears defined in PasLibVlc as:

Code: [Select]
libvlc_media_player_set_nsobject_t =  procedure(
    p_mi: libvlc_media_player_t_ptr;
    drawable: Pointer
  ); cdecl;

The first parameter appears "easy" as it's being used in the Windows and Linux approach as well.
The second parameter (the pointer) is a little bit more difficult. According to the VLC documentations:

Quote
drawable:    the drawable that is either an NSView or an object following the VLCOpenGLVideoViewEmbedding protocol.

NSView (I think) is Apple specific - I just don't know where to find it and/or how to use it.

I did find this sniplet in the PasLibVlc code:

Code: [Select]
(**
 * Set the NSView handler where the media player should render its video output.
 *
 * Use the vout called "macosx".
 *
 * The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
 * protocol:
 *)

 // \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
 // - (void)addVoutSubview:(NSView *)view;
 // - (void)removeVoutSubview:(NSView *)view;
 // \@end

 (*
 * Or it can be an NSView object.
 *
 * If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then
 * the following code should work:
 * @begincode
 * {
 *     NSView *video = [[NSView alloc] init];
 *     QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
 *     libvlc_media_player_set_nsobject(mp, video);
 *     [video release];
 * }
 * @endcode
 *
 * You can find a live example in VLCVideoView in VLCKit.framework.
 *
 * \param p_mi the Media Player
 * \param drawable the drawable that is either an NSView or an object following
 * the VLCOpenGLVideoViewEmbedding protocol.
 *)

Any of the Mac experts know how to work with this? Help is very much appreciated.  :)

Hansaplast

  • Hero Member
  • *****
  • Posts: 539
  • Tweaking4All.com
    • Tweaking4All
Re: VideoLAN (VLC) use in MacOS Apps?
« Reply #16 on: July 25, 2012, 04:19:15 am »
Nobody familier with this?  :o

mdalacu

  • Full Member
  • ***
  • Posts: 199
    • dmSimpleApps
Re: VideoLAN (VLC) use in MacOS Apps?
« Reply #17 on: July 25, 2012, 06:59:49 am »
Does it work for you on Linux or Windows? I only get AV. If yes can you provide an working example. Thank you.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8111
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: VideoLAN (VLC) use in MacOS Apps?
« Reply #18 on: July 25, 2012, 01:11:12 pm »
Quote
NSView (I think) is Apple specific - I just don't know where to find it and/or how to use it.
Yes, it's part of Mac OS X's Objective-C framework. FPC support is documented here. Note that I'm not a Mac expert (I don't have it, it's way too expensive).

Hansaplast

  • Hero Member
  • *****
  • Posts: 539
  • Tweaking4All.com
    • Tweaking4All
Re: VideoLAN (VLC) use in MacOS Apps?
« Reply #19 on: July 25, 2012, 03:58:39 pm »
Does it work for you on Linux or Windows? I only get AV. If yes can you provide an working example. Thank you.

According to the PasLibVlc package, both Windows and Linux are support already through this open source package.
Download it here: http://sourceforge.net/projects/paslibvlc/

Note:
I am assuming that if you're creating a 32bit app, that you should use the 32bit version of VLC as well.

Hansaplast

  • Hero Member
  • *****
  • Posts: 539
  • Tweaking4All.com
    • Tweaking4All
Re: VideoLAN (VLC) use in MacOS Apps?
« Reply #20 on: July 25, 2012, 04:00:01 pm »
Yes, it's part of Mac OS X's Objective-C framework. FPC support is documented here.

Thanks :)
I did try to read through that, but I'm still confused on how to use it ... :(

Leledumbo

  • Hero Member
  • *****
  • Posts: 8111
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: VideoLAN (VLC) use in MacOS Apps?
« Reply #21 on: July 25, 2012, 04:58:34 pm »
Quote
I did try to read through that, but I'm still confused on how to use it ...
If you buy me a Mac I might be able to help :P

Hansaplast

  • Hero Member
  • *****
  • Posts: 539
  • Tweaking4All.com
    • Tweaking4All
Re: VideoLAN (VLC) use in MacOS Apps?
« Reply #22 on: July 25, 2012, 08:05:08 pm »
If you buy me a Mac I might be able to help :P

Haha, yeah, if I win Powerball, I'll keep that in mind  :P

p.s. plenty of hackintosh possibilities and virtual machines for vmware player out there ;)