aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-08-22 11:07:12 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2012-08-22 11:07:12 +0200
commit468f2e6efd82dd336c40333b66d946d1cdc0ca3f (patch)
tree0e51b00be0239054034ecaa40ef335e6965f5453
parentee58aa47645cb92b82b4881c5ed2f142b20bc8db (diff)
v4l2-compliance: add VIDIOC_G_ENC_INDEX test.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/v4l2-compliance/v4l2-compliance.cpp2
-rw-r--r--utils/v4l2-compliance/v4l2-compliance.h1
-rw-r--r--utils/v4l2-compliance/v4l2-test-codecs.cpp17
3 files changed, 19 insertions, 1 deletions
diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
index 64ba5d73..c38091ad 100644
--- a/utils/v4l2-compliance/v4l2-compliance.cpp
+++ b/utils/v4l2-compliance/v4l2-compliance.cpp
@@ -660,6 +660,7 @@ int main(int argc, char **argv)
printf("Codec ioctls:\n");
printf("\ttest VIDIOC_(TRY_)ENCODER_CMD: %s\n", ok(testEncoder(&node)));
+ printf("\ttest VIDIOC_G_ENC_INDEX: %s\n", ok(testEncIndex(&node)));
printf("\ttest VIDIOC_(TRY_)DECODER_CMD: %s\n", ok(testDecoder(&node)));
printf("\n");
@@ -674,7 +675,6 @@ int main(int argc, char **argv)
VIDIOC_CROPCAP, VIDIOC_G/S_CROP, VIDIOC_G/S_SELECTION
VIDIOC_S_FBUF/OVERLAY
- VIDIOC_G_ENC_INDEX
VIDIOC_QBUF/DQBUF/QUERYBUF/PREPARE_BUFS
VIDIOC_STREAMON/OFF
*/
diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
index 5a862310..88ae2bea 100644
--- a/utils/v4l2-compliance/v4l2-compliance.h
+++ b/utils/v4l2-compliance/v4l2-compliance.h
@@ -191,6 +191,7 @@ int testSlicedVBICap(struct node *node);
// Codec ioctl tests
int testEncoder(struct node *node);
+int testEncIndex(struct node *node);
int testDecoder(struct node *node);
// Buffer ioctl tests
diff --git a/utils/v4l2-compliance/v4l2-test-codecs.cpp b/utils/v4l2-compliance/v4l2-test-codecs.cpp
index 6a5efa94..5057d0ff 100644
--- a/utils/v4l2-compliance/v4l2-test-codecs.cpp
+++ b/utils/v4l2-compliance/v4l2-test-codecs.cpp
@@ -61,6 +61,23 @@ int testEncoder(struct node *node)
return 0;
}
+int testEncIndex(struct node *node)
+{
+ struct v4l2_enc_idx idx;
+ int ret;
+
+ memset(&idx, 0xff, sizeof(idx));
+ ret = doioctl(node, VIDIOC_G_ENC_INDEX, &idx);
+ if (ret == ENOTTY)
+ return ret;
+ if (check_0(idx.reserved, sizeof(idx.reserved)))
+ return fail("idx.reserved not zeroed\n");
+ fail_on_test(ret);
+ fail_on_test(idx.entries != 0);
+ fail_on_test(idx.entries_cap == 0);
+ return 0;
+}
+
int testDecoder(struct node *node)
{
struct v4l2_decoder_cmd cmd;

Privacy Policy