@@ -292,7 +292,7 @@ struct v4l2_device *v4l2_open(const char *devname)
* driver (>= v3.19) will set both CAPTURE and OUTPUT in the
* capabilities field.
*/
- capabilities = cap.device_caps ? : cap.capabilities;
+ capabilities = /* cap.device_caps ? : */ cap.capabilities;
if (capabilities & V4L2_CAP_VIDEO_CAPTURE)
dev->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
I can try to run it, but I guess I'll need kernel with camera support.
pavel@n900:/my/omap3-isp-live$ LD_LIBRARY_PATH=isp ./snapshot
media_open: Can't open media device /dev/media0
error: unable to open media device /dev/media0
Segmentation fault (core dumped)
I tried again on kernel with camera:
pavel@n900:/my/omap3-isp-live$ LD_LIBRARY_PATH=isp ./snapshot
error: unable to locate sensor.
Segmentation fault (core dumped)
pavel@n900:/my/omap3-isp-live$
Here's the fix for coredump:
@@ -75,6 +75,8 @@ int v4l2_subdev_open(struct media_entity *entity)
void v4l2_subdev_close(struct media_entity *entity)
{
+ if (!entity)
+ return;
if (entity->fd == -1)
return;