From 9271ec92f7bcb9e48f78e00f0a50465ee3d12e01 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 22 Feb 2010 18:38:36 +0100 Subject: [PATCH] test test test --- src/jsparser.cpp | 2 ++ xcode/CVFileInputController.mm | 38 ++++++++++++++++++++++++++- xcode/CVGrabber.mm | 6 +++-- xcode/CVLayerController.mm | 2 ++ xcode/config.h | 2 +- xcode/freej.xcodeproj/project.pbxproj | 12 ++++----- 6 files changed, 51 insertions(+), 11 deletions(-) diff --git a/src/jsparser.cpp b/src/jsparser.cpp index 66155a98..a7946598 100644 --- a/src/jsparser.cpp +++ b/src/jsparser.cpp @@ -22,6 +22,8 @@ * */ +#define PREFIX "/usr" + #include diff --git a/xcode/CVFileInputController.mm b/xcode/CVFileInputController.mm index c553439c..1f51dc13 100644 --- a/xcode/CVFileInputController.mm +++ b/xcode/CVFileInputController.mm @@ -182,6 +182,7 @@ static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, layer = new CVLayer(self); layer->init(); } +#if 0 NSArray* videoTracks = [qtMovie tracksOfMediaType:QTMediaTypeVideo]; QTTrack* firstVideoTrack = [videoTracks objectAtIndex:0]; QTMedia* media = [firstVideoTrack media]; @@ -192,6 +193,8 @@ static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, NSLog(@"duration: %@ sampleCount: %lld timeScale: %lld", QTStringFromTime(qtTimeDuration) , sampleCount, timeScale); NSLog(@"frames: %d\n", (qtTimeDuration.timeValue/timeScale)/sampleCount); // layer->fps.set([rate floatValue]); + +#endif } [lock unlock]; @@ -233,6 +236,7 @@ static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, return isPlaying; } +#if 0 - (CVTexture *)getTexture { CVTexture *ret; @@ -242,6 +246,7 @@ static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, [(CVFileInputController *)self task]; return ret; } +#endif - (BOOL)getFrameForTime:(const CVTimeStamp *)timeStamp { @@ -255,6 +260,7 @@ static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, if (!qtMovie) return NO; +#if 0 // new broken implemenation uint64_t ts = CVGetCurrentHostTime(); QTTime now = [qtMovie currentTime]; @@ -283,10 +289,40 @@ static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, newFrame = YES; MoviesTask([qtMovie quickTimeMovie], 0); } +#else + QTTime now = [qtMovie currentTime]; + // TODO - check against real hosttime to skip frames instead of + // slowing down playback + now.timeValue+=(now.timeScale/layer->fps.fps); + QTTime duration = [qtMovie duration]; + if (QTTimeCompare(now, duration) == NSOrderedAscending) + [qtMovie setCurrentTime:now]; + else + [qtMovie gotoBeginning]; + if(qtVisualContext) + { + QTVisualContextCopyImageForTime(qtVisualContext, + NULL, + NULL, + &newPixelBuffer); + + // rendering (aka: applying filters) is now done in getTexture() + // implemented in CVLayerView (our parent) + + rv = YES; + if (currentFrame) + CVOpenGLTextureRelease(currentFrame); + currentFrame = newPixelBuffer; + newFrame = YES; + + } +#endif [lock unlock]; - [QTMovie exitQTKitOnThread]; + [QTMovie exitQTKitOnThread]; +#if 0 // new broken implementation lastPTS = ts; +#endif [pool release]; return rv; } diff --git a/xcode/CVGrabber.mm b/xcode/CVGrabber.mm index 883d8afa..7e0ee5df 100644 --- a/xcode/CVGrabber.mm +++ b/xcode/CVGrabber.mm @@ -87,7 +87,7 @@ /* Hack - using ma resolution seems to lower cpu consuption for some reason */ int h = (height < CV_GRABBER_HEIGHT_MAX)?height:CV_GRABBER_HEIGHT_MAX; int w = (width < CV_GRABBER_WIDTH_MAX)?width:CV_GRABBER_WIDTH_MAX; - + bool ret = false; device = [QTCaptureDevice defaultInputDeviceWithMediaType: QTMediaTypeVideo]; if( !device ) { @@ -123,7 +123,7 @@ session = [[QTCaptureSession alloc] init]; - bool ret = [session addInput:input error: &o_returnedError]; + ret = [session addInput:input error: &o_returnedError]; if( !ret ) { error( "default video capture device could not be added to capture session (%i)", [o_returnedError code] ); @@ -202,6 +202,8 @@ error: exportedFrame = nil; currentFrame = nil; + NSLog(@"MADONNA!!! \n"); + return [super init]; } diff --git a/xcode/CVLayerController.mm b/xcode/CVLayerController.mm index 73a9a4e1..70a27086 100644 --- a/xcode/CVLayerController.mm +++ b/xcode/CVLayerController.mm @@ -327,6 +327,7 @@ static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, [filterParams setValue:[NSNumber numberWithFloat:[sender floatValue]] forKey:[sender toolTip]]; break; case 100: + { NSString *filterName = [NSString stringWithFormat:@"CI%@", [[sender selectedItem] title]]; //NSLog(filterName); [effectFilter release]; @@ -378,6 +379,7 @@ static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, cView = slider; } break; + } case 101: paramName = [sender toolTip]; if ([paramName isEqual:@"CenterX"]) { diff --git a/xcode/config.h b/xcode/config.h index ac37110a..78ce44f9 100644 --- a/xcode/config.h +++ b/xcode/config.h @@ -215,7 +215,7 @@ #define WITH_FREI0R 1 -#define BUILD_NUMBER 10 +#define BUILD_NUMBER 34 #define OSX_VERSION 0.99 diff --git a/xcode/freej.xcodeproj/project.pbxproj b/xcode/freej.xcodeproj/project.pbxproj index cfb5555a..b8b9e589 100644 --- a/xcode/freej.xcodeproj/project.pbxproj +++ b/xcode/freej.xcodeproj/project.pbxproj @@ -1180,7 +1180,6 @@ GCC_MODEL_TUNING = ""; GCC_UNROLL_LOOPS = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( ../lib, /usr/local/include/js, @@ -1213,15 +1212,17 @@ /usr/local/lib, /opt/local/lib, ); + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-fexceptions", "-headerpad_max_install_names", + "-m32", + "-g", ); OTHER_LDFLAGS = "-headerpad_max_install_names"; PREBINDING = YES; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; STRIP_INSTALLED_PRODUCT = NO; - STRIP_STYLE = all; VALID_ARCHS = i386; }; name = Debug; @@ -1229,10 +1230,7 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - ppc, - i386, - ); + ARCHS = i386; GCC_ALTIVEC_EXTENSIONS = YES; GCC_AUTO_VECTORIZATION = YES; GCC_CW_ASM_SYNTAX = NO; @@ -1246,7 +1244,6 @@ GCC_OPTIMIZATION_LEVEL = 3; GCC_UNROLL_LOOPS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( ../lib, /usr/local/include/js, @@ -1279,6 +1276,7 @@ /usr/local/lib, /opt/local/lib, ); + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-fexceptions", "-headerpad_max_install_names",