1
0
Fork 0
mirror of https://github.com/linux-usb-gadgets/libusbgx.git synced 2025-07-25 03:15:05 +03:00
Commit graph

17 commits

Author SHA1 Message Date
folkert van heusden
06b1bbdbc5 Fixes for some of the compile warnings (-Wall -pedantic). 2024-09-24 23:35:02 +02:00
Michael Grzeschik
c58b2c0f74 uvc: also set dwMinBitRate, dwMaxBitRate and dwDefaultFrameInterval on set_frame 2024-09-24 23:29:46 +02:00
Michael Grzeschik
c375c18fc3 uvc: really use dwMaxVideoFrameBufferSize on uvc_set_frame 2024-09-24 23:29:01 +02:00
Michael Grzeschik
3642d9c7a4 uvc: add more controls
When using uncompressed video formats other then the default
YUYV, the user of the uvc gadget needs to set the proper GUID
format. Together with that GUID format it is needed to set
an corresponding BitsPerPixel value. This patch is adding
support to set the values via libusbgx/gadget-tool.
2024-08-29 21:33:08 +02:00
Michael Grzeschik
48b96808ca uvc: fix property interlace flags 2024-08-26 11:03:33 +02:00
Michael Grzeschik
8b91dbb3da uvc: add isoc parameter settings
The functions config parameters like maxburst, maxpacket, interval
and function_name are possible to be set by scheme file
as well. This patch adds support to import and export
these variables.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2022-07-11 10:11:15 +02:00
Michael Grzeschik
50fe6a79bc uvc: fix init_formats function
The return value of scandir is used in init_frames to iterate over
the elements. The iteration is done over nmb not ret. So this patch
is fixing this to fill the right variable.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2022-07-11 10:10:55 +02:00
Michael Grzeschik
afec0d6e71 uvc: fix exporting attrs with layouts missing a format
When the one of the supported formats is missing in the
configfs layout, currently the export function will run
into an error. We fix it by just passing 0 if the format
is missing to keep on parsing.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2022-07-06 00:37:02 +02:00
Michael Grzeschik
20d7fe2bb9 uvc: fix unsigned nmb to int
Since snprintf returns int not unsigned we change the type of nmb.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2021-10-28 11:19:26 +02:00
Michael Grzeschik
157cbd83c6 uvc: fix return check on scandir
The function init_frames is falsely checking for the negative
result from scandir on an unsigned variable. This will never
be true.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2021-10-28 00:39:50 +02:00
Michael Grzeschik
53231c76f9 uvc: add import/export support
- tested with -Wall, -Wextra

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2021-10-26 14:08:44 +02:00
Michael Grzeschik
61a41862ab uvc: consistently use defines for common strings
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2021-10-26 14:08:44 +02:00
Michael Grzeschik
57dc1d5ae1 uvc: check attr pointer in set_attrs
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2021-10-26 14:08:44 +02:00
Michael Grzeschik
4061ffdaa4 uvc: remove unnedded USBG_UVC_MAX_PATH_LENGTH define
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2021-10-26 14:08:44 +02:00
Michael Grzeschik
1c94fb860a uvc: remove unused variable
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2021-10-26 14:08:44 +02:00
Michael Grzeschik
b28dd77810 uvc: fix compile warnings
tested with -Wall, -Wextra

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2021-10-26 14:08:44 +02:00
Thomas Haemmerle
52aa5ed5c9 libusbgx: Add UVC support
Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>

---
 v2 -> v3: - simplified exit paths of functions with returns instead of gotos
           - added cleanup code for remove
           - added gadget-uvc example file
           - simplified class link creation
           - added support for more than one format
 v3 -> v4:
           - fixed 4k resolution on gadget-uvc example
2021-05-10 23:23:20 +02:00