title: How to maintain captured video size when using AVCaptureVideoPreviewLayer
body: <p>When using AVCaptureSession to show camera image to a small preview layer (AVCaptureVideoPreviewLayer), the image is scaled to fit the layer size.</p>
  
  <p>In order to fill all the preview layer, this scaling is configurable by setting:</p>
  
  <pre><code>previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
  </code></pre>
  
  <p>The problem is that this will only resize to fill the layer and as the camera image is very large, the image is resized becoming too small.</p>
  
  <p>what i am looking for is a way to have my preview layer showing the same level of scale of the builtin camera, discarding the remaining image (imagine the device camera masked, only showing a square in the middle of the screen).</p>
  
  <p>I have also tried changing capture Presets by issuing multiple presets, to no avail:</p>
  
  <pre><code>AVCaptureSession *session = [[AVCaptureSession alloc]init];
  session.sessionPreset = AVCaptureSessionPresetMedium; 
  </code></pre>