Commit 6c3715d2 authored by Mike Schrag's avatar Mike Schrag Committed by Felix Paul Kühne

load vlc config parameters from an array of strings in the 'VLCParams'...

load vlc config parameters from an array of strings in the 'VLCParams' property in the main bundle's Info.plist
Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 2c15069f
...@@ -67,19 +67,30 @@ void __catch_exception( void * e, const char * function, const char * file, int ...@@ -67,19 +67,30 @@ void __catch_exception( void * e, const char * function, const char * file, int
libvlc_exception_t ex; libvlc_exception_t ex;
libvlc_exception_init( &ex ); libvlc_exception_init( &ex );
const char * lib_vlc_params[] = { NSArray *vlcParams = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"VLCParams"];
"-I", "dummy", // No interface if (!vlcParams) {
"--no-video-title-show", // Don't show the title on overlay when starting to play NSMutableArray *defaultParams = [NSMutableArray array];
"--no-sout-keep", [defaultParams addObject:@"-I"]; [defaultParams addObject:@"dummy"]; // No interface
"--ignore-config", // Don't read and write VLC config files. [defaultParams addObject:@"--no-video-title-show"]; // Don't show the title on overlay when starting to play
"--opengl-provider=minimal_macosx", // Use minimal_macosx [defaultParams addObject:@"--no-sout-keep"];
"--vout=minimal_macosx", [defaultParams addObject:@"--ignore-config"]; // Don't read and write VLC config files
"--verbose=2", // Don't polute the log [defaultParams addObject:@"--opengl-provider=minimal_macosx"]; // Use minimal_macosx
"--play-and-pause" // When ending a stream pause it instead of stopping it. [defaultParams addObject:@"--vout=minimal_macosx"];
//, "--control=motion", "--motion-use-rotate", "--video-filter=rotate" [defaultParams addObject:@"--verbose=2"]; // Don't polute the log
}; [defaultParams addObject:@"--vout=minimal_macosx"];
[defaultParams addObject:@"--play-and-pause"]; // When ending a stream pause it instead of stopping it
// [defaultParams addObject:@"--control=motion"];
// [defaultParams addObject:@"--motion-use-rotate"];
// [defaultParams addObject:@"--video-filter=rotate"];
vlcParams = defaultParams;
}
instance = (void *)libvlc_new( sizeof(lib_vlc_params)/sizeof(lib_vlc_params[0]), lib_vlc_params, &ex ); const char *lib_vlc_params[[vlcParams count]];
for (int paramNum = 0; paramNum < [vlcParams count]; paramNum ++) {
NSString *vlcParam = [vlcParams objectAtIndex:paramNum];
lib_vlc_params[paramNum] = [vlcParam cStringUsingEncoding:NSASCIIStringEncoding];
}
instance = (void *)libvlc_new([vlcParams count], lib_vlc_params, &ex );
catch_exception( &ex ); catch_exception( &ex );
NSAssert(instance, @"libvlc failed to initialize"); NSAssert(instance, @"libvlc failed to initialize");
......
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