Nexus 4 Camera preview aspect Ratio always requires 16x9 surfaceview? Why

前端 未结 3 1249
太阳男子
太阳男子 2021-02-19 16:20

Device Nexus 4 Android ver: 4.2.2

Hoping someone else has found this and can explain how to resolve it....

Nexus 4 supports the following preview sizes: -

<
3条回答
  •  盖世英雄少女心
    2021-02-19 16:35

    On the Nexus 4, there's an unfortunate issue where the preview aspect ratio and the still picture aspect ratio are tied together, even if you never take a picture. If they don't match, one of the two gets distorted (typically preview, since it is the lower resolution).

    If you want to use a 4:3 preview, configure the still picture size to be 4:3 as well, before starting preview. For example, 640x480 preview with a full 8MP picture size (3264 x 2448) on N4 should cause no stretching for preview.

    Use Camera.Parameters.setPictureSize to select the picture size; the list of available sizes can be read from Camera.Parameters.getSupportedPictureSizes.

提交回复
热议问题