Froyo/2.2 中模拟器的相机内置应用程序错误? [英] Emulator's camera built-in app buggy in Froyo / 2.2?

查看:18
本文介绍了Froyo/2.2 中模拟器的相机内置应用程序错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

模拟器的相机在 2.1 Eclair 中可以很好地拍照.显然,录制视频不起作用.
现在运行一个在 2.1 模拟器上运行完美的应用程序会导致相机应用程序崩溃.我打算启动它:

the Emulator's camera worked fine for taking pictures in 2.1 Eclair. What did not work was recording videos, obviously.
Now running an app which worked merely flawless on 2.1 Emulator causes the camera app to crash. I fire up an intent to launch it:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(TEMP_PHOTO_FILE)));
startActivityForResult(intent, REQUEST_CAMERA);

这会启动相机应用,但几秒钟后它会崩溃.输出是:

This starts the camera app but after a few seconds it crashes. The output is:

06-01 09:57:15.593: DEBUG/libEGL(5212): egl.cfg not found, using default config
06-01 09:57:15.593: DEBUG/libEGL(5212): loaded /system/lib/egl/libGLES_android.so
06-01 09:57:15.733: ERROR/AndroidRuntime(5212): FATAL EXCEPTION: GLThread 11
06-01 09:57:15.733: ERROR/AndroidRuntime(5212): java.lang.IllegalArgumentException: No configs match configSpec
06-01 09:57:15.733: ERROR/AndroidRuntime(5212):     at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:760)
06-01 09:57:15.733: ERROR/AndroidRuntime(5212):     at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:916)
06-01 09:57:15.733: ERROR/AndroidRuntime(5212):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246)
06-01 09:57:15.733: ERROR/AndroidRuntime(5212):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

实际上,我只是想看看是否已在 FroYo 中修复了即使指定了 EXTRA_OUTPUT 也会让您从相机接收到小图像的错误.不幸的是,我什至无法对其进行测试.
有没有人遇到过类似的问题?

Actually I just wanted to see if the bug which made you receive a small image from the camera even though EXTRA_OUTPUT was specified has been fixed in FroYo. Unfortunately, I don't even get to test it.
Does anyone run into similiar issues?

谢谢,
斯特夫

推荐答案

看起来相机请求的 EGLConfig 与 Froyo 中的 s/w GL 渲染器当前支持的 EGLConfig 之间存在不匹配.看看您是否可以请求 RGB565 EGL 配置.

It looks there's a mistmatch between the EGLConfig the Camera is requesting and the EGLConfigs currently supported by the s/w GL renderer that comes in Froyo. See if you can request an RGB565 EGL Config.

此外,以下更改对我有用.它基本上从 EGLConfig 中删除了 Stencil 缓冲区,因为 Froyo 的 s/w GL 渲染器似乎根本不支持该配置.如果您在 Droid 等真实设备上进行测试,请重新添加原始配置.

Moreover, the below changes worked for me. It basically remove the Stencil buffer out of the EGLConfig as that configuration seems to be not supported at all in the s/w GL renderer in Froyo. Add the original config back if you're testing on real devices such as the Droid.

diff --git a/src/com/android/camera/ui/GLRootView.java b/src/com/android/camera/ui/GLRootView.java
索引 d8ae0f8..545c66a

diff --git a/src/com/android/camera/ui/GLRootView.java b/src/com/android/camera/ui/GLRootView.java
index d8ae0f8..545c66a

--- a/src/com/android/camera/ui/GLRootView.java  
+++ b/src/com/android/camera/ui/GLRootView.java  
@@ -174,7 +174,8 @@ public class GLRootView extends GLSurfaceView  

     private void initialize() {  
         mFlags |= FLAG_INITIALIZED;  
-        setEGLConfigChooser(8, 8, 8, 8, 0, 4);  
+        setEGLConfigChooser(8, 8, 8, 8, 0, 0);  
         getHolder().setFormat(PixelFormat.TRANSLUCENT);  
         setZOrderOnTop(true);  

这篇关于Froyo/2.2 中模拟器的相机内置应用程序错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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