From: bnvandana at gmail.com (Vandana BN) Subject: [Linux-kernel-mentees] [PATCH v2] v4l2-compliance: Verify metadata formats Date: Wed, 25 Sep 2019 14:44:26 +0530 [thread overview] Message-ID: <20190925091426.17120-1-bnvandana@gmail.com> (raw) In-Reply-To: <49ffdb33-39a7-aa44-fb0c-302e963972b1@xs4all.nl> 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 at gmail.com> --- utils/v4l2-compliance/v4l2-test-formats.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp index 525dfafa..b60d9275 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; -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: bnvandana@gmail.com (Vandana BN) Subject: [Linux-kernel-mentees] [PATCH v2] v4l2-compliance: Verify metadata formats Date: Wed, 25 Sep 2019 14:44:26 +0530 [thread overview] Message-ID: <20190925091426.17120-1-bnvandana@gmail.com> (raw) Message-ID: <20190925091426.EHfHmQWeYHTPG6fPvR5U0z73InK8QZkHthq_ODYpQcM@z> (raw) In-Reply-To: <49ffdb33-39a7-aa44-fb0c-302e963972b1@xs4all.nl> 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 at gmail.com> --- utils/v4l2-compliance/v4l2-test-formats.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp index 525dfafa..b60d9275 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; -- 2.17.1
next prev parent reply other threads:[~2019-09-25 9:14 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-24 9:25 [Linux-kernel-mentees] [PATCH] v4l2-compliance: Verify metadata formats bnvandana 2019-09-24 9:25 ` Vandana BN 2019-09-24 12:01 ` hverkuil 2019-09-24 12:01 ` Hans Verkuil 2019-09-25 9:14 ` bnvandana [this message] 2019-09-25 9:14 ` [Linux-kernel-mentees] [PATCH v2] " Vandana BN
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190925091426.17120-1-bnvandana@gmail.com \ --to=linux-kernel-mentees@lists.linux-foundation.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).