From 38aa1fc41475eb38fcae87abdb346822e574bbbc Mon Sep 17 00:00:00 2001 From: Michael Grzeschik Date: Tue, 9 May 2023 00:50:41 +0200 Subject: [PATCH] uvcsink: configfs.c: refactor location of GUID formats - move GUID handling to beginning Part-of: --- .../gst-plugins-bad/sys/uvcgadget/configfs.c | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/uvcgadget/configfs.c b/subprojects/gst-plugins-bad/sys/uvcgadget/configfs.c index aa41e97c76..0863bb7751 100644 --- a/subprojects/gst-plugins-bad/sys/uvcgadget/configfs.c +++ b/subprojects/gst-plugins-bad/sys/uvcgadget/configfs.c @@ -24,6 +24,34 @@ #include "configfs.h" +/* ------------------------------------------------------------------------ + * GUIDs and formats + */ + +#define UVC_GUID_FORMAT_MJPEG \ + { 'M', 'J', 'P', 'G', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_YUY2 \ + { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} + +struct uvc_function_format_info +{ + uint8_t guid[16]; + uint32_t fcc; +}; + +static struct uvc_function_format_info uvc_formats[] = { + { + .guid = UVC_GUID_FORMAT_YUY2, + .fcc = V4L2_PIX_FMT_YUYV, + }, + { + .guid = UVC_GUID_FORMAT_MJPEG, + .fcc = V4L2_PIX_FMT_MJPEG, + }, +}; + /* ----------------------------------------------------------------------------- * Path handling and support */ @@ -241,34 +269,6 @@ udc_find_video_device (const char *udc, const char *function) return video; } -/* ------------------------------------------------------------------------ - * GUIDs and formats - */ - -#define UVC_GUID_FORMAT_MJPEG \ - { 'M', 'J', 'P', 'G', 0x00, 0x00, 0x10, 0x00, \ - 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} -#define UVC_GUID_FORMAT_YUY2 \ - { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \ - 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} - -struct uvc_function_format_info -{ - uint8_t guid[16]; - uint32_t fcc; -}; - -static struct uvc_function_format_info uvc_formats[] = { - { - .guid = UVC_GUID_FORMAT_YUY2, - .fcc = V4L2_PIX_FMT_YUYV, - }, - { - .guid = UVC_GUID_FORMAT_MJPEG, - .fcc = V4L2_PIX_FMT_MJPEG, - }, -}; - /* ----------------------------------------------------------------------------- * Legacy g_webcam support */