public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* How to tell libv4l2 which src_fmt should be prefered?
@ 2014-01-18 10:43 Andreas Weber
  2014-01-18 22:34 ` Gregor Jasny
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Weber @ 2014-01-18 10:43 UTC (permalink / raw)
  To: linux-media; +Cc: andy.weber.aw

Dear maintainer and user,

Is there a way to tell libv4l2 which native source format it should
prefer to convert from? For example my uvcvideo webcam supports natively
YUYV and MJPG (see output below) and when I request V4L2_PIX_FMT_RGB24 I
see in the logs:

...
VIDIOC_S_FMT app requesting: RGB3
VIDIOC_S_FMT converting from: YUYV
request == VIDIOC_S_FMT
  pixelformat: RGB3 640x480
  field: 1 bytesperline: 1920 imagesize921600
  colorspace: 8, priv: 0
...

So it picks up YUYV as source format. I had a look at
v4lconvert_try_format but can see no way how to do this.

Regards, Andy

$ v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUV 4:2:2 (YUYV)

	Index       : 1
	Type        : Video Capture
	Pixel Format: 'MJPG' (compressed)
	Name        : MJPEG

$ v4l2-ctl -w -D
Driver Info (using libv4l2):
	Driver name   : uvcvideo
	Card type     : UVC Camera (046d:0825)
	Bus info      : usb-0000:00:16.2-2
	Driver version: 3.2.51
	Capabilities  : 0x05000001
		Video Capture
		Read/Write
		Streaming


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

* Re: How to tell libv4l2 which src_fmt should be prefered?
  2014-01-18 10:43 How to tell libv4l2 which src_fmt should be prefered? Andreas Weber
@ 2014-01-18 22:34 ` Gregor Jasny
  0 siblings, 0 replies; 2+ messages in thread
From: Gregor Jasny @ 2014-01-18 22:34 UTC (permalink / raw)
  To: Andreas Weber, linux-media

Hi,

On 18/01/14 11:43, Andreas Weber wrote:
> Is there a way to tell libv4l2 which native source format it should
> prefer to convert from? For example my uvcvideo webcam supports natively
> YUYV and MJPG (see output below)
> ...
>
> So it picks up YUYV as source format. I had a look at
> v4lconvert_try_format but can see no way how to do this.

If I understand the source correctly the table at [1] is the brain of 
the conversion. MJPEG has a rank of 7, YUYV has a rank of 5. So YUYV is 
chosen. The function that picks the conversion path is at [2].

Currently there is no way to influence the decision. Why do you want to 
do this?

Thanks,
Gregor

[1] 
http://git.linuxtv.org/v4l-utils.git/blob/HEAD:/lib/libv4lconvert/libv4lconvert.c#l75
[2] 
http://git.linuxtv.org/v4l-utils.git/blob/HEAD:/lib/libv4lconvert/libv4lconvert.c#l379


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

end of thread, other threads:[~2014-01-18 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-18 10:43 How to tell libv4l2 which src_fmt should be prefered? Andreas Weber
2014-01-18 22:34 ` Gregor Jasny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox