我AVCaptureVideoPreviewLayer
用来传递实时视频并openGL
实时应用着色器。在使用前置摄像头时,视频是镜像的,我想在应用着色器之前取消镜像它。
有人可以帮忙吗?
补充:切换到前置摄像头的代码:
-(void)showFrontCamera{
NSLog(@"inside showFrontCamera");
[captureSession removeInput:videoInput];
// Grab the front-facing camera
AVCaptureDevice *backFacingCamera = nil;
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
for (AVCaptureDevice *device in devices) {
if ([device position] == AVCaptureDevicePositionFront) {
backFacingCamera = device;
}
}
// Add the video input
NSError *error = nil;
videoInput = [[[AVCaptureDeviceInput alloc] initWithDevice:backFacingCamera error:&error] autorelease];
if ([captureSession canAddInput:videoInput]) {
[captureSession addInput:videoInput];
}
}