基于大量在线参考,更改分辨率的方法是使用以下代码。
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];
但更改分辨率后,captureView
可以看到不同的内容,但使用代码检查分辨率是不正确的。
有谁知道如何更改设备分辨率?
全部谢谢!