/*****************************************************************************
- * VLCLibrary.h: VLC.framework VLCLibrary implementation
+ * VLCLibrary.m: VLCKit.framework VLCLibrary implementation
*****************************************************************************
* Copyright (C) 2007 Pierre d'Herbemont
* Copyright (C) 2007 the VideoLAN team
NSException* libvlcException = [NSException
exceptionWithName:@"LibVLCException"
reason:[NSString stringWithFormat:@"libvlc has thrown us an error: %s (%s:%d %s)",
- libvlc_exception_get_message( ex ), file, line_number, function]
+ libvlc_errmsg(), file, line_number, function]
userInfo:nil];
libvlc_exception_clear( ex );
@throw libvlcException;
}
}
-static void * DestroySharedLibraryAtExit( void )
+void * CreateSharedLibraryOnStartup( void )
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ /* This library is not loaded for no reason, so let's create
+ * a VLCLibrary instance. */
+ [VLCLibrary sharedLibrary];
+
+ [pool release];
+
+ return NULL;
+}
+
+void * DestroySharedLibraryAtExit( void )
{
/* Release the global object that may have been alloc-ed
* in -[VLCLibrary init] */
{
/* Initialize a shared instance */
sharedLibrary = [[self alloc] init];
-
- /* Make sure, this will get released at some point */
- atexit( (void *)DestroySharedLibraryAtExit );
}
- return [[sharedLibrary retain] autorelease];
+ return sharedLibrary;
}
- (id)init
libvlc_exception_init( &ex );
const char * lib_vlc_params[] = {
- "-I", "dummy", "--vout=opengllayer",
- "--no-video-title-show", "--no-sout-keep"
+ "-I", "dummy", "--vout=minimal_macosx",
+ "--no-video-title-show", "--no-sout-keep", "--ignore-config",
+ "--opengl-provider=minimal_macosx",
+ "-verbose=-1"
//, "--control=motion", "--motion-use-rotate", "--video-filter=rotate"
};