MacOSX/Framework: Implement VLCVideoLayer.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Wed, 2 Jan 2008 18:07:32 +0000 (18:07 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Wed, 2 Jan 2008 18:07:32 +0000 (18:07 +0000)
extras/MacOSX/Framework/Headers/Public/VLCMedia.h
extras/MacOSX/Framework/Headers/Public/VLCVideoLayer.h [new file with mode: 0644]
extras/MacOSX/Framework/Sources/VLCVideoLayer.m [new file with mode: 0644]
extras/MacOSX/Framework/VLC.xcodeproj/project.pbxproj

index ce3106f..c1d07a6 100644 (file)
@@ -108,7 +108,7 @@ typedef enum VLCMediaState
 @interface VLCMedia : NSObject
 {
     void *                p_md;              //< Internal media descriptor instance
-    NSString *            url;               //< URL for this media resource
+    NSString *            url;                  //< URL for this media resource
     VLCMediaList *        subitems;          //< Sub list of items
     VLCTime *             length;            //< Duration of the media
     NSMutableDictionary * metaDictionary;    //< Meta data storage
diff --git a/extras/MacOSX/Framework/Headers/Public/VLCVideoLayer.h b/extras/MacOSX/Framework/Headers/Public/VLCVideoLayer.h
new file mode 100644 (file)
index 0000000..01f2436
--- /dev/null
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * VLCVideoLayer.h: VLC.framework VLCVideoLayer header
+ *****************************************************************************
+ * Copyright (C) 2007 Pierre d'Herbemont
+ * Copyright (C) 2007 the VideoLAN team
+ * $Id: VLCVideoView.h 23915 2007-12-28 22:20:19Z pdherbemont $
+ *
+ * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import <QuartzCore/QuartzCore.h>
+
+@interface VLCVideoLayer : CALayer
+@end
diff --git a/extras/MacOSX/Framework/Sources/VLCVideoLayer.m b/extras/MacOSX/Framework/Sources/VLCVideoLayer.m
new file mode 100644 (file)
index 0000000..d51a9e3
--- /dev/null
@@ -0,0 +1,94 @@
+/*****************************************************************************
+ * VLCVideoLayer.m: VLC.framework VLCVideoLayer implementation
+ *****************************************************************************
+ * Copyright (C) 2007 Pierre d'Herbemont
+ * Copyright (C) 2007 the VideoLAN team
+ * $Id: VLCVideoView.m 24023 2008-01-02 02:52:35Z pdherbemont $
+ *
+ * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import "VLCVideoLayer.h"
+#import "VLCLibrary.h"
+#import "VLCEventManager.h"
+
+/* Libvlc */
+#include <vlc/vlc.h>
+#include <vlc/libvlc.h>
+
+#import <QuartzCore/QuartzCore.h>
+
+/******************************************************************************
+ * VLCVideoView (Private) 
+ */
+
+@interface VLCVideoLayer (Private)
+/* Method */
+- (void)addVoutLayer:(CALayer *)aLayer;
+@end
+
+/******************************************************************************
+ * Implementation VLCVideoLayer 
+ */
+
+@implementation VLCVideoLayer
+
++ (id)layer
+{
+    return [[CALayer alloc] init];
+}
+
+@end
+
+/******************************************************************************
+ * Implementation VLCVideoLayer  (Private)
+ */
+
+@implementation VLCVideoLayer (Private)
+
+/* This is called by the libvlc module 'opengllayer' as soon as there is one 
+ * vout available
+ */
+- (void)addVoutLayer:(CALayer *)aLayer
+{
+    [CATransaction begin];
+
+    aLayer.name = @"vlcopengllayer";
+
+    [self setLayoutManager:[CAConstraintLayoutManager layoutManager]];
+
+    [aLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMaxY
+                                       relativeTo:@"superlayer" attribute:kCAConstraintMaxY]];
+    [aLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMaxX
+                                       relativeTo:@"superlayer" attribute:kCAConstraintMaxX]];
+    [aLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinX
+                                       relativeTo:@"superlayer" attribute:kCAConstraintMinX]];
+    [aLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinY
+                                       relativeTo:@"superlayer" attribute:kCAConstraintMinY]];
+
+
+    [self insertSublayer:aLayer atIndex:0];
+
+    [aLayer setNeedsLayout];
+    [aLayer setNeedsDisplay];
+    [self setNeedsDisplay];
+    [self layoutIfNeeded];
+
+    [CATransaction commit];
+}
+
+@end
\ No newline at end of file
index 71b882f..8d64285 100644 (file)
@@ -49,6 +49,8 @@
 /* Begin PBXBuildFile section */
                6303C43A0CF45CAE0000ECC8 /* VLCMediaListAspect.m in Sources */ = {isa = PBXBuildFile; fileRef = 6303C4390CF45CAE0000ECC8 /* VLCMediaListAspect.m */; };
                6303C43C0CF45CC30000ECC8 /* VLCMediaListAspect.h in Headers */ = {isa = PBXBuildFile; fileRef = 6303C43B0CF45CC30000ECC8 /* VLCMediaListAspect.h */; settings = {ATTRIBUTES = (Public, ); }; };
+               6341FCAF0D2C0929002A97B7 /* VLCVideoLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6341FCAE0D2C0929002A97B7 /* VLCVideoLayer.h */; };
+               6341FCB10D2C0936002A97B7 /* VLCVideoLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6341FCB00D2C0936002A97B7 /* VLCVideoLayer.m */; };
                637D5ABD0CF6F2650073EA45 /* VLCMediaDiscoverer.h in Headers */ = {isa = PBXBuildFile; fileRef = 637D5ABC0CF6F2650073EA45 /* VLCMediaDiscoverer.h */; settings = {ATTRIBUTES = (Public, ); }; };
                637D5ADC0CF6F2720073EA45 /* VLCMediaDiscoverer.m in Sources */ = {isa = PBXBuildFile; fileRef = 637D5ADB0CF6F2720073EA45 /* VLCMediaDiscoverer.m */; };
                6384FD080D0DBA20005EB1F7 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6384FD070D0DBA20005EB1F7 /* QuartzCore.framework */; };
                63030CC70CCA652C0088ECD1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; name = Info.plist; path = Resources/Info.plist; sourceTree = "<group>"; };
                6303C4390CF45CAE0000ECC8 /* VLCMediaListAspect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCMediaListAspect.m; sourceTree = "<group>"; };
                6303C43B0CF45CC30000ECC8 /* VLCMediaListAspect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCMediaListAspect.h; path = Public/VLCMediaListAspect.h; sourceTree = "<group>"; };
+               6341FCAE0D2C0929002A97B7 /* VLCVideoLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCVideoLayer.h; path = Public/VLCVideoLayer.h; sourceTree = "<group>"; };
+               6341FCB00D2C0936002A97B7 /* VLCVideoLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCVideoLayer.m; sourceTree = "<group>"; };
                637D5ABC0CF6F2650073EA45 /* VLCMediaDiscoverer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = VLCMediaDiscoverer.h; path = Public/VLCMediaDiscoverer.h; sourceTree = "<group>"; };
                637D5ADB0CF6F2720073EA45 /* VLCMediaDiscoverer.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = VLCMediaDiscoverer.m; sourceTree = "<group>"; };
                6384FD070D0DBA20005EB1F7 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
                                6303C4390CF45CAE0000ECC8 /* VLCMediaListAspect.m */,
                                EF8BB8CF0CAFA8D80038A613 /* VLCMediaPlayer.m */,
                                EF78BD400CAEEFF600354E6E /* VLCMediaLibrary.m */,
+                               6341FCB00D2C0936002A97B7 /* VLCVideoLayer.m */,
                                EF78BD450CAEEFF600354E6E /* VLCVideoView.m */,
                                EF78BD440CAEEFF600354E6E /* VLCTime.m */,
                                EF73118F0CB5797B009473B4 /* VLCAudio.m */,
                                6303C43B0CF45CC30000ECC8 /* VLCMediaListAspect.h */,
                                EF8BB8CE0CAFA8D80038A613 /* VLCMediaPlayer.h */,
                                EF78BD150CAEEEE700354E6E /* VLCMediaLibrary.h */,
+                               6341FCAE0D2C0929002A97B7 /* VLCVideoLayer.h */,
                                EF78BD1A0CAEEEE700354E6E /* VLCVideoView.h */,
                                EF78BD190CAEEEE700354E6E /* VLCTime.h */,
                                EF73118E0CB5797B009473B4 /* VLCAudio.h */,
                                EF7311900CB5797B009473B4 /* VLCAudio.h in Headers */,
                                EFD551DD0CC6DD720074CEE1 /* VLCLibVLCBridging.h in Headers */,
                                637D5ABD0CF6F2650073EA45 /* VLCMediaDiscoverer.h in Headers */,
+                               6341FCAF0D2C0929002A97B7 /* VLCVideoLayer.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        dependencies = (
                        );
                        name = "vlc-core";
-                       passBuildSettingsInEnvironment = 1;
+                       passBuildSettingsInEnvironment = 0;
                        productName = "vlc-core";
                };
 /* End PBXLegacyTarget section */
                                EF7311910CB5797B009473B4 /* VLCAudio.m in Sources */,
                                6303C43A0CF45CAE0000ECC8 /* VLCMediaListAspect.m in Sources */,
                                637D5ADC0CF6F2720073EA45 /* VLCMediaDiscoverer.m in Sources */,
+                               6341FCB10D2C0936002A97B7 /* VLCVideoLayer.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };