mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +00:00
5d82deb2c5
This patch adds an element to stream video data to an uvc video gadget. The element handles the uvc events STREAMON, STREAMOFF, SETUP and DATA. to start, stop and configure the video buffer flow by the use of pad probes. It works with linux kernels of versions higher than v6.1. The element makes use of the v4l2sink proxy property v4l2sink::device to locate the corresponding device to parse the configfs for additional data. The code in uvc.c is basically derived from /lib/uvc.c in https://git.ideasonboard.org/uvc-gadget.git. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
39 lines
1.1 KiB
C
39 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
|
|
/*
|
|
* g_uvc.h -- USB Video Class Gadget driver API
|
|
*
|
|
* Copyright (C) 2009-2010 Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
*/
|
|
|
|
#ifndef __LINUX_USB_G_UVC_H
|
|
#define __LINUX_USB_G_UVC_H
|
|
|
|
#include <linux/ioctl.h>
|
|
#include <linux/types.h>
|
|
#include <linux/usb/ch9.h>
|
|
|
|
#define UVC_EVENT_FIRST (V4L2_EVENT_PRIVATE_START + 0)
|
|
#define UVC_EVENT_CONNECT (V4L2_EVENT_PRIVATE_START + 0)
|
|
#define UVC_EVENT_DISCONNECT (V4L2_EVENT_PRIVATE_START + 1)
|
|
#define UVC_EVENT_STREAMON (V4L2_EVENT_PRIVATE_START + 2)
|
|
#define UVC_EVENT_STREAMOFF (V4L2_EVENT_PRIVATE_START + 3)
|
|
#define UVC_EVENT_SETUP (V4L2_EVENT_PRIVATE_START + 4)
|
|
#define UVC_EVENT_DATA (V4L2_EVENT_PRIVATE_START + 5)
|
|
#define UVC_EVENT_LAST (V4L2_EVENT_PRIVATE_START + 5)
|
|
|
|
struct uvc_request_data {
|
|
__s32 length;
|
|
__u8 data[60];
|
|
};
|
|
|
|
struct uvc_event {
|
|
union {
|
|
enum usb_device_speed speed;
|
|
struct usb_ctrlrequest req;
|
|
struct uvc_request_data data;
|
|
};
|
|
};
|
|
|
|
#define UVCIOC_SEND_RESPONSE _IOW('U', 1, struct uvc_request_data)
|
|
|
|
#endif /* __LINUX_USB_G_UVC_H */
|