aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-07-19 16:00:27 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-07-19 16:00:27 +0200
commit697ae940b60a172ef31948dd74316fe9de365b7e (patch)
treef1c8a5f47f8c9f0d8bb80a671a83a5aba3d9c18c
parent452aa2e85517047d869a167ddb50931596def326 (diff)
v4l-utils: use V4L2_TYPE_IS_CAPTURE
Use V4L2_TYPE_IS_CAPTURE instead of !V4L2_TYPE_IS_OUTPUT. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/common/v4l-helpers.h4
-rw-r--r--utils/v4l2-compliance/v4l2-test-formats.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/utils/common/v4l-helpers.h b/utils/common/v4l-helpers.h
index 53f7bec9..e093e717 100644
--- a/utils/common/v4l-helpers.h
+++ b/utils/common/v4l-helpers.h
@@ -1116,7 +1116,7 @@ static inline bool v4l_type_is_output(unsigned type)
static inline bool v4l_type_is_capture(unsigned type)
{
- return !v4l_type_is_output(type);
+ return V4L2_TYPE_IS_CAPTURE(type);
}
static inline bool v4l_type_is_video(unsigned type)
@@ -1981,7 +1981,7 @@ static inline void v4l_frame_selection(struct v4l2_selection *sel, bool to_frame
case V4L2_SEL_TGT_CROP:
case V4L2_SEL_TGT_CROP_DEFAULT:
case V4L2_SEL_TGT_CROP_BOUNDS:
- if (!V4L2_TYPE_IS_OUTPUT(sel->type))
+ if (V4L2_TYPE_IS_CAPTURE(sel->type))
return;
break;
case V4L2_SEL_TGT_COMPOSE:
diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp
index c0b96313..73719cc3 100644
--- a/utils/v4l2-compliance/v4l2-test-formats.cpp
+++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
@@ -1403,7 +1403,7 @@ static int testParmType(struct node *node, unsigned type)
* S_PARM(CAPTURE) is optional for stateful encoders, so EINVAL is a
* valid error code in that case.
*/
- if (is_stateful_enc && !V4L2_TYPE_IS_OUTPUT(type) && ret == -EINVAL)
+ if (is_stateful_enc && V4L2_TYPE_IS_CAPTURE(type) && ret == -EINVAL)
return 0;
if (ret)
return fail("got error %d when setting parms for buftype %d\n", ret, type);

Privacy Policy