Commit 22f2312a authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework/VLCLibrary.m: libvlc type briding should be in the...

MacOSX/Framework/VLCLibrary.m: libvlc type briding should be in the (VLCLibVLCBridging) category. No need to compute the applicationPath by now.(Patch by Enrique Osuna).
parent 55ba87bc
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
***************************************************************************** *****************************************************************************
* Copyright (C) 2007 Pierre d'Herbemont * Copyright (C) 2007 Pierre d'Herbemont
* Copyright (C) 2007 the VideoLAN team * Copyright (C) 2007 the VideoLAN team
* $Id: VLCEventManager.h 21564 2007-08-29 21:09:27Z pdherbemont $ * $Id$
* *
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org> * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
* *
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include "VLCLibrary.h"
// TODO: Documentation // TODO: Documentation
@interface VLCMediaList (LibVLCBridging) @interface VLCMediaList (LibVLCBridging)
+ (id)medialistWithLibVLCMediaList:(void *)p_new_mlist; + (id)medialistWithLibVLCMediaList:(void *)p_new_mlist;
...@@ -60,8 +62,20 @@ ...@@ -60,8 +62,20 @@
- (void)setLength:(VLCTime *)value; - (void)setLength:(VLCTime *)value;
@end @end
// TODO: Documentation
@interface VLCLibrary (VLCLibVLCBridging)
+ (void *)sharedInstance;
- (void *)instance;
@end
// TODO: Documentation // TODO: Documentation
@interface VLCLibrary (VLCAudioBridging) @interface VLCLibrary (VLCAudioBridging)
- (void)setAudio:(VLCAudio *)value; - (void)setAudio:(VLCAudio *)value;
@end @end
// TODO: Documentation
@interface VLCAudio (VLCAudioBridging)
- (id)initWithLibrary:(VLCLibrary *)library;
@end
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
@class VLCAudio; @class VLCAudio;
/* /*
* VLCLibrary object. Internal use only. * VLCLibrary object.
*/ */
// TODO: Documentation // TODO: Documentation
@interface VLCLibrary : NSObject @interface VLCLibrary : NSObject
...@@ -41,10 +41,8 @@ ...@@ -41,10 +41,8 @@
/* Factories */ /* Factories */
+ (VLCLibrary *)sharedLibrary; + (VLCLibrary *)sharedLibrary;
+ (void *)sharedInstance;
/* Properties */ /* Properties */
- (void *)instance;
- (VLCAudio *)audio; - (VLCAudio *)audio;
@end @end
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*****************************************************************************/ *****************************************************************************/
#import "VLCLibrary.h" #import "VLCLibrary.h"
#import "VLCLibVLCBridging.h"
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/libvlc_structures.h> #include <vlc/libvlc_structures.h>
...@@ -59,18 +60,13 @@ static void * DestroySharedLibraryAtExit( void ) ...@@ -59,18 +60,13 @@ static void * DestroySharedLibraryAtExit( void )
{ {
/* Initialize a shared instance */ /* Initialize a shared instance */
sharedLibrary = [[self alloc] init]; sharedLibrary = [[self alloc] init];
/* Make sure, this will get released at some point */ /* Make sure, this will get released at some point */
atexit( (void*)DestroySharedLibraryAtExit ); atexit( (void*)DestroySharedLibraryAtExit );
} }
return [[sharedLibrary retain] autorelease]; return [[sharedLibrary retain] autorelease];
} }
+ (void *)sharedInstance
{
return [[self sharedLibrary] instance];
}
- (id)init - (id)init
{ {
if (self = [super init]) if (self = [super init])
...@@ -78,25 +74,16 @@ static void * DestroySharedLibraryAtExit( void ) ...@@ -78,25 +74,16 @@ static void * DestroySharedLibraryAtExit( void )
libvlc_exception_t ex; libvlc_exception_t ex;
libvlc_exception_init( &ex ); libvlc_exception_init( &ex );
// Figure out the frameworks path const char *lib_vlc_params[] = {
char *applicationPath = strdup( [[NSString stringWithFormat:@"%@/Versions/Current/VLC", "-I", "dummy", "-vvvv", "--opengl-provider", "minimal_macosx",
[[NSBundle bundleForClass:[VLCLibrary class]] bundlePath]] UTF8String] );
// TODO: Raise error if there is no memory available
char *lib_vlc_params[] = {
applicationPath, "-I", "dummy", "-vvvv",
"--opengl-provider", "minimal_macosx",
"--no-video-title-show", NULL "--no-video-title-show", NULL
}; };
instance = (void *)libvlc_new( 7, lib_vlc_params, &ex ); instance = (void *)libvlc_new( 6, lib_vlc_params, &ex );
quit_on_exception( &ex ); quit_on_exception( &ex );
// Assignment unneeded, as the audio unit will do it for us // Assignment unneeded, as the audio unit will do it for us
/*audio = */ [[VLCAudio alloc] initWithLibrary:self]; /*audio = */ [[VLCAudio alloc] initWithLibrary:self];
// free allocated resources
free( applicationPath );
} }
return self; return self;
} }
...@@ -115,14 +102,21 @@ static void * DestroySharedLibraryAtExit( void ) ...@@ -115,14 +102,21 @@ static void * DestroySharedLibraryAtExit( void )
[super dealloc]; [super dealloc];
} }
- (void *)instance - (VLCAudio *)audio
{ {
return instance; return audio;
} }
@end
- (VLCAudio *)audio @implementation VLCLibrary (VLCLibVLCBridging)
+ (void *)sharedInstance
{ {
return audio; return [[self sharedLibrary] instance];
}
- (void *)instance
{
return instance;
} }
@end @end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment