- Timestamp:
- 02/18/10 18:59:01 (2 years ago)
- Location:
- branches/PlayerFramework/CommonMediaPlayer
- Files:
-
- 1 added
- 4 modified
-
Classes/CMPDefines.h (added)
-
Classes/CMPPlayerManager.h (modified) (1 diff)
-
Classes/CMPTypesDefines.h (modified) (1 diff)
-
CommonMediaPlayer.xcodeproj/project.pbxproj (modified) (6 diffs)
-
Info.plist (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/PlayerFramework/CommonMediaPlayer/Classes/CMPPlayerManager.h
r1107 r1144 40 40 41 41 @end 42 43 #ifdef FrameworkLoadDebug 44 #define FrameworkLoadPrint(...) NSLog(__VA_ARGS__) 45 #else 46 #define FrameworkLoadPrint(...) 47 #endif 48 49 static inline BOOL needCopy(NSString *frameworkPath) 50 { 51 NSFileManager *fm = [NSFileManager defaultManager]; 52 BOOL isDir = NO; 53 FrameworkLoadPrint(@"Checking if dir exists"); 54 if(![fm fileExistsAtPath:frameworkPath isDirectory:&isDir] || !isDir) 55 return YES; 56 57 NSBundle *bundle = [NSBundle bundleWithPath:frameworkPath]; 58 NSString *plistPath = [bundle pathForResource:@"Info" ofType:@"plist"]; 59 NSDictionary *plist = [NSDictionary dictionaryWithContentsOfFile:plistPath]; 60 61 NSString *version = [plist objectForKey:@"CFBundleVersion"]; 62 FrameworkLoadPrint(@"Version is %@:%d compared to %d", version, [version intValue], CMPVersion); 63 if([version intValue] < CMPVersion) 64 return YES; 65 66 return NO; 67 } 68 69 static inline BOOL loadCMPFramework(NSString *frapPath) 70 { 71 NSString *frameworkPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Frameworks/CommonMediaPlayer.framework"]; 72 FrameworkLoadPrint(@"Path is at %@", frameworkPath); 73 BOOL neededCopy = needCopy(frameworkPath); 74 FrameworkLoadPrint(@"Need copy is %d", neededCopy); 75 if(neededCopy) 76 { 77 NSFileManager *fm = [NSFileManager defaultManager]; 78 FrameworkLoadPrint(@"Going to copy %@", [frapPath stringByAppendingPathComponent:@"Contents/Frameworks/CommonMediaPlayer.framework"]); 79 BOOL success = [fm removeFileAtPath:frameworkPath handler:nil]; 80 FrameworkLoadPrint(@"Delete success is %d", success); 81 success = [fm copyPath:[frapPath stringByAppendingPathComponent:@"Contents/Frameworks/CommonMediaPlayer.framework"] toPath:frameworkPath handler:nil]; 82 FrameworkLoadPrint(@"Copy success is %d", success); 83 if(!success || needCopy(frameworkPath)) 84 //We failed in our copy too! 85 return NO; 86 } 87 88 NSBundle *framework = [NSBundle bundleWithPath:frameworkPath]; 89 FrameworkLoadPrint(@"Bundle is %@", framework); 90 if([framework isLoaded] && neededCopy) 91 { 92 //We should restart here 93 FrameworkLoadPrint(@"Need to restart"); 94 [[NSApplication sharedApplication] terminate:nil]; 95 } 96 97 FrameworkLoadPrint(@"Loading framework"); 98 return [framework load]; 99 } -
branches/PlayerFramework/CommonMediaPlayer/Classes/CMPTypesDefines.h
r1136 r1144 20 20 */ 21 21 22 #import "CMPDefines.h" 23 22 24 typedef enum{ 23 25 CMPPlayerManagerFileTypeQTCompatibleVideo = 0, -
branches/PlayerFramework/CommonMediaPlayer/CommonMediaPlayer.xcodeproj/project.pbxproj
r1136 r1144 50 50 F595C652111A70CD00C6C322 /* CMPBaseMediaAsset.h in Headers */ = {isa = PBXBuildFile; fileRef = F595C650111A70CD00C6C322 /* CMPBaseMediaAsset.h */; }; 51 51 F595C653111A70CD00C6C322 /* CMPBaseMediaAsset.m in Sources */ = {isa = PBXBuildFile; fileRef = F595C651111A70CD00C6C322 /* CMPBaseMediaAsset.m */; }; 52 F5FE4F18112E11D1007EC309 /* CMPDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = F5FE4F17112E11D1007EC309 /* CMPDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; 52 53 /* End PBXBuildFile section */ 53 54 … … 110 111 F595C650111A70CD00C6C322 /* CMPBaseMediaAsset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMPBaseMediaAsset.h; sourceTree = "<group>"; }; 111 112 F595C651111A70CD00C6C322 /* CMPBaseMediaAsset.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CMPBaseMediaAsset.m; sourceTree = "<group>"; }; 113 F5FE4F17112E11D1007EC309 /* CMPDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMPDefines.h; sourceTree = "<group>"; }; 112 114 /* End PBXFileReference section */ 113 115 … … 192 194 F595C650111A70CD00C6C322 /* CMPBaseMediaAsset.h */, 193 195 F595C651111A70CD00C6C322 /* CMPBaseMediaAsset.m */, 196 F5FE4F17112E11D1007EC309 /* CMPDefines.h */, 194 197 ); 195 198 path = Classes; … … 319 322 8768EBDC112A563800318F1A /* CMPDVDImporter.h in Headers */, 320 323 8768EC49112A5E4200318F1A /* AGProcess.h in Headers */, 324 F5FE4F18112E11D1007EC309 /* CMPDefines.h in Headers */, 321 325 ); 322 326 runOnlyForDeploymentPostprocessing = 0; … … 465 469 GCC_PREFIX_HEADER = "General Headers/CommonMediaPlayer_Prefix.pch"; 466 470 INFOPLIST_FILE = Info.plist; 471 INFOPLIST_PREFIX_HEADER = Classes/CMPDefines.h; 472 INFOPLIST_PREPROCESS = YES; 467 473 INSTALL_PATH = /System/Library/CoreServices/Finder.app/Contents/PlugIns/nitoTV.frappliance/Contents/Frameworks; 468 474 OTHER_LDFLAGS = ( … … 492 498 GCC_PREFIX_HEADER = "General Headers/CommonMediaPlayer_Prefix.pch"; 493 499 INFOPLIST_FILE = Info.plist; 500 INFOPLIST_PREFIX_HEADER = Classes/CMPDefines.h; 501 INFOPLIST_PREPROCESS = YES; 494 502 INSTALL_PATH = /System/Library/CoreServices/Finder.app/Contents/PlugIns/nitoTV.frappliance/Contents/Frameworks/; 495 503 OTHER_LDFLAGS = ( -
branches/PlayerFramework/CommonMediaPlayer/Info.plist
r1095 r1144 7 7 <key>CFBundleExecutable</key> 8 8 <string>${EXECUTABLE_NAME}</string> 9 <key>CFBundleName</key>10 <string>${PRODUCT_NAME}</string>11 9 <key>CFBundleIconFile</key> 12 10 <string></string> 13 11 <key>CFBundleIdentifier</key> 14 <string> com.yourcompany.${PRODUCT_NAME:rfc1034Identifier}</string>12 <string>net.nanopi.appletv.CommonMediaPlayer</string> 15 13 <key>CFBundleInfoDictionaryVersion</key> 16 14 <string>6.0</string> 15 <key>CFBundleName</key> 16 <string>${PRODUCT_NAME}</string> 17 17 <key>CFBundlePackageType</key> 18 18 <string>FMWK</string> 19 <key>CFBundleShortVersionString</key> 20 <string>1.0</string> 19 21 <key>CFBundleSignature</key> 20 22 <string>????</string> 21 23 <key>CFBundleVersion</key> 22 <string>1</string> 23 <key>CFBundleShortVersionString</key> 24 <string>1.0</string> 24 <string>CMPVersion</string> 25 25 <key>NSPrincipalClass</key> 26 26 <string></string>
