从前置摄像头获取数据时,我总是得到镜像图像,如何获得与预览窗口中看到的相同的图像。我已将 videoMirrored
设置为 TRUE
。以下是代码片段:
AVCaptureConnection *lConnection = nil;
for ( AVCaptureConnection *connection in [lHandle->m_output connections]) {
for ( AVCaptureInputPort *port in [connection inputPorts] ) {
if ( [[port mediaType] isEqual:AVMediaTypeVideo] ) {
lConnection = connection;
break;
}
}
}
if ([lConnection isVideoOrientationSupported])
[lConnection setVideoOrientation:AVCaptureVideoOrientationPortrait];
if ([lConnection isVideoMirroringSupported])
[lConnection setVideoMirrored:TRUE];
将 setVideoMirrored
更改为 True/False
也不会改变任何内容(isVideoMirroringSupported
返回成功)
supportsVideoMirroring
是否确实返回了 YES? - Tommy