我正在尝试为果酱框架编写 GPUImage 的扩展。为此,我使用了官方文档和扩展开发工具包 (EDK) Marmalade。我写了一些示例代码,编译:
mkb s3egpuimage_iphone.mkb --arm --release --compiler clang
它编译得很好,我得到了库和头文件,并与部署工具 marmmalade 建立了链接,并且链接完成得很好。但是我将 ipa 写入 iPod touch 并运行此代码,我得到或冻结应用程序或崩溃应用程序。我打电话的崩溃或冻结开始:
[videoCamera startCameraCapture]
当然我用
[[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
并轻松定位:
textureOutput = [[GPUImageTextureOutput alloc] init];
...
[videoCamera addTarget:textureOutput];
[videoCamera startCameraCapture];
NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie.m4v"];
unlink([pathToMovie UTF8String]);
NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie];
movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(480.0, 640.0)];
movieWriter.shouldPassthroughAudio = YES;
videoCamera.audioEncodingTarget = movieWriter;
[movieWriter startRecording];
我想这个,但我不明白。请问有你帮忙吗?