Skip to contentSkip to conversation

Query: Mutiple CAPTURE ports on a single device

DISCUSSION [email protected] 2 participants 3 messages Mar 12, 2014 – Mar 13, 2014 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi

I have a v4l2 driver for a hardware which is capable of taking one input and producing two outputs. Eg: Downscaler which takes one input @ 1080p and two outputs - one @ 720p and other at VGA. My driver is currently implemented as having two capabilities -

1. V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
2. V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE

Do you know if I can have two CAPTURE capabilities. In that case how do I distinguish between QBUF/DQBUF of each capability?

Thanks
Vinay

#1 lore raw

Hi Vinay!

Quoted 7 lines · On 03/12/14 18:58, [email protected] wrote:

Hi

I have a v4l2 driver for a hardware which is capable of taking one input and producing two outputs. Eg: Downscaler which takes one input @ 1080p and two outputs - one @ 720p and other at VGA. My driver is currently implemented as having two capabilities -

Quoted 5 lines

1. V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
2. V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE

Do you know if I can have two CAPTURE capabilities. In that case how do I distinguish between QBUF/DQBUF of each capability?

The answer depends on how your driver is organized: is it a memory-to-memory device (i.e. it has one video node that is used for both output and capture to/from the m2m hardware) or does it have two video nodes, one for output to the hardware, one for capture from the hardware?

In the first case you won't be able to implement this using the M2M API.

In the second case it is quite easy: you just create another video capture node. For every frame send to the hardware you'll get a frame back at each of the two capture nodes, one 720p, one VGA.

This is actually quite common, there are many drivers that have multiple video nodes that give back the same video source but in different formats (e.g. raw video and compressed video).

Each video node basically represents a DMA engine. So if you have multiple DMA engines, you'll need multiple video nodes.

Regards,

Hans

#2 lore raw

Thanks Hans for the pointers! Unfortunately, my driver is implemented M2M way.

Thanks
Vinay

Quoted 42 lines

Hi Vinay!

Quoted 7 lines · On 03/12/14 18:58, [email protected] wrote:

Hi

I have a v4l2 driver for a hardware which is capable of taking one input and producing two outputs. Eg: Downscaler which takes one input @ 1080p and two outputs - one @ 720p and other at VGA. My driver is currently implemented as having two capabilities -

Quoted 6 lines

1. V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
2. V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE

Do you know if I can have two CAPTURE capabilities. In that case how do I
distinguish between QBUF/DQBUF of each capability?

The answer depends on how your driver is organized: is it a memory-to-memory
device (i.e. it has one video node that is used for both output and capture
to/from the m2m hardware) or does it have two video nodes, one for output to
the hardware, one for capture from the hardware?

In the first case you won't be able to implement this using the M2M API.

In the second case it is quite easy: you just create another video capture node. For every frame send to the hardware you'll get a frame back at each of the two capture nodes, one 720p, one VGA.

This is actually quite common, there are many drivers that have multiple video nodes that give back the same video source but in different formats (e.g. raw video and compressed video).

Each video node basically represents a DMA engine. So if you have multiple DMA engines, you'll need multiple video nodes.

Regards,

Hans