title: Android Camera2Video Preview Issue
body: <p>I am using <code>Google's API</code> <code>Camera2Video</code> classes <code>Camera2VideoFragment</code> and <code>AutoFitTextureView</code> and I have a small problem. When I'm using the <code>preview</code> in a custom <code>FrameLayout</code>, it goes to the <code>left</code> corner.</p>
  
  <p>I have found a way to sretch the preview for it to fill the whole <code>framelayout</code> but as expected, it looks way too stretched. Perfect solution would be if there could be some black edges on corners and the screen would be in the middle. Also I dont think making the inflator to inflate the layout from the middle would help because there could be cases where the screen is big enough for the preview to fit properly and that being positioned in the middle would just ruin it.</p>
  
  <p>Link to <code>Google's Camera2Video API</code>: <a href="https://github.com/googlesamples/android-Camera2Video" rel="nofollow noreferrer">https://github.com/googlesamples/android-Camera2Video</a></p>
  
  <p>I created a simple <code>layout</code> to show what I get. (This is the only thing I have changed after downloading <code>Google's API</code>, and also removing the buttons that came with):</p>
  
  <p>The XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:id="@+id/container"
          android:layout_width="match_parent"
          android:layout_height="250dp"
          android:layout_marginBottom="8dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:background="#000"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          tools:context="com.example.android.camera2basic.CameraActivity" /&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>And a picture of what I'm seeing.</p>
  
  <p><a href="https://i.stack.imgur.com/ufsGb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ufsGb.png" alt="enter image description here"></a></p>