|
|
86f512 |
From c04dd1ccf463ccd56ea1273e137206d2988d4acb Mon Sep 17 00:00:00 2001
|
|
|
86f512 |
From: Eugene Syromyatnikov <evgsyr@gmail.com>
|
|
|
86f512 |
Date: Fri, 1 Nov 2019 02:09:03 +0100
|
|
|
86f512 |
Subject: [PATCH 80/82] v4l2: provide struct v4l2_capability definition
|
|
|
86f512 |
|
|
|
86f512 |
* v4l2.c (struct_v4l2_capability): New typedef.
|
|
|
86f512 |
[HAVE_STRUCT_V4L2_CAPABILITY]: Check struct v4l2_capability
|
|
|
86f512 |
with CHECK_V4L2_STRUCT_RESERVED_SIZE.
|
|
|
86f512 |
(print_v4l2_capability): Change type of caps variable
|
|
|
86f512 |
to struct_v4l2_capability; drop HAVE_STRUCT_V4L2_CAPABILITY_DEVICE_CAPS
|
|
|
86f512 |
guarg; print device_caps field only if it's non-zero.
|
|
|
86f512 |
---
|
|
|
86f512 |
v4l2.c | 25 +++++++++++++++++++------
|
|
|
86f512 |
1 file changed, 19 insertions(+), 6 deletions(-)
|
|
|
86f512 |
|
|
|
86f512 |
diff --git a/v4l2.c b/v4l2.c
|
|
|
86f512 |
index 85c667d..292ebae 100644
|
|
|
86f512 |
--- a/v4l2.c
|
|
|
86f512 |
+++ b/v4l2.c
|
|
|
86f512 |
@@ -46,6 +46,19 @@
|
|
|
86f512 |
typedef struct v4l2_buffer struct_v4l2_buffer;
|
|
|
86f512 |
typedef struct v4l2_clip struct_v4l2_clip;
|
|
|
86f512 |
|
|
|
86f512 |
+
|
|
|
86f512 |
+typedef struct {
|
|
|
86f512 |
+ uint8_t driver[16];
|
|
|
86f512 |
+ uint8_t card[32];
|
|
|
86f512 |
+ uint8_t bus_info[32];
|
|
|
86f512 |
+ uint32_t version;
|
|
|
86f512 |
+ uint32_t capabilities;
|
|
|
86f512 |
+ uint32_t device_caps; /**< Added by v3.4-rc1~110^2^2~259 */
|
|
|
86f512 |
+ uint32_t reserved[3];
|
|
|
86f512 |
+} struct_v4l2_capability;
|
|
|
86f512 |
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_capability);
|
|
|
86f512 |
+
|
|
|
86f512 |
+
|
|
|
86f512 |
typedef struct {
|
|
|
86f512 |
uint32_t index;
|
|
|
86f512 |
uint32_t count;
|
|
|
86f512 |
@@ -146,7 +159,7 @@ print_pixelformat(uint32_t fourcc, const struct xlat *xlat)
|
|
|
86f512 |
static int
|
|
|
86f512 |
print_v4l2_capability(struct tcb *const tcp, const kernel_ulong_t arg)
|
|
|
86f512 |
{
|
|
|
86f512 |
- struct v4l2_capability caps;
|
|
|
86f512 |
+ struct_v4l2_capability caps;
|
|
|
86f512 |
|
|
|
86f512 |
if (entering(tcp))
|
|
|
86f512 |
return 0;
|
|
|
86f512 |
@@ -162,11 +175,11 @@ print_v4l2_capability(struct tcb *const tcp, const kernel_ulong_t arg)
|
|
|
86f512 |
caps.version & 0xFF);
|
|
|
86f512 |
printflags(v4l2_device_capabilities_flags, caps.capabilities,
|
|
|
86f512 |
"V4L2_CAP_???");
|
|
|
86f512 |
-#ifdef HAVE_STRUCT_V4L2_CAPABILITY_DEVICE_CAPS
|
|
|
86f512 |
- tprints(", device_caps=");
|
|
|
86f512 |
- printflags(v4l2_device_capabilities_flags, caps.device_caps,
|
|
|
86f512 |
- "V4L2_CAP_???");
|
|
|
86f512 |
-#endif
|
|
|
86f512 |
+ if (caps.device_caps) {
|
|
|
86f512 |
+ tprints(", device_caps=");
|
|
|
86f512 |
+ printflags(v4l2_device_capabilities_flags, caps.device_caps,
|
|
|
86f512 |
+ "V4L2_CAP_???");
|
|
|
86f512 |
+ }
|
|
|
86f512 |
tprints("}");
|
|
|
86f512 |
return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
}
|
|
|
86f512 |
--
|
|
|
86f512 |
2.1.4
|
|
|
86f512 |
|