Camera2 Set Fixed Resolution

一笑奈何 提交于 2019-12-10 11:47:19

问题


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.


回答1:


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

For example,

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


来源:https://stackoverflow.com/questions/48779655/camera2-set-fixed-resolution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!