Camera2设置固定分辨率 [英] Camera2 Set Fixed Resolution

查看:1536
本文介绍了Camera2设置固定分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Camera2 API通过Android Studio 2.3创建相机.请问是否可以在相机中设置固定的相机分辨率?如果可以的话,如何设置固定的相机分辨率?我真的是camera2和android studio的新手.我希望有一个人可以帮助我.非常感谢.

I am using Camera2 API for my creating camera using Android Studio 2.3.May I ask if it is possible to set a fixed camera resolution into my camera? And if it is possible how can I set a fixed camera resolution? I'm really new to camera2 and android studio. I hope someone can help me. Thank you very much.

推荐答案

是的,您可以使用固定分辨率.仅不要在不支持此相机分辨率的设备上运行此APK.

Yes, you can use fixed resolution. Only don't run this APK on devices that don't support this camera resolution.

例如

InputConfiguration inputConfiguration = new InputConfiguration(640, 480, ImageFormat.YUV_420_888);
cameraDevice.createReprocessableCaptureSession(inputConfiguration, outputs, callback, handler);

这篇关于Camera2设置固定分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆