Front-facing camera on LG Optimus 2X Speed

佐手、 提交于 2019-12-11 08:49:57

问题


I've gotten the front-facing camera to work on a Samsung Galaxy S, but the following technique doesn't work on an LG Optimus 2X Speed:

Camera mCamera = Camera.open();
Camera.Parameters parameters = mCamera.getParameters();
parameters.set("camera-id", 2);
mCamera.setParameters(parameters);

The above code still only displays video from the back-facing camera. The Camera app supports switching cameras, and it even comes bundled with a "Mirror" app.


回答1:


I revealed all the parameters using

Camera.Parameters parameters = mCamera.getParameters();
Log.d("camera", parameters.flatten());

Which revealed a field called camera-sensor. Surely enough, I got it working by specifying

parameters.set("camera-sensor", 1);
mCamera.setParameters(parameters);


来源:https://stackoverflow.com/questions/5673725/front-facing-camera-on-lg-optimus-2x-speed

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