@@ -195,7 +195,7 @@ static int capture_enum_fmt_vid_cap(struct file *file, void *fh,
if (ret)
return ret;
} else {
- cc_src = imx_media_find_mbus_format(fmt_src.format.code,
+ cc_src = imx_media_find_mbus_format(f->mbus_code,
PIXFMT_SEL_ANY);
if (WARN_ON(!cc_src))
return -EINVAL;
@@ -740,7 +740,7 @@ static struct video_device capture_videodev = {
.release = video_device_release,
.vfl_dir = VFL_DIR_RX,
.tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM,
- .device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING,
+ .device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | V4L2_CAP_IO_MC,
};
Secondly, if one wants to test these patches with the gstreamer libcamerasrc, it
is also required to change the minimum buffers needed in the driver. The
libcamerasrc seems to have an issue that it only queues 1 buffer, thus
not starting the driver to stream. Applying this hunk to the kernel
works around this issue, although frame drops are probably to be expected:
@@ -1042,7 +1042,7 @@ int imx_media_capture_device_register(struct imx_media_video_dev *vdev)
vq->mem_ops = &vb2_dma_contig_memops;
vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
vq->lock = &priv->mutex;
- vq->min_buffers_needed = 2;
+ vq->min_buffers_needed = 1;
vq->dev = priv->dev;
ret = vb2_queue_init(vq);
Finally, add imx-media to the supported Devices in libcamera:
@@ -51,6 +51,7 @@ static const SimplePipelineInfo supportedDevices[] = {
{ "imx7-csi", "pxp" },
{ "qcom-camss", nullptr },
{ "sun6i-csi", nullptr },
+ { "imx-media", nullptr },
};
} /* namespace */