linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: hverkuil-cisco@xs4all.nl
To: linux-media@vger.kernel.org
Cc: Alexandre Courbot <acourbot@chromium.org>,
	maxime.ripard@bootlin.com, paul.kocialkowski@bootlin.com,
	tfiga@chromium.org, nicolas@ndufresne.ca,
	sakari.ailus@linux.intel.com,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>
Subject: [PATCHv4 08/10] vim2m: add tag support
Date: Wed,  5 Dec 2018 11:20:38 +0100	[thread overview]
Message-ID: <20181205102040.11741-9-hverkuil-cisco@xs4all.nl> (raw)
In-Reply-To: <20181205102040.11741-1-hverkuil-cisco@xs4all.nl>

From: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Copy tags in vim2m.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
---
 drivers/media/platform/vim2m.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index d01821a6906a..be328483a53a 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -241,17 +241,7 @@ static int device_process(struct vim2m_ctx *ctx,
 	out_vb->sequence =
 		get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE)->sequence++;
 	in_vb->sequence = q_data->sequence++;
-	out_vb->vb2_buf.timestamp = in_vb->vb2_buf.timestamp;
-
-	if (in_vb->flags & V4L2_BUF_FLAG_TIMECODE)
-		out_vb->timecode = in_vb->timecode;
-	out_vb->field = in_vb->field;
-	out_vb->flags = in_vb->flags &
-		(V4L2_BUF_FLAG_TIMECODE |
-		 V4L2_BUF_FLAG_KEYFRAME |
-		 V4L2_BUF_FLAG_PFRAME |
-		 V4L2_BUF_FLAG_BFRAME |
-		 V4L2_BUF_FLAG_TSTAMP_SRC_MASK);
+	v4l2_m2m_buf_copy_data(out_vb, in_vb, true);
 
 	switch (ctx->mode) {
 	case MEM2MEM_HFLIP | MEM2MEM_VFLIP:
@@ -855,6 +845,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *ds
 	src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
 	src_vq->lock = &ctx->dev->dev_mutex;
 	src_vq->supports_requests = true;
+	src_vq->supports_tags = true;
 
 	ret = vb2_queue_init(src_vq);
 	if (ret)
@@ -868,6 +859,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *ds
 	dst_vq->mem_ops = &vb2_vmalloc_memops;
 	dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
 	dst_vq->lock = &ctx->dev->dev_mutex;
+	dst_vq->supports_tags = true;
 
 	return vb2_queue_init(dst_vq);
 }
-- 
2.19.1


  parent reply	other threads:[~2018-12-05 10:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 10:20 [PATCHv4 00/10] As was discussed here (among other places): hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 01/10] videodev2.h: add tag support hverkuil-cisco
2018-12-06 15:08   ` Invite for IRC meeting: " Hans Verkuil
2018-12-07  8:41     ` Alexandre Courbot
2018-12-10  3:18     ` Tomasz Figa
     [not found]       ` <B8C205F2-A5EA-4502-B2D0-2B5A592C31FD@osg.samsung.com>
     [not found]         ` <27D09D62-E6F0-4F22-94F4-E253FE5B45ED@kernel.org>
2018-12-10  6:11           ` Tomasz Figa
2018-12-10  7:57             ` Mauro Carvalho Chehab
2018-12-10  8:03               ` Tomasz Figa
2018-12-10  7:59         ` Hans Verkuil
2018-12-10  8:10           ` Sakari Ailus
2018-12-05 10:20 ` [PATCHv4 02/10] vb2: " hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 03/10] v4l2-ioctl.c: log v4l2_buffer tag hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 04/10] buffer.rst: document the new buffer tag feature hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 05/10] buffer.rst: clean up timecode documentation hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 06/10] v4l2-mem2mem: add v4l2_m2m_buf_copy_data helper function hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 07/10] vb2: add new supports_tags queue flag hverkuil-cisco
2018-12-05 10:20 ` hverkuil-cisco [this message]
2018-12-05 10:20 ` [PATCHv4 09/10] vicodec: add tag support hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 10/10] cedrus: " hverkuil-cisco
2018-12-05 10:33   ` [PATCHv4 11/10] extended-controls.rst: update the mpeg2 compound controls Hans Verkuil
2018-12-06 12:16 ` [PATCHv4 00/10] vb2/cedrus: add tag support Hans Verkuil
2019-01-07  6:34 ` [PATCHv4 00/10] As was discussed here (among other places): Randy Li

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=20181205102040.11741-9-hverkuil-cisco@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=acourbot@chromium.org \
    --cc=linux-media@vger.kernel.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=nicolas@ndufresne.ca \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@chromium.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).