linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* videobuf2: V4L2_BUF_TYPE_VIDEO_CAPTURE and V4L2_BUF_TYPE_VIDEO_OUTPUT at the same time?
@ 2013-09-10 14:10 Ricardo Ribalda Delgado
  2013-09-10 21:46 ` Sakari Ailus
  2013-09-11  8:28 ` Hans Verkuil
  0 siblings, 2 replies; 3+ messages in thread
From: Ricardo Ribalda Delgado @ 2013-09-10 14:10 UTC (permalink / raw)
  To: linux-media, Marek Szyprowski

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()....)  :(

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.

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

Thanks!

-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: videobuf2: V4L2_BUF_TYPE_VIDEO_CAPTURE and V4L2_BUF_TYPE_VIDEO_OUTPUT at the same time?
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2013-09-10 21:46 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado; +Cc: linux-media, Marek Szyprowski

Hi Ricardo,

On Tue, Sep 10, 2013 at 04:10:37PM +0200, 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()....)  :(
> 
> 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.
> 
> So is there any way to have a video device with videobuf2 that
> supports caputer and output?

I think mem-to-mem devices do this. I think there should be plenty of
examples there. However your use case is slightly different but I guess it
wouldn't matter here. I think you'll need two buffer queues...

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: videobuf2: V4L2_BUF_TYPE_VIDEO_CAPTURE and V4L2_BUF_TYPE_VIDEO_OUTPUT at the same time?
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Verkuil @ 2013-09-11  8:28 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado; +Cc: linux-media, Marek Szyprowski

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!
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-11  8:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).