简体   繁体   English

拍照时Cwac相机当机

[英]Cwac-camera crash when picture taken

When my picture is taken via takePicture() function, Cwac-camera crash (depending device, work well on Desire HD, crash on Nexus S). 通过takePicture()函数拍摄照片时,Cwac相机崩溃(取决于设备,在Desire HD上正常工作,在Nexus S上崩溃)。

Referring to this post : camera.setParameters failed in android 参考这篇文章: camera.setParameters在android中失败

I would like to know how to do this with Cwac-camera. 我想知道如何用Cwac相机做到这一点。

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() . 崩溃不是来自takePicture() If you look at the stack trace, you will not see takePicture() . 如果查看堆栈跟踪,则不会看到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. 具体来说,您似乎已将设备锁定在某个方向,导致CameraView使用传感器检测设备的方向以尝试调整相机设置,而我们正死在那里。

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. 如果您可以使用演示应用程序重现此问题,请提出重现该问题的步骤,因为我无法使用演示应用程序在Nexus S上重现该问题。

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. 否则,您将不得不希望自己遇到的问题与使用Nexus S切换摄像头时遇到的问题有关 ,然后再希望我能找出问题所在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM