问题描述
我工作的一个库,使摄像机
API开发人员更容易消耗。
I am working on a library to make the Camera
API easier for developers to consume.
在Droid难以置信2,在纵向模式下,使用后置摄像头,无法拍照。具体来说,我在LogCat中得到这个顺序:
The Droid Incredible 2, in portrait mode, using the rear-facing camera, fails to take a picture. Specifically, I get this sequence in LogCat:
08-18 09:25:52.094: E/QualcommCameraHardware(1368): native_get_picture: MSM_CAM_IOCTL_GET_PICTURE fd 25 error Connection timed out
08-18 09:25:52.094: E/QualcommCameraHardware(1368): getPicture failed!
08-18 09:25:52.094: E/QualcommCameraHardware(1368): get picture failed, giving jpeg callback with NULL data
这些消息出现〜5秒我打电话后, takePicture()
在摄像机
,它适合与一些老来源$ C $ C我看到 QualcommCameraHardware
,设置了一个5000毫秒超时的的ioctl()
打电话说话摄像头硬件。
Those messages occur ~5 seconds after I call takePicture()
on the Camera
, which fits with some old source code I see for QualcommCameraHardware
that sets up a 5000ms timeout on the ioctl()
call to speak to the camera hardware.
最终的结果是, onPictureTaken()
传递一个空
字节[]
的JPEG数据,这意味着我们没有任何照片。
The net result is that onPictureTaken()
is passed a null
byte[]
of JPEG data, meaning we have no photo.
本设备可与我的code在所有其他测试的配置,其中包括在纵向模式下工作的前置摄像头。
The device works with my code in all other tested configurations, including working in portrait mode with the front-facing camera.
有谁知道一些具体的,可能会导致这个特别的失败?
Does anyone know of something specific that might cause this particular failure?
更新
我无法再重现的错误。我想删除的问题,但是这显然是不可能的,一旦有答案。
I can no longer reproduce the error. I would delete the question, but that apparently is not possible once there are answers.
推荐答案
MSM_CAM_IOCTL_GET_PICTURE是运行功能的内核调用
MSM_CAM_IOCTL_GET_PICTURE is a kernel call which runs the function
static int msm_get_pic(struct msm_sync *sync, void __user *arg)
我下载的内核源从HTCdev您的设备,发现中定义的函数
I downloaded the kernel source for your device from the HTCdev and found the function defined in
drivers/media/video/msm/msm_camera-7x30.c
可以核对一下,当你拍照什么的内核消息?
Could check what are the kernel messages when you take a picture?
adb shell su -c "dmesg"
这篇关于来源QualcommCameraHardware native_get_picture的想法:MSM_CAM_IOCTL_GET_PICTURE连接超时错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!