linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Longerbeam <slongerbeam@gmail.com>
To: linux-media@vger.kernel.org
Cc: Steve Longerbeam <slongerbeam@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v8 01/11] media: videodev2.h: Add more field helper macros
Date: Wed,  9 Jan 2019 10:30:04 -0800	[thread overview]
Message-ID: <20190109183014.20466-2-slongerbeam@gmail.com> (raw)
In-Reply-To: <20190109183014.20466-1-slongerbeam@gmail.com>

Adds two helper macros:

V4L2_FIELD_IS_SEQUENTIAL: returns true if the given field type is
'sequential', that is a full frame is transmitted, or exists in
memory, as all top field lines followed by all bottom field lines,
or vice-versa.

V4L2_FIELD_IS_INTERLACED: returns true if the given field type is
'interlaced', that is a full frame is transmitted, or exists in
memory, as top field lines interlaced with bottom field lines.

Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
---
Changes since v3:
- none
Changes since v2:
- none
Changes since v1:
- add the complement macro V4L2_FIELD_IS_INTERLACED
- remove V4L2_FIELD_ALTERNATE from V4L2_FIELD_IS_SEQUENTIAL macro.
- moved new macros past end of existing V4L2_FIELD_HAS_* macros.
---
 include/uapi/linux/videodev2.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index d6eed479c3a6..bca07d35ea09 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -130,6 +130,13 @@ enum v4l2_field {
 	((field) == V4L2_FIELD_BOTTOM ||\
 	 (field) == V4L2_FIELD_TOP ||\
 	 (field) == V4L2_FIELD_ALTERNATE)
+#define V4L2_FIELD_IS_INTERLACED(field) \
+	((field) == V4L2_FIELD_INTERLACED ||\
+	 (field) == V4L2_FIELD_INTERLACED_TB ||\
+	 (field) == V4L2_FIELD_INTERLACED_BT)
+#define V4L2_FIELD_IS_SEQUENTIAL(field) \
+	((field) == V4L2_FIELD_SEQ_TB ||\
+	 (field) == V4L2_FIELD_SEQ_BT)
 
 enum v4l2_buf_type {
 	V4L2_BUF_TYPE_VIDEO_CAPTURE        = 1,
-- 
2.17.1


  reply	other threads:[~2019-01-09 18:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 18:30 [PATCH v8 00/11] imx-media: Fixes for interlaced capture Steve Longerbeam
2019-01-09 18:30 ` Steve Longerbeam [this message]
2019-01-09 18:30 ` [PATCH v8 02/11] gpu: ipu-csi: Swap fields according to input/output field types Steve Longerbeam
2019-01-09 18:30 ` [PATCH v8 03/11] gpu: ipu-v3: Add planar support to interlaced scan Steve Longerbeam
2019-01-09 18:30 ` [PATCH v8 04/11] media: imx: Fix field negotiation Steve Longerbeam
2019-01-09 18:30 ` [PATCH v8 05/11] media: imx-csi: Double crop height for alternate fields at sink Steve Longerbeam
2019-01-09 18:30 ` [PATCH v8 06/11] media: imx: interweave and odd-chroma-row skip are incompatible Steve Longerbeam
2019-01-09 18:30 ` [PATCH v8 07/11] media: imx-csi: Allow skipping odd chroma rows for YVU420 Steve Longerbeam
2019-01-09 18:30 ` [PATCH v8 08/11] media: imx: vdic: rely on VDIC for correct field order Steve Longerbeam
2019-01-09 18:30 ` [PATCH v8 09/11] media: imx-csi: Move crop/compose reset after filling default mbus fields Steve Longerbeam
2019-01-09 18:30 ` [PATCH v8 10/11] media: imx: Allow interweave with top/bottom lines swapped Steve Longerbeam
2019-01-09 18:30 ` [PATCH v8 11/11] media: imx.rst: Update doc to reflect fixes to interlaced capture Steve Longerbeam
2019-01-15 21:58   ` Tim Harvey
2019-01-15 23:54     ` Steve Longerbeam
2019-01-15 23:59       ` Steve Longerbeam
2019-01-21 20:24       ` Tim Harvey
2019-01-22 19:51         ` Tim Harvey
2019-01-23  0:24           ` Steve Longerbeam
2019-01-23  0:08         ` Steve Longerbeam
2019-01-23 22:04           ` Tim Harvey

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=20190109183014.20466-2-slongerbeam@gmail.com \
    --to=slongerbeam@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.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: link
Be 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).