Changeset 1163 for branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDPlayer.m
- Timestamp:
- 02/23/10 16:48:16 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDPlayer.m
r1151 r1163 74 74 [asset release]; 75 75 [frameworkLoad release]; 76 [stopTimer invalidate]; 76 77 [super dealloc]; 77 78 } … … 95 96 - (BOOL)canPlay:(NSString *)path withError:(NSError **)error 96 97 { 97 NSLog(@"Testing can play");98 //NSLog(@"Testing can play"); 98 99 BOOL usable = [frameworkLoad openWithError:error]; 99 100 if(!usable) 100 101 return NO; 101 102 102 NSLog(@"Usable from %@ says %d", frameworkLoad, usable);103 //NSLog(@"Usable from %@ says %d", frameworkLoad, usable); 103 104 104 105 usable = [self initializeFrameworkWithError:error]; … … 137 138 138 139 case 2: //is volume 139 NSLog(@"%@, is a volume!", [theVolume lastPathComponent]);140 //NSLog(@"%@, is a volume!", [theVolume lastPathComponent]); 140 141 isVolume = YES; 141 142 break; 142 143 default: 143 NSLog(@"not a volume: %i, %@", fsType,[theVolume lastPathComponent]);144 //NSLog(@"not a volume: %i, %@", fsType,[theVolume lastPathComponent]); 144 145 isVolume = NO; 145 146 break; … … 197 198 if ([[mountPath lastPathComponent] isEqualToString:[theVolume lastPathComponent]]) 198 199 { 199 NSLog(@"%@ is a disc image", [theVolume lastPathComponent]);200 //NSLog(@"%@ is a disc image", [theVolume lastPathComponent]); 200 201 return YES; 201 202 } … … 251 252 NSURL *url = [NSURL URLWithString:[asset mediaURL]]; 252 253 NSString *path = [[url path] stringByAppendingPathComponent:@"VIDEO_TS"]; 253 NSLog(@"Going to play %@", path);254 //NSLog(@"Going to play %@", path); 254 255 255 256 BOOL ret = [frameworkLoad openWithError:error]; 256 NSLog(@"Framework usable is %d", ret);257 //NSLog(@"Framework usable is %d", ret); 257 258 if(!ret) 258 259 return NO; 259 260 ret = [self initializeFrameworkWithError:error]; 260 NSLog(@"Initialize is %d", ret);261 //NSLog(@"Initialize is %d", ret); 261 262 if(!ret) 262 263 return NO; … … 265 266 OSStatus resultz=[CMPDVDPlayer getFSRefAtPath:path ref:&fsRef]; 266 267 //OSStatus resultz = FSPathMakeRef((UInt8*)cPath, &fsRef, NULL); 267 NSLog(@"make path is %d", resultz);268 //NSLog(@"make path is %d", resultz); 268 269 OSStatus openError = resultz; 269 270 if(resultz == noErr) 270 271 openError = DVDOpenMediaFile(&fsRef); 271 272 272 NSLog(@"open error is %d", openError);273 //NSLog(@"open error is %d", openError); 273 274 return openError == noErr; 274 275 } … … 388 389 - (void)goToMenu 389 390 { 390 NSLog(@"Going to Menu");391 //NSLog(@"Going to Menu"); 391 392 if(DVDGoToMenu(kDVDMenuRoot) != noErr) 392 393 { … … 399 400 - (void)play 400 401 { 401 NSLog(@"Playing");402 //NSLog(@"Playing"); 402 403 DVDPlay(); 403 404 } … … 405 406 - (void)pause 406 407 { 407 NSLog(@"Pausing");408 //NSLog(@"Pausing"); 408 409 DVDPause(); 409 410 } … … 470 471 - (void)incrementScanRate 471 472 { 472 NSLog(@"Incrementing scan rate");473 //NSLog(@"Incrementing scan rate"); 473 474 //Really increment in terms of forward direction 474 475 DVDScanRate outRate; … … 476 477 477 478 DVDGetScanRate(&outRate, &outDirection); 478 NSLog(@"Scan rate in currently %d:%d", outDirection, outRate);479 //NSLog(@"Scan rate in currently %d:%d", outDirection, outRate); 479 480 DVDScanRate newRate; 480 481 if(outDirection == kDVDScanDirectionForward) … … 488 489 newRate = outRate; 489 490 } 490 NSLog(@"Scan rate in now %d:%d", outDirection, newRate);491 //NSLog(@"Scan rate in now %d:%d", outDirection, newRate); 491 492 DVDScan(newRate, outDirection); 492 493 } … … 494 495 - (void)decrementScanRate 495 496 { 496 NSLog(@"Decrementing scan rate");497 //NSLog(@"Decrementing scan rate"); 497 498 //Really decrement in terms of forward direction 498 499 DVDScanRate outRate; … … 500 501 501 502 DVDGetScanRate(&outRate, &outDirection); 502 NSLog(@"Scan rate in currently %d:%d", outDirection, outRate);503 //NSLog(@"Scan rate in currently %d:%d", outDirection, outRate); 503 504 DVDScanRate newRate; 504 505 if(outDirection == kDVDScanDirectionForward) … … 512 513 newRate = outRate; 513 514 } 514 NSLog(@"Scan rate in now %d:%d", outDirection, newRate);515 //NSLog(@"Scan rate in now %d:%d", outDirection, newRate); 515 516 DVDScan(newRate, outDirection); 516 517 } … … 625 626 - (void)nextChapter 626 627 { 627 NSLog(@"Going to next chapter");628 //NSLog(@"Going to next chapter"); 628 629 DVDNextChapter(); 629 630 } … … 631 632 - (void)previousChapter 632 633 { 633 NSLog(@"Going to previous chapter");634 //NSLog(@"Going to previous chapter"); 634 635 DVDPreviousChapter(); 635 636 } … … 689 690 //See if we can go SPDIF 690 691 OSStatus SPDIFresult = DVDGetAudioOutputModeCapabilities(&audioMode); 691 NSLog(@"SPDIF get is %d with mode %d", SPDIFresult, audioMode);692 //NSLog(@"SPDIF get is %d with mode %d", SPDIFresult, audioMode); 692 693 if(audioMode & kDVDAudioModeSPDIF) 693 694 { 694 695 //Engage the SPDIF interface 695 696 SPDIFresult = DVDSetAudioOutputMode(kDVDAudioModeSPDIF); 696 NSLog(@"Set to SPDIF with result %d", SPDIFresult);697 //NSLog(@"Set to SPDIF with result %d", SPDIFresult); 697 698 SPDIFresult = DVDSetSPDIFDataOutDevice(0); 698 NSLog(@"Set SPDIF device with result %d", SPDIFresult);699 //NSLog(@"Set SPDIF device with result %d", SPDIFresult); 699 700 } 700 701 … … 727 728 - (void)stopPlayback 728 729 { 729 NSLog(@"Stopping");730 //NSLog(@"Stopping"); 730 731 DVDUnregisterEventCallBack(eventCallbackID); 731 732 eventCallbackID = 0; … … 839 840 } 840 841 842 - (void)stopTimerFire 843 { 844 stopTimer = nil; 845 [controller playbackStopped]; 846 } 847 848 - (void)resetStopTimer 849 { 850 [stopTimer invalidate]; 851 stopTimer = [NSTimer scheduledTimerWithTimeInterval:5*60 target:self selector:@selector(stopTimerFire) userInfo:nil repeats:NO]; 852 } 853 841 854 - (void)titleChanged 842 855 { … … 847 860 - (void)titleTimeChanged 848 861 { 862 [self performSelectorOnMainThread:@selector(resetStopTimer) withObject:nil waitUntilDone:NO]; 849 863 UInt16 frames; 850 864 UInt32 time = 0; … … 1022 1036 { 1023 1037 OSStatus result = DVDInitialize(); 1024 NSLog(@"DVDInitialize: %d", result);1038 //NSLog(@"DVDInitialize: %d", result); 1025 1039 DVDEventCode eventCodes[] = { 1026 1040 kDVDEventDisplayMode, … … 1043 1057 (UInt32)self, 1044 1058 &eventCallbackID); 1045 NSLog(@"DVD Register Callbacks: %d", result);1059 //NSLog(@"DVD Register Callbacks: %d", result); 1046 1060 switch(result) 1047 1061 {
