Commit bd257500 authored by Jakob Bornecrantz's avatar Jakob Bornecrantz Committed by Jakob Bornecrantz
Browse files

d/v4l2: Expose more information

parent fa274863
v4l2: Expose more information through new fields in XRT interface.
......@@ -740,7 +740,11 @@ v4l2_fs_node_destroy(struct xrt_frame_node *node)
}
struct xrt_fs *
v4l2_fs_create(struct xrt_frame_context *xfctx, const char *path)
v4l2_fs_create(struct xrt_frame_context *xfctx,
const char *path,
const char *product,
const char *manufacturer,
const char *serial)
{
struct v4l2_fs *vid = U_TYPED_CALLOC(struct v4l2_fs);
vid->base.enumerate_modes = v4l2_fs_enumerate_modes;
......@@ -753,6 +757,10 @@ v4l2_fs_create(struct xrt_frame_context *xfctx, const char *path)
vid->ll = debug_get_log_option_v4l2_log();
vid->fd = -1;
snprintf(vid->base.product, sizeof(vid->base.product), "%s", product);
snprintf(vid->base.manufacturer, sizeof(vid->base.manufacturer), "%s", manufacturer);
snprintf(vid->base.serial, sizeof(vid->base.serial), "%s", serial);
int fd = open(path, O_RDWR, 0);
if (fd < 0) {
V4L2_ERROR(vid, "Can not open '%s'", path);
......
......@@ -58,13 +58,19 @@ struct v4l2_source_descriptor
uint32_t rate;
};
/*!
* Create a v4l2 frameserver
*
* @ingroup drv_v4l2
*/
struct xrt_fs *
v4l2_fs_create(struct xrt_frame_context *xfctx, const char *path);
v4l2_fs_create(struct xrt_frame_context *xfctx,
const char *path,
const char *product,
const char *manufacturer,
const char *serial);
#ifdef __cplusplus
......
......@@ -758,7 +758,8 @@ open_video_device(struct xrt_prober *xp,
return -1;
}
struct xrt_fs *xfs = v4l2_fs_create(xfctx, pdev->v4ls[0].path);
struct xrt_fs *xfs =
v4l2_fs_create(xfctx, pdev->v4ls[0].path, pdev->usb.product, pdev->usb.manufacturer, pdev->usb.serial);
if (xfs == NULL) {
return -1;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment