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!
精彩评论