android camera size,Android Camera2 Output sizes

I have tested new Camera2 API on Android Lollipop. I want to fetch supported preview size: StreamConfigurationMap streamConfigurationMap = cameraCharacteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); Size[] sizes = streamConfigurationMap.getOutputSizes(SurfaceTexture.class);

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.

I tested old Camera API that is deprecated. Camera.Parameters parameters = camera.getParameters(); List sizes = parameters.getSupportedPictureSizes();

And the code above returns 32 varius combinations of preview size such as: 2560x1920, 1920x1080, 1080x1920, 2560x2560 etc. In that case I am able to choose optimal size and display correct image.

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!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值