framework: Fix the configure script. Fix a bunch of warnings.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 10 Feb 2008 23:53:48 +0000 (23:53 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 10 Feb 2008 23:53:48 +0000 (23:53 +0000)
projects/macosx/framework/Headers/Public/VLCMedia.h
projects/macosx/framework/Sources/VLCLibrary.m
projects/macosx/framework/Sources/VLCMedia.m
projects/macosx/framework/Sources/VLCVideoLayer.m
projects/macosx/framework/VLCKit.xcodeproj/project.pbxproj

index bb00a99..58d0704 100644 (file)
@@ -189,7 +189,7 @@ typedef enum VLCMediaState
  * available.  Use lengthWaitUntilDate: to wait for a specified length of time.
  * \see lengthWaitUntilDate
  */
-@property (readonly) VLCTime * length;
+@property (retain, readonly) VLCTime * length;
 
 /**
  * Returns a VLCTime object describing the length of the media resource,
@@ -209,17 +209,17 @@ typedef enum VLCMediaState
 /**
  * The URL for the receiver's media resource.
  */
-@property (readonly) NSURL * url;
+@property (retain, readonly) NSURL * url;
 
 /**
  * The receiver's sub list.
  */
-@property (readonly) VLCMediaList * subitems;
+@property (retain, readonly) VLCMediaList * subitems;
 
 /**
  * The receiver's meta data as a NSDictionary object.
  */
-@property (readonly) NSDictionary * metaDictionary;
+@property (retain, readonly) NSDictionary * metaDictionary;
 
 /**
  * The receiver's state, such as Playing, Error, NothingSpecial, Buffering.
index 658690d..b58e011 100644 (file)
@@ -82,7 +82,7 @@ static void * DestroySharedLibraryAtExit( void )
         
         const char * lib_vlc_params[] = { 
             "-I", "dummy", "--vout=opengllayer", 
-            "--no-video-title-show", "--no-sout-keep", "-vvv"
+            "--no-video-title-show", "--no-sout-keep"
             //, "--control=motion", "--motion-use-rotate", "--video-filter=rotate"
         };
         
index 0cb5819..2509d2e 100644 (file)
@@ -358,7 +358,6 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
     p_md = libvlc_media_descriptor_duplicate( [media libVLCMediaDescriptor] );
     for( NSString * key in [options allKeys] )
     {
-        NSLog(@"Adding %@", [NSString stringWithFormat:@"--%@ %@", key, [options objectForKey:key]]);
         libvlc_media_descriptor_add_option(p_md, [[NSString stringWithFormat:@"%@=#%@", key, [options objectForKey:key]] UTF8String], NULL);
     }
     return [VLCMedia mediaWithLibVLCMediaDescriptor:p_md];
@@ -460,9 +459,13 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
     }
 
     state = LibVLCStateToMediaState(libvlc_media_descriptor_get_state( p_md, NULL ));
+
     /* Force VLCMetaInformationTitle, that will trigger preparsing
      * And all the other meta will be added through the libvlc event system */
     [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationTitle];
+
+    /* Force VLCMetaInformationArtworkURL, that will trigger artwork fetching */
+    [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationArtworkURL];
 }
 
 - (void)fetchMetaInformationFromLibVLCWithType:(NSString *)metaType
@@ -472,7 +475,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
     NSString * oldValue = [metaDictionary valueForKey:metaType];
     free(psz_value);
 
-    if ( !(newValue && oldValue && [oldValue compare:newValue] == NSOrderedSame) )
+    if ( newValue != oldValue && !(oldValue && newValue && [oldValue compare:newValue] == NSOrderedSame) )
     {
         if ([metaType isEqualToString:VLCMetaInformationArtworkURL])
         {
@@ -489,22 +492,32 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
 - (void)fetchMetaInformationForArtWorkWithURL:(NSString *)anURL
 {
     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-    
-    // Go ahead and load up the art work
-    NSURL * artUrl = [NSURL URLWithString:[anURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
-    NSImage * art  = [[[NSImage alloc] initWithContentsOfURL:artUrl] autorelease]; 
-        
-    // If anything was found, lets save it to the meta data dictionary
-    if (art)
+    NSImage * art = nil;
+
+    if( anURL )
     {
-        [self performSelectorOnMainThread:@selector(setArtwork:) withObject:art waitUntilDone:NO];
+        // Go ahead and load up the art work
+        NSURL * artUrl = [NSURL URLWithString:[anURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+
+        // Don't attempt to fetch artwork from remote. Core will do that alone
+        if ([artUrl isFileURL])
+            art  = [[[NSImage alloc] initWithContentsOfURL:artUrl] autorelease]; 
     }
 
+    // If anything was found, lets save it to the meta data dictionary
+    [self performSelectorOnMainThread:@selector(setArtwork:) withObject:art waitUntilDone:NO];
+
     [pool release];
 }
 
 - (void)setArtwork:(NSImage *)art
 {
+    if (!art)
+    {
+        [metaDictionary removeObjectForKey:@"artwork"];
+        return;
+    }
+
     [metaDictionary setObject:art forKey:@"artwork"];
 }
 
index 202b38e..765c0c5 100644 (file)
     [self setNeedsDisplayOnBoundsChange:YES];
 
     [CATransaction commit];
+
+    /* Trigger by hand, as it doesn't go through else. Assumed bug from Cocoa */
+    [self willChangeValueForKey:@"hasVideo"];
     self.hasVideo = YES;
+    [self didChangeValueForKey:@"hasVideo"];
 }
 
 - (void)removeVoutLayer:(CALayer*)voutLayer
     [CATransaction begin];
     [voutLayer removeFromSuperlayer];
     [CATransaction commit];
+    
+    /* Trigger by hand, as it doesn't go through else. Assumed bug from Cocoa */
+    [self willChangeValueForKey:@"hasVideo"];
     self.hasVideo = NO;
+    [self didChangeValueForKey:@"hasVideo"];
 }
 
 @end
index 2674d0a..4aba302 100644 (file)
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "top_srcdir=`pwd`/../../..\n\nif test $ACTION = \"clean\"\nthen\n    rm -f $SYMROOT/vlc_build_dir/CMakeLists.txt\n    exit 0\nfi\n\necho \"$SRCROOT/../../../CMakeLists.txt doesn't exists\"\ncd $top_srcdir && ./extras/buildsystem/cmake/scripts/convert_vlc_to_cmake.sh\n";
+                       shellScript = "top_srcdir=`pwd`/../../..\n\nif test $ACTION = \"clean\"\nthen\n    rm -f $SYMROOT/vlc_build_dir/CMakeLists.txt\n    exit 0\nfi\n\ncd $top_srcdir && ./extras/buildsystem/cmake/scripts/convert_vlc_to_cmake.sh\n";
                        showEnvVarsInLog = 0;
                };
                633BD6E30D2ADF030012A314 /* ShellScript */ = {
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "echo $ACTION\nif test $ACTION = \"clean\"\nthen\n\trm -Rf $SYMROOT/vlc_build_dir\n     exit 0\nfi\n\ntop_srcdir=`pwd`/../../..\n\nif ! test -e $SYMROOT/vlc_build_dir/CMakeCache.txt\nthen\n\tmkdir -p $SYMROOT/vlc_build_dir\n\trm -Rf $top_srcdir/CMakeCache.txt\n\tcd $SYMROOT/vlc_build_dir && $top_srcdir/extras/contrib/bin/cmake $top_srcdir -DENABLE_NO_SYMBOL_CHECK=ON\nfi";
+                       shellScript = "if test $ACTION = \"clean\"\nthen\n\trm -Rf $SYMROOT/vlc_build_dir\n     exit 0\nfi\n\ntop_srcdir=`pwd`/../../..\n\nif ! test -e $SYMROOT/vlc_build_dir/CMakeCache.txt\nthen\n\tmkdir -p $SYMROOT/vlc_build_dir\n\trm -Rf $top_srcdir/CMakeCache.txt\n\tcd $SYMROOT/vlc_build_dir && $top_srcdir/extras/contrib/bin/cmake $top_srcdir -DENABLE_NO_SYMBOL_CHECK=ON\nfi";
                        showEnvVarsInLog = 0;
                };
                EF78BD2E0CAEEF9500354E6E /* ShellScript */ = {