RuntimeException on Camera.setParameters()on nexus one [英] RuntimeException on Camera.setParameters() on nexus one

查看:154
本文介绍了RuntimeException on Camera.setParameters()on nexus one的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从这里的答案复制了代码,我仍然收到一个RuntimeException:setParameters失败的错误在我的nexus一。我的清单文件有摄像头和wake_lock权限。这在模拟器上工作,在droid上我没有得到错误,但它有一个旋转问题。

I copied the code from the answer here and I still am getting a RuntimeException: setParameters failed error on my nexus one. My manifest file has camera and wake_lock permissions. This works on the emulator, and on the droid I don't get the error but it does have a rotation problem.

推荐答案

您最有可能要求无效的预览大小。如果你检查 adb logcat 的结果,你可能会看到这样的结果:

You're most likely requsting an invalid preview size. If you check the results of adb logcat you'll probably see something like this:

E/QualcommCameraHardware(22732): Invalid preview size requested: 480x724

请求最接近的可用预览大小到您想要的;您可以通过在 getSupportedPreviewSizes 来获取可用预览大小的列表。由 Camera.Parameters 对象rel =nofollow noreferrer> Camera.getParameters 。

The solution is to request the closest available preview size to the one you'd like; you can get a list of available preview sizes by calling getSupportedPreviewSizes in the Camera.Parameters object returned by Camera.getParameters.

这篇关于RuntimeException on Camera.setParameters()on nexus one的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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