Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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];
- UIImage * flippedImage = [UIImage imageWithCGImage:picture.CGImage scale:picture.scale orientation:UIImageOrientationLeftMirrored];
- let flippedImage = UIImage(CGImage: image.CGImage, scale: image.scale, orientation: .LeftMirrored)
- // first get an UIImage from the front camera
- let sourceImg = UIImage(cgImage: image, scale: 1.0, orientation: .leftMirrored)
- return sourceImg.withHorizontallyFlippedOrientation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement