当拍摄的照片CWAC相机崩溃 [英] Cwac-camera crash when picture taken

查看:340
本文介绍了当拍摄的照片CWAC相机崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的照片是通过拍摄 takePicture()功能,CWAC相机崩溃(取决于设备上,Desire HD的,在Nexus S的崩溃不错的选择)。

参照这篇文章:<一href=\"http://stackoverflow.com/questions/3890381/camera-setparameters-failed-in-android\">camera.setParameters失败的Andr​​oid

我想知道如何与CWAC相机做到这一点。

回溯:

  20 07-03:58:57.207 24659-24659 / com.xxxxxx E / AndroidRuntime:致命异常:主要
    了java.lang.RuntimeException:setParameters失败
    在android.hardware.Camera.native_setParameters(本机方法)
    在android.hardware.Camera.setParameters(Camera.java:1410)
    在com.commonsware.cwac.camera.CameraView $ OnOrientationChange.onOrientationChanged(CameraView.java:413)
    在android.view.OrientationEventListener$SensorEventListenerImpl.onSensorChanged(OrientationEventListener.java:143)
    在android.hardware.SystemSensorManager $ ListenerDelegate $ 1.handleMessage(SystemSensorManager.java:204)
    在android.os.Handler.dispatchMessage(Handler.java:99)
    在android.os.Looper.loop(Looper.java:137)
    在android.app.ActivityThread.main(ActivityThread.java:4745)
    在java.lang.reflect.Method.invokeNative(本机方法)
    在java.lang.reflect.Method.invoke(Method.java:511)
    在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:786)
    在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    在dalvik.system.NativeStart.main(本机方法)


解决方案

这崩溃不是从即将takePicture()。如果你看一下堆栈跟踪,你不会看到 takePicture()。相反,这是从一个方向改变未来。具体而言,您似乎有锁定到定向装置,引​​起 CameraView 使用传感器来检测设备的方向,试图调整相机设置,我们正在那里死去

如果你能重现此问题的演示程序,请文件与问题步骤重现它,因为我不能演示程序重现它在Nexus S的。

如果您不能重现此问题的演示应用程序,你可以发布一个重现的测试案例,请的文件与源$ C ​​$ c将重现测试用例的一个问题。

否则,你将不得不希望您遇到的相关问题这问题接通相机与Nexus S的,然后再希望我能弄清楚,是什么问题。

When my picture is taken via takePicture() function, Cwac-camera crash (depending device, work well on Desire HD, crash on Nexus S).

Referring to this post : camera.setParameters failed in android

I would like to know how to do this with Cwac-camera.

Backtrace:

07-03 20:58:57.207  24659-24659/com.xxxxxx                    E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.RuntimeException: setParameters failed
    at android.hardware.Camera.native_setParameters(Native Method)
    at android.hardware.Camera.setParameters(Camera.java:1410)
    at com.commonsware.cwac.camera.CameraView$OnOrientationChange.onOrientationChanged(CameraView.java:413)
    at android.view.OrientationEventListener$SensorEventListenerImpl.onSensorChanged(OrientationEventListener.java:143)
    at android.hardware.SystemSensorManager$ListenerDelegate$1.handleMessage(SystemSensorManager.java:204)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4745)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)

解决方案

This crash is not coming from takePicture(). If you look at the stack trace, you will not see takePicture(). Instead, this is coming from an orientation change. Specifically, you appear to have the device locked to an orientation, causing CameraView to use sensors to detect the device orientation to try to adjust the camera settings, and we're dying there.

If you can reproduce this problem with the demo app, please file an issue with the steps to reproduce it, as I cannot reproduce it on a Nexus S with the demo app.

If you cannot reproduce this problem with the demo app, and you can publish a reproducible test case, please file an issue with the source code to the reproducible test case.

Otherwise, you will have to hope that the problem that you are experiencing is related to this issue on switching cameras with the Nexus S, and then further hope that I can figure out what that problem is.

这篇关于当拍摄的照片CWAC相机崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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