All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: linux-media <linux-media@vger.kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: videobuf2: V4L2_BUF_TYPE_VIDEO_CAPTURE and V4L2_BUF_TYPE_VIDEO_OUTPUT at the same time?
Date: Wed, 11 Sep 2013 10:28:54 +0200	[thread overview]
Message-ID: <523029C6.8070305@xs4all.nl> (raw)
In-Reply-To: <CAPybu_2dq6FkWebNw8ySD=4wJu++3z7K6oNDjXEJvcKVvRTVsQ@mail.gmail.com>

Hi Ricardo,

Memory-to-memory devices can do this. In that case querycap will return the M2M
or M2M_MPLANE capability. The mem2mem_testdev driver is a good example.

Other devices shouldn't combine the two.

On 09/10/2013 04:10 PM, Ricardo Ribalda Delgado wrote:
> Hello!
> 
> I am writing the driver for a device that can work as an input and as
> output at the same time. It is used for debugging of the video
> pipeline.
> 
> Is it possible to have a vb2 queue that supports capture and out at
> the same time?
> 
> After a fast look on the code it seems that the code flow is different
> depending of the type. if (V4L2_TYPE_IS_OUTPUT()....)  :(

A vb2_queue is for one direction only, so for a bidirectional device you need
two vb2_queue structs. It's recommended to use the v4l2-mem2mem.h framework
for that, as is also used by the mem2mem_testdev driver.

> 
> Also it seems that struct video device has only space for one
> vb2_queue, so I cant create a video device with two vbuf2 queues.

You can, but not by using the vb2_queue pointer in videodev. It might
actually be nice to add better core support for m2m devices. If
someone needs a project, then that would be nice.

Regards,

	Hans

> So is there any way to have a video device with videobuf2 that
> supports caputer and output?
> 
> Thanks!
> 

      parent reply	other threads:[~2013-09-11  8:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 14:10 videobuf2: V4L2_BUF_TYPE_VIDEO_CAPTURE and V4L2_BUF_TYPE_VIDEO_OUTPUT at the same time? Ricardo Ribalda Delgado
2013-09-10 21:46 ` Sakari Ailus
2013-09-11  8:28 ` Hans Verkuil [this message]

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=523029C6.8070305@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=ricardo.ribalda@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.