开发者

Front-facing camera on LG Optimus 2X Speed

开发者 https://www.devze.com 2023-02-25 12:33 出处:网络
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:

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);
m开发者_JAVA百科Camera.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.


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消