BradLarson / GPUImage:当我将测试代码放在一个新的单个应用程序项目中时,如下所示,它不起作用

时间:2015-11-20 00:37:00

标签: gpuimage

使用默认的viewcontroller和mainstoryboard: 使用pod安装来设置库。 这是一个seggested Filtering实时视频测试代码,但它在我的iPhone6s上不起作用。

GPUImage

#import "ViewController.h"

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];


    GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
    enter code here
    videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;

   GPUImageFilterGroup *group=[[GPUImageAmatorkaFilter alloc] init];
    GPUImageFilter *customFilter=(GPUImageFilter *)[group filterAtIndex:0];

    NSLog(@"%lu",(unsigned long)[group filterCount]);



    GPUImageView *filteredVideoView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 375, 480)];

    [self.view addSubview:filteredVideoView];

    [videoCamera addTarget:customFilter];
    [customFilter addTarget:filteredVideoView];

    [videoCamera startCameraCapture];

}

@end

0 个答案:

没有答案