mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-16 11:55:39 +00:00
d/v4l2: Expose more information
This commit is contained in:
parent
fa2748637a
commit
bd257500b8
1
doc/changes/drivers/mr.665.1.md
Normal file
1
doc/changes/drivers/mr.665.1.md
Normal file
|
@ -0,0 +1 @@
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue