开发者

Cocoa QTKit resolution problem

开发者 https://www.devze.com 2023-02-16 21:36 出处:网络
Based on a lot of online references, the way to change resolution is using the following code. NSDictionary * pixelBufferAttr = [NSDictionary dictionaryWithObjectsAndKeys:

Based on a lot of online references, the way to change resolution is using the following code.

NSDictionary * pixelBufferAttr = [NSDictionary dictionaryWithObjectsAndKeys:
     [NSNumber numberWithInt:320], kCVPixelBufferWidthKey,
     [NSNumber numberWithInt:240], kCVPixelBufferHeightKey,
     [NSNumbernumberWithBool:YES], 
                  (id)kCVPixelBufferOpenGLCompatibilityKey,
     [NSNumber 
        numberWithUnsignedInt:kCVPixelFormatType_422YpCbCr8],
                  (id)kCVPixelBufferPixelFormatTypeKey,
                                        nil];

NSArray *outputsConnected = [mCaptureSession outputs];

QTCaptureVideoPreviewOutput * previewOutput = [outputsConnected objectAtIndex:1];

[previewOutput setDelegate:self];

[previewOutput setPixelBufferAttributes:pixelBufferAttr];

But after changing the resolution, the captureView can se开发者_如何转开发e the different, but using code to check the resolution is incorrect.

Does anyone know how to change the device resolution?

Thanks ALL!

0

精彩评论

暂无评论...
验证码 换一张
取 消