NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/52588: Missing features in video(4)



>Number:         52588
>Category:       kern
>Synopsis:       Missing features in video(4)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 01 17:15:00 +0000 2017
>Originator:     Robert Swindells
>Release:        NetBSD 8.99.3
>Organization:
	NetBSD
>Environment:
	
	
System: NetBSD ren.fdy2.co.uk 8.99.3 NetBSD 8.99.3 (REN) #14: Sun Oct 1 12:31:44 BST 2017 rjs%ren.fdy2.co.uk@localhost:/u1/src/sys/arch/amd64/compile/REN amd64
Architecture: x86_64
Machine: amd64
>Description:

Some ioctl commands and the structures used by them are missing from
the emulation of v4l in NetBSD.


>How-To-Repeat:

Build www/firefox package with webrtc option enabled.

>Fix:

Add support for VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS
to the kernel.

The header changes required by Firefox are below:

Index: videoio.h
===================================================================
RCS file: /cvsroot/src/sys/sys/videoio.h,v
retrieving revision 1.9
diff -u -r1.9 videoio.h
--- videoio.h	6 Sep 2015 06:01:02 -0000	1.9
+++ videoio.h	1 Oct 2017 12:21:42 -0000
@@ -117,6 +117,12 @@
 	V4L2_CTRL_TYPE_BUTTON
 };
 
+enum v4l2_frmsizetypes {
+	V4L2_FRMSIZE_TYPE_DISCRETE = 1,
+	V4L2_FRMSIZE_TYPE_CONTINUOUS,
+	V4L2_FRMSIZE_TYPE_STEPWISE
+};
+
 struct v4l2_timecode {
 	uint32_t	type;
 	uint32_t	flags;
@@ -431,6 +437,50 @@
 	uint32_t	reserved[2];
 };
 
+struct v4l2_frmsize_discrete {
+	uint32_t	width;
+	uint32_t	height;
+};
+
+struct v4l2_frmsize_stepwise {
+	uint32_t	min_width;
+	uint32_t	max_width;
+	uint32_t	step_width;
+	uint32_t	min_height;
+	uint32_t	max_height;
+	uint32_t	step_height;
+};
+
+struct v4l2_frmsizeenum {
+	uint32_t	index;
+	uint32_t	pixel_format;
+	uint32_t	type;
+	union {
+		struct v4l2_frmsize_discrete discrete;
+		struct v4l2_frmsize_stepwise stepwise;
+	};
+	uint32_t	reserved[2];
+};
+
+struct v4l2_frmival_stepwise {
+	struct v4l2_fract	min;
+	struct v4l2_fract	max;
+	struct v4l2_fract	step;
+};
+
+struct v4l2_frmivalenum {
+	uint32_t	index;
+	uint32_t	pixel_format;
+	uint32_t	width;
+	uint32_t	height;
+	uint32_t	type;
+	union {
+		struct v4l2_fract		discrete;
+		struct v4l2_frmival_stepwise	stepwise;
+	};
+	uint32_t	reserved[2];
+};
+
 /* Timecode types */
 #define V4L2_TC_TYPE_24FPS		1
 #define V4L2_TC_TYPE_25FPS		2
@@ -741,6 +791,8 @@
 #define VIDIOC_ENUMAUDOUT	_IOWR('V', 66, struct v4l2_audioout)
 #define VIDIOC_G_PRIORITY	_IOR('V', 67, enum v4l2_priority)
 #define VIDIOC_S_PRIORITY	_IOW('V', 68, enum v4l2_priority)
+#define VIDIOC_ENUM_FRAMESIZES	_IOWR('V', 74, struct v4l2_frmsizeenum)
+#define VIDIOC_ENUM_FRAMEINTERVALS	_IOWR('V', 75, struct v4l2_frmivalenum)
 
 #ifdef _KERNEL
 #define VIDIOC_QUERYBUF50	_IOWR('V', 9, struct v4l2_buffer50)

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index