title: Android Camera2 Output sizes
body: <p>I have tested new Camera2 API on Android Lollipop. I want to fetch supported preview size:</p>
  
  <pre><code>StreamConfigurationMap streamConfigurationMap = cameraCharacteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
  Size[] sizes = streamConfigurationMap.getOutputSizes(SurfaceTexture.class);
  </code></pre>
  
  <p>and the maximum preview size is 1440x1080px on Samsung Galaxy Tab S that has 2560x1600px resolution. So my previewSize is 1440x1080px and TextureView surface size is 2560x1600px so image is distorted.</p>
  
  <p>I tested old Camera API that is deprecated.</p>
  
  <pre><code>Camera.Parameters parameters =  camera.getParameters();
  List&lt;Camera.Size&gt; sizes = parameters.getSupportedPictureSizes();
  </code></pre>
  
  <p>And the code above returns 32 varius combinations of preview size such as: <code>2560x1920</code>, <code>1920x1080</code>, <code>1080x1920</code>, <code>2560x2560</code> etc. In that case I am able to choose optimal size and display correct image.</p>
  
  <p>I do not know how to force new API to get optimal size. I know that the solution is to resize down view that displays preview, but built-in camera app works in fullscreen mode correctly.
  Thanks in advance for all suggestions!</p>