Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. AVCaptureConnection *lConnection = nil;
  2.  
  3. for ( AVCaptureConnection *connection in [lHandle->m_output connections]) {
  4. for ( AVCaptureInputPort *port in [connection inputPorts] ) {
  5. if ( [[port mediaType] isEqual:AVMediaTypeVideo] ) {
  6. lConnection = connection;
  7. break;
  8. }
  9. }
  10. }
  11. if ([lConnection isVideoOrientationSupported])
  12. [lConnection setVideoOrientation:AVCaptureVideoOrientationPortrait];
  13. if ([lConnection isVideoMirroringSupported])
  14. [lConnection setVideoMirrored:TRUE];
  15.  
  16. UIImage * flippedImage = [UIImage imageWithCGImage:picture.CGImage scale:picture.scale orientation:UIImageOrientationLeftMirrored];
  17.  
  18. let flippedImage = UIImage(CGImage: image.CGImage, scale: image.scale, orientation: .LeftMirrored)
  19.  
  20. // first get an UIImage from the front camera
  21. let sourceImg = UIImage(cgImage: image, scale: 1.0, orientation: .leftMirrored)
  22. return sourceImg.withHorizontallyFlippedOrientation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement