[PATCH 2/2] v4l2-compliance: add tests for V4L2_CAP_IO_MC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add tests to check the behavior of VIDIOC_ENUM{INPUT,OUTPUT},
VIDIOC_G_{INPUT,OUTPUT} and VIDIOC_S_{INPUT,OUTPUT} when the
V4L2_CAP_IO_MC  is set.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
---
 utils/v4l2-compliance/v4l2-test-input-output.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/utils/v4l2-compliance/v4l2-test-input-output.cpp b/utils/v4l2-compliance/v4l2-test-input-output.cpp
index 2bf338e6f6d7ec5a..bf937abec320f88a 100644
--- a/utils/v4l2-compliance/v4l2-test-input-output.cpp
+++ b/utils/v4l2-compliance/v4l2-test-input-output.cpp
@@ -466,6 +466,13 @@ int testInput(struct node *node)
 	if (!node->inputs && node->has_inputs)
 		return fail("no inputs found, but input capabilities set\n");
 	fail_on_test(node->is_m2m && node->inputs > 1);
+	if (node->g_caps() & V4L2_CAP_IO_MC) {
+		if (!node->is_video && !node->is_meta)
+			return fail("media device controls none video or meta input\n");
+
+		if (!node->is_meta && node->inputs != 1)
+			return fail("media device controlled input have %d inputs\n", node->inputs);
+	}
 	return 0;
 }
 
@@ -836,6 +843,13 @@ int testOutput(struct node *node)
 	if (!node->outputs && node->has_outputs)
 		return fail("no outputs found, but output capabilities set\n");
 	fail_on_test(node->is_m2m && node->outputs > 1);
+	if (node->g_caps() & V4L2_CAP_IO_MC) {
+		if (!node->is_video && !node->is_meta)
+			return fail("media device controls none video or meta output\n");
+
+		if (!node->is_meta && node->outputs != 1)
+			return fail("media device controlled output have %d outputs\n", node->outputs);
+	}
 	return 0;
 }
 
-- 
2.25.0




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux