aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVandana BN <bnvandana@gmail.com>2019-09-25 14:44:26 +0530
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-10-04 13:29:17 +0200
commita52391af10c66f63a947298415880495cb58503d (patch)
tree6b7a68f5520724ea6b4d7b652cf525b38c444c9e
parent2f43a70765b775030a0e4d1a0ac28ec3dc5f16de (diff)
v4l2-compliance: Verify metadata formats
Metadata formats may not be defined for a given input or output type. This patch checks, if given input/output type enumerates metadata formats and validates G_FMT accordingly. Signed-off-by: Vandana BN <bnvandana@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-compliance/v4l2-test-formats.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp
index 826cb73f..b87e59c8 100644
--- a/utils/v4l2-compliance/v4l2-test-formats.cpp
+++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
@@ -305,8 +305,6 @@ int testEnumFormats(struct node *node)
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
case V4L2_BUF_TYPE_SDR_CAPTURE:
case V4L2_BUF_TYPE_SDR_OUTPUT:
- case V4L2_BUF_TYPE_META_CAPTURE:
- case V4L2_BUF_TYPE_META_OUTPUT:
if (ret && (node->g_caps() & buftype2cap[type]))
return fail("%s cap set, but no %s formats defined\n",
buftype2s(type).c_str(), buftype2s(type).c_str());
@@ -314,6 +312,10 @@ int testEnumFormats(struct node *node)
return fail("%s cap not set, but %s formats defined\n",
buftype2s(type).c_str(), buftype2s(type).c_str());
break;
+ case V4L2_BUF_TYPE_META_CAPTURE:
+ case V4L2_BUF_TYPE_META_OUTPUT:
+ /* Metadata formats need not be present for the current input/output */
+ break;
default:
if (!ret)
return fail("Buffer type %s not allowed!\n", buftype2s(type).c_str());
@@ -599,8 +601,6 @@ int testGetFormats(struct node *node)
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
case V4L2_BUF_TYPE_SDR_CAPTURE:
case V4L2_BUF_TYPE_SDR_OUTPUT:
- case V4L2_BUF_TYPE_META_CAPTURE:
- case V4L2_BUF_TYPE_META_OUTPUT:
if (ret && (node->g_caps() & buftype2cap[type]))
return fail("%s cap set, but no %s formats defined\n",
buftype2s(type).c_str(), buftype2s(type).c_str());
@@ -608,6 +608,15 @@ int testGetFormats(struct node *node)
return fail("%s cap not set, but %s formats defined\n",
buftype2s(type).c_str(), buftype2s(type).c_str());
break;
+ case V4L2_BUF_TYPE_META_CAPTURE:
+ case V4L2_BUF_TYPE_META_OUTPUT:
+ if (ret && !node->buftype_pixfmts[type].empty())
+ return fail("%s G_FMT failed, but %s formats defined\n",
+ buftype2s(type).c_str(), buftype2s(type).c_str());
+ if (!ret && node->buftype_pixfmts[type].empty())
+ return fail("%s G_FMT success, but no %s formats defined\n",
+ buftype2s(type).c_str(), buftype2s(type).c_str());
+ break;
default:
/* ENUMFMT doesn't support other buftypes */
break;

Privacy Policy