sys/videoio.h defines anonymous unions. these aren't standard C, and gcc-<3 does not support them.
this diff simply names the anonymous unions 'un'. there is also a diff for the 4 ports affected by this change. video(1) can presumably be re-enabled in xenocara and removed from ports. while here I also removed soem stuff that is considered deprecated and we have not yet and likely will not support. ok? -- [email protected] SDF Public Access UNIX System - http://sdf.lonestar.org Index: sys/dev/usb/uvideo.c =================================================================== RCS file: /cvs/src/sys/dev/usb/uvideo.c,v retrieving revision 1.136 diff -u -p sys/dev/usb/uvideo.c --- sys/dev/usb/uvideo.c 26 Jul 2010 22:17:13 -0000 1.136 +++ sys/dev/usb/uvideo.c 31 Aug 2010 13:55:12 -0000 @@ -2764,15 +2764,15 @@ uvideo_enum_fsizes(void *v, struct v4l2_frmsizeenum *f if (sc->sc_fmtgrp[idx].frame[i]->bFrameIntervalType == 0) { /* TODO */ fsizes->type = V4L2_FRMSIZE_TYPE_CONTINUOUS; - fsizes->stepwise.min_width = 0; - fsizes->stepwise.min_height = 0; - fsizes->stepwise.max_width = 0; - fsizes->stepwise.max_height = 0; + fsizes->un.stepwise.min_width = 0; + fsizes->un.stepwise.min_height = 0; + fsizes->un.stepwise.max_width = 0; + fsizes->un.stepwise.max_height = 0; } else { fsizes->type = V4L2_FRMSIZE_TYPE_DISCRETE; - fsizes->discrete.width = + fsizes->un.discrete.width = UGETW(sc->sc_fmtgrp[idx].frame[i]->wWidth); - fsizes->discrete.height = + fsizes->un.discrete.height = UGETW(sc->sc_fmtgrp[idx].frame[i]->wHeight); } Index: sys/sys/videoio.h =================================================================== RCS file: /cvs/src/sys/sys/videoio.h,v retrieving revision 1.3 diff -u -p sys/sys/videoio.h --- sys/sys/videoio.h 17 Dec 2008 08:39:01 -0000 1.3 +++ sys/sys/videoio.h 31 Aug 2010 13:55:12 -0000 @@ -361,8 +361,6 @@ struct v4l2_fmtdesc { #define V4L2_FMT_FLAG_COMPRESSED 0x0001 -#if 1 /* KEEP */ -/* Experimental Frame Size and frame rate enumeration */ /* * F R A M E S I Z E E N U M E R A T I O N */ @@ -394,7 +392,7 @@ struct v4l2_frmsizeenum { union { /* Frame size */ struct v4l2_frmsize_discrete discrete; struct v4l2_frmsize_stepwise stepwise; - }; + } un; __u32 reserved[2]; /* Reserved space for future use */ }; @@ -424,11 +422,10 @@ struct v4l2_frmivalenum { union { /* Frame interval */ struct v4l2_fract discrete; struct v4l2_frmival_stepwise stepwise; - }; + } un; __u32 reserved[2]; /* Reserved space for future use */ }; -#endif /* * T I M E C O D E @@ -458,126 +455,7 @@ struct v4l2_timecode { #define V4L2_TC_USERBITS_8BITCHARS 0x0008 /* The above is based on SMPTE timecodes */ -#ifdef __KERNEL__ -/* - * M P E G C O M P R E S S I O N P A R A M E T E R S - * - * ### WARNING: This experimental MPEG compression API is obsolete. - * ### It is replaced by the MPEG controls API. - * ### This old API will disappear in the near future! - * - */ -enum v4l2_bitrate_mode { - V4L2_BITRATE_NONE = 0, /* not specified */ - V4L2_BITRATE_CBR, /* constant bitrate */ - V4L2_BITRATE_VBR, /* variable bitrate */ -}; -struct v4l2_bitrate { - /* rates are specified in kbit/sec */ - enum v4l2_bitrate_mode mode; - __u32 min; - __u32 target; /* use this one for CBR */ - __u32 max; -}; -enum v4l2_mpeg_streamtype { - V4L2_MPEG_SS_1, /* MPEG-1 system stream */ - V4L2_MPEG_PS_2, /* MPEG-2 program stream */ - V4L2_MPEG_TS_2, /* MPEG-2 transport stream */ - V4L2_MPEG_PS_DVD, /* MPEG-2 program stream with DVD header - * fixups */ -}; -enum v4l2_mpeg_audiotype { - V4L2_MPEG_AU_2_I, /* MPEG-2 layer 1 */ - V4L2_MPEG_AU_2_II, /* MPEG-2 layer 2 */ - V4L2_MPEG_AU_2_III, /* MPEG-2 layer 3 */ - V4L2_MPEG_AC3, /* AC3 */ - V4L2_MPEG_LPCM, /* LPCM */ -}; -enum v4l2_mpeg_videotype { - V4L2_MPEG_VI_1, /* MPEG-1 */ - V4L2_MPEG_VI_2, /* MPEG-2 */ -}; -enum v4l2_mpeg_aspectratio { - V4L2_MPEG_ASPECT_SQUARE = 1, /* square pixel */ - V4L2_MPEG_ASPECT_4_3 = 2, /* 4 : 3 */ - V4L2_MPEG_ASPECT_16_9 = 3, /* 16 : 9 */ - V4L2_MPEG_ASPECT_1_221 = 4, /* 1 : 2,21 */ -}; - -struct v4l2_mpeg_compression { - /* general */ - enum v4l2_mpeg_streamtype st_type; - struct v4l2_bitrate st_bitrate; - - /* transport streams */ - __u16 ts_pid_pmt; - __u16 ts_pid_audio; - __u16 ts_pid_video; - __u16 ts_pid_pcr; - - /* program stream */ - __u16 ps_size; - __u16 reserved_1; /* align */ - - /* audio */ - enum v4l2_mpeg_audiotype au_type; - struct v4l2_bitrate au_bitrate; - __u32 au_sample_rate; - __u8 au_pesid; - __u8 reserved_2[3]; /* align */ - - /* video */ - enum v4l2_mpeg_videotype vi_type; - enum v4l2_mpeg_aspectratio vi_aspect_ratio; - struct v4l2_bitrate vi_bitrate; - __u32 vi_frame_rate; - __u16 vi_frames_per_gop; - __u16 vi_bframes_count; - __u8 vi_pesid; - __u8 reserved_3[3]; /* align */ - - /* misc flags */ - __u32 closed_gops:1; - __u32 pulldown:1; - __u32 reserved_4:30; /* align */ - - /* I don't expect the above being perfect yet ;) */ - __u32 reserved_5[8]; -}; -#endif - -struct v4l2_jpegcompression { - int quality; - - int APPn; /* Number of APP segment to be written, must - * be 0..15 */ - int APP_len;/* Length of data in JPEG APPn segment */ - char APP_data[60]; /* Data in the JPEG APPn segment. */ - - int COM_len;/* Length of data in JPEG COM segment */ - char COM_data[60]; /* Data in JPEG COM segment */ - - __u32 jpeg_markers; /* Which markers should go into the - * JPEG output. Unless you exactly - * know what you do, leave them - * untouched. Inluding less markers - * will make the resulting code - * smaller, but there will be fewer - * aplications which can read it. The - * presence of the APP and COM marker - * is influenced by APP_len and - * COM_len ONLY, not by this - * property! */ - -#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */ -#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */ -#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ -#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */ -#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will allways - * use APP0 */ -}; - /* * M E M O R Y - M A P P I N G B U F F E R S */ @@ -873,7 +751,7 @@ struct v4l2_ext_control { __s32 value; __s64 value64; void *reserved; - }; + } un; } __attribute__((packed)); struct v4l2_ext_controls { @@ -1230,55 +1108,7 @@ struct v4l2_audioout { __u32 reserved[2]; }; -/* - * M P E G S E R V I C E S - * - * NOTE: EXPERIMENTAL API - */ -#if 1 /* KEEP */ -#define V4L2_ENC_IDX_FRAME_I (0) -#define V4L2_ENC_IDX_FRAME_P (1) -#define V4L2_ENC_IDX_FRAME_B (2) -#define V4L2_ENC_IDX_FRAME_MASK (0xf) -struct v4l2_enc_idx_entry { - __u64 offset; - __u64 pts; - __u32 length; - __u32 flags; - __u32 reserved[2]; -}; - -#define V4L2_ENC_IDX_ENTRIES (64) -struct v4l2_enc_idx { - __u32 entries; - __u32 entries_cap; - __u32 reserved[4]; - struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES]; -}; - - -#define V4L2_ENC_CMD_START (0) -#define V4L2_ENC_CMD_STOP (1) -#define V4L2_ENC_CMD_PAUSE (2) -#define V4L2_ENC_CMD_RESUME (3) - -/* Flags for V4L2_ENC_CMD_STOP */ -#define V4L2_ENC_CMD_STOP_AT_GOP_END (1 << 0) - -struct v4l2_encoder_cmd { - __u32 cmd; - __u32 flags; - union { - struct { - __u32 data[8]; - } raw; - }; -}; - -#endif - - /* * D A T A S E R V I C E S ( V B I ) * @@ -1393,37 +1223,7 @@ struct v4l2_streamparm { } parm; }; -/* - * A D V A N C E D D E B U G G I N G - * - * NOTE: EXPERIMENTAL API - */ -/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ - -#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 - * for the host) */ -#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver ID */ -#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ - -struct v4l2_register { - __u32 match_type; /* Match type */ - __u32 match_chip; /* Match this chip, meaning - * determined by match_type */ - __u64 reg; - __u64 val; -}; - -/* VIDIOC_G_CHIP_IDENT */ -struct v4l2_chip_ident { - __u32 match_type; /* Match type */ - __u32 match_chip; /* Match this chip, meaning - * determined by match_type */ - __u32 ident; /* chip identifier as specified in - * <media/v4l2-chip-ident.h> */ - __u32 revision; /* chip revision, chip specific */ -}; - /* * I O C T L C O D E S F O R V I D E O D E V I C E S * @@ -1433,7 +1233,7 @@ struct v4l2_chip_ident { #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) -#ifdef __KERNEL__ +#if 0 #define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) #define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) #endif @@ -1474,8 +1274,10 @@ struct v4l2_chip_ident { #define VIDIOC_CROPCAP _IOWR ('V', 58, struct v4l2_cropcap) #define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop) #define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop) +#if 0 #define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression) #define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression) +#endif #define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id) #define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format) #define VIDIOC_ENUMAUDIO _IOWR ('V', 65, struct v4l2_audio) @@ -1487,19 +1289,12 @@ struct v4l2_chip_ident { #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) -#if 1 /* KEEP */ #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) #define VIDIOC_G_ENC_INDEX _IOR ('V', 76, struct v4l2_enc_idx) #define VIDIOC_ENCODER_CMD _IOWR ('V', 77, struct v4l2_encoder_cmd) #define VIDIOC_TRY_ENCODER_CMD _IOWR ('V', 78, struct v4l2_encoder_cmd) -/* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ -#define VIDIOC_DBG_S_REGISTER _IOW ('V', 79, struct v4l2_register) -#define VIDIOC_DBG_G_REGISTER _IOWR ('V', 80, struct v4l2_register) - -#define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident) -#endif #ifdef __OLD_VIDIOC_ /* for compatibility, will go away some day */ Index: graphics/luvcview/Makefile =================================================================== RCS file: /cvs/ports/graphics/luvcview/Makefile,v retrieving revision 1.6 diff -N -u -p graphics/luvcview/Makefile --- graphics/luvcview/Makefile 17 May 2010 16:52:05 -0000 1.6 +++ graphics/luvcview/Makefile 31 Aug 2010 13:51:07 -0000 @@ -3,7 +3,7 @@ COMMENT= V4L compatible video application DISTNAME= luvcview-20070512 -PKGNAME= ${DISTNAME}p4 +REVISION= 5 CATEGORIES= graphics x11 # GPLv2+ @@ -15,8 +15,8 @@ PERMIT_DISTFILES_FTP= Yes HOMEPAGE= http://mxhaard.free.fr/ MASTER_SITES= ${HOMEPAGE}/spca50x/Investigation/uvc/ -LIB_DEPENDS= SDL:sdl-1.2.4p1|sdl->=1.2.5:devel/sdl -WANTLIB= c pthread +LIB_DEPENDS= :sdl->=1.2.5:devel/sdl +WANTLIB= SDL c pthread MAKE_FLAGS= CC="${CC}" \ CFLAGS+="-I${X11BASE}/include -I${LOCALBASE}/include" Index: graphics/luvcview/patches/patch-v4l2uvc_c =================================================================== RCS file: graphics/luvcview/patches/patch-v4l2uvc_c diff -N -u -p graphics/luvcview/patches/patch-v4l2uvc_c --- /dev/null 31 Aug 2010 07:51:08 -0000 +++ graphics/luvcview/patches/patch-v4l2uvc_c 31 Aug 2010 13:51:07 -0000 @@ -0,0 +1,73 @@ +$OpenBSD$ +--- v4l2uvc.c.orig Thu Aug 26 15:54:18 2010 ++++ v4l2uvc.c Thu Aug 26 15:54:54 2010 +@@ -833,9 +833,9 @@ int v4L2UpDownPanTilt(struct vdIn *vd, short inc_p, sh + control_s_array.controls = control_s; + + control_s[0].id = p_control; +- control_s[0].value = inc_p; ++ control_s[0].un.value = inc_p; + control_s[1].id = t_control; +- control_s[1].value = inc_t; ++ control_s[1].un.value = inc_t; + + if ((err = ioctl(vd->fd, VIDIOC_S_EXT_CTRLS, &control_s_array)) < 0) { + printf("ioctl pan-tilt updown control error\n"); +@@ -930,18 +930,18 @@ int enum_frame_intervals(int dev, __u32 pixfmt, __u32 + while ((ret = ioctl(dev, VIDIOC_ENUM_FRAMEINTERVALS, &fival)) == 0) { + if (fival.type == V4L2_FRMIVAL_TYPE_DISCRETE) { + printf("%u/%u, ", +- fival.discrete.numerator, fival.discrete.denominator); ++ fival.un.discrete.numerator, fival.un.discrete.denominator); + } else if (fival.type == V4L2_FRMIVAL_TYPE_CONTINUOUS) { + printf("{min { %u/%u } .. max { %u/%u } }, ", +- fival.stepwise.min.numerator, fival.stepwise.min.numerator, +- fival.stepwise.max.denominator, fival.stepwise.max.denominator); ++ fival.un.stepwise.min.numerator, fival.un.stepwise.min.numerator, ++ fival.un.stepwise.max.denominator, fival.un.stepwise.max.denominator); + break; + } else if (fival.type == V4L2_FRMIVAL_TYPE_STEPWISE) { + printf("{min { %u/%u } .. max { %u/%u } / " + "stepsize { %u/%u } }, ", +- fival.stepwise.min.numerator, fival.stepwise.min.denominator, +- fival.stepwise.max.numerator, fival.stepwise.max.denominator, +- fival.stepwise.step.numerator, fival.stepwise.step.denominator); ++ fival.un.stepwise.min.numerator, fival.un.stepwise.min.denominator, ++ fival.un.stepwise.max.numerator, fival.un.stepwise.max.denominator, ++ fival.un.stepwise.step.numerator, fival.un.stepwise.step.denominator); + break; + } + fival.index++; +@@ -965,25 +965,25 @@ int enum_frame_sizes(int dev, __u32 pixfmt) + while ((ret = ioctl(dev, VIDIOC_ENUM_FRAMESIZES, &fsize)) == 0) { + if (fsize.type == V4L2_FRMSIZE_TYPE_DISCRETE) { + printf("{ discrete: width = %u, height = %u }\n", +- fsize.discrete.width, fsize.discrete.height); ++ fsize.un.discrete.width, fsize.un.discrete.height); + ret = enum_frame_intervals(dev, pixfmt, +- fsize.discrete.width, fsize.discrete.height); ++ fsize.un.discrete.width, fsize.un.discrete.height); + if (ret != 0) + printf(" Unable to enumerate frame sizes.\n"); + } else if (fsize.type == V4L2_FRMSIZE_TYPE_CONTINUOUS) { + printf("{ continuous: min { width = %u, height = %u } .. " + "max { width = %u, height = %u } }\n", +- fsize.stepwise.min_width, fsize.stepwise.min_height, +- fsize.stepwise.max_width, fsize.stepwise.max_height); ++ fsize.un.stepwise.min_width, fsize.un.stepwise.min_height, ++ fsize.un.stepwise.max_width, fsize.un.stepwise.max_height); + printf(" Refusing to enumerate frame intervals.\n"); + break; + } else if (fsize.type == V4L2_FRMSIZE_TYPE_STEPWISE) { + printf("{ stepwise: min { width = %u, height = %u } .. " + "max { width = %u, height = %u } / " + "stepsize { width = %u, height = %u } }\n", +- fsize.stepwise.min_width, fsize.stepwise.min_height, +- fsize.stepwise.max_width, fsize.stepwise.max_height, +- fsize.stepwise.step_width, fsize.stepwise.step_height); ++ fsize.un.stepwise.min_width, fsize.un.stepwise.min_height, ++ fsize.un.stepwise.max_width, fsize.un.stepwise.max_height, ++ fsize.un.stepwise.step_width, fsize.un.stepwise.step_height); + printf(" Refusing to enumerate frame intervals.\n"); + break; + } Index: multimedia/gstreamer-0.10/plugins-good/Makefile =================================================================== RCS file: /cvs/ports/multimedia/gstreamer-0.10/plugins-good/Makefile,v retrieving revision 1.59 diff -N -u -p multimedia/gstreamer-0.10/plugins-good/Makefile --- multimedia/gstreamer-0.10/plugins-good/Makefile 26 Aug 2010 21:33:27 -0000 1.59 +++ multimedia/gstreamer-0.10/plugins-good/Makefile 31 Aug 2010 13:51:07 -0000 @@ -17,7 +17,7 @@ PKGNAME-caca = gstreamer-libcaca-${V} EPOCH-main = 0 -REVISION-main = 2 +REVISION-main = 3 REVISION-aalib = 1 REVISION-dv = 1 REVISION-gdk = 1 Index: multimedia/gstreamer-0.10/plugins-good/patches/patch-sys_v4l2_gstv4l2object_c =================================================================== RCS file: multimedia/gstreamer-0.10/plugins-good/patches/patch-sys_v4l2_gstv4l2object_c diff -N -u -p multimedia/gstreamer-0.10/plugins-good/patches/patch-sys_v4l2_gstv4l2object_c --- /dev/null 31 Aug 2010 07:51:08 -0000 +++ multimedia/gstreamer-0.10/plugins-good/patches/patch-sys_v4l2_gstv4l2object_c 31 Aug 2010 13:51:07 -0000 @@ -0,0 +1,139 @@ +$OpenBSD$ +--- sys/v4l2/gstv4l2object.c.orig Wed Aug 25 09:18:40 2010 ++++ sys/v4l2/gstv4l2object.c Wed Aug 25 09:24:08 2010 +@@ -1372,8 +1372,8 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l + g_value_init (&rate, GST_TYPE_FRACTION); + + do { +- num = ival.discrete.numerator; +- denom = ival.discrete.denominator; ++ num = ival.un.discrete.numerator; ++ denom = ival.un.discrete.denominator; + + if (num > G_MAXINT || denom > G_MAXINT) { + /* let us hope we don't get here... */ +@@ -1405,8 +1405,8 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l + g_value_init (&max, GST_TYPE_FRACTION); + + /* get the min */ +- minnum = ival.stepwise.min.numerator; +- mindenom = ival.stepwise.min.denominator; ++ minnum = ival.un.stepwise.min.numerator; ++ mindenom = ival.un.stepwise.min.denominator; + if (minnum > G_MAXINT || mindenom > G_MAXINT) { + minnum >>= 1; + mindenom >>= 1; +@@ -1416,8 +1416,8 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l + gst_value_set_fraction (&min, minnum, mindenom); + + /* get the max */ +- maxnum = ival.stepwise.max.numerator; +- maxdenom = ival.stepwise.max.denominator; ++ maxnum = ival.un.stepwise.max.numerator; ++ maxdenom = ival.un.stepwise.max.denominator; + if (maxnum > G_MAXINT || maxdenom > G_MAXINT) { + maxnum >>= 1; + maxdenom >>= 1; +@@ -1428,8 +1428,8 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l + gst_value_set_fraction (&max, maxnum, maxdenom); + + /* get the step */ +- num = ival.stepwise.step.numerator; +- denom = ival.stepwise.step.denominator; ++ num = ival.un.stepwise.step.numerator; ++ denom = ival.un.stepwise.step.denominator; + if (num > G_MAXINT || denom > G_MAXINT) { + num >>= 1; + denom >>= 1; +@@ -1480,15 +1480,15 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l + + g_value_init (&rates, GST_TYPE_FRACTION_RANGE); + +- num = ival.stepwise.min.numerator; +- denom = ival.stepwise.min.denominator; ++ num = ival.un.stepwise.min.numerator; ++ denom = ival.un.stepwise.min.denominator; + if (num > G_MAXINT || denom > G_MAXINT) { + num >>= 1; + denom >>= 1; + } + +- maxnum = ival.stepwise.max.numerator; +- maxdenom = ival.stepwise.max.denominator; ++ maxnum = ival.un.stepwise.max.numerator; ++ maxdenom = ival.un.stepwise.max.denominator; + if (maxnum > G_MAXINT || maxdenom > G_MAXINT) { + maxnum >>= 1; + maxdenom >>= 1; +@@ -1586,10 +1586,10 @@ gst_v4l2_object_probe_caps_for_format (GstV4l2Object * + if (size.type == V4L2_FRMSIZE_TYPE_DISCRETE) { + do { + GST_LOG_OBJECT (v4l2object->element, "got discrete frame size %dx%d", +- size.discrete.width, size.discrete.height); ++ size.un.discrete.width, size.un.discrete.height); + +- w = MIN (size.discrete.width, G_MAXINT); +- h = MIN (size.discrete.height, G_MAXINT); ++ w = MIN (size.un.discrete.width, G_MAXINT); ++ h = MIN (size.un.discrete.height, G_MAXINT); + + if (w && h) { + tmp = +@@ -1607,21 +1607,21 @@ gst_v4l2_object_probe_caps_for_format (GstV4l2Object * + } else if (size.type == V4L2_FRMSIZE_TYPE_STEPWISE) { + GST_DEBUG_OBJECT (v4l2object->element, "we have stepwise frame sizes:"); + GST_DEBUG_OBJECT (v4l2object->element, "min width: %d", +- size.stepwise.min_width); ++ size.un.stepwise.min_width); + GST_DEBUG_OBJECT (v4l2object->element, "min height: %d", +- size.stepwise.min_height); ++ size.un.stepwise.min_height); + GST_DEBUG_OBJECT (v4l2object->element, "max width: %d", +- size.stepwise.max_width); ++ size.un.stepwise.max_width); + GST_DEBUG_OBJECT (v4l2object->element, "min height: %d", +- size.stepwise.max_height); ++ size.un.stepwise.max_height); + GST_DEBUG_OBJECT (v4l2object->element, "step width: %d", +- size.stepwise.step_width); ++ size.un.stepwise.step_width); + GST_DEBUG_OBJECT (v4l2object->element, "step height: %d", +- size.stepwise.step_height); ++ size.un.stepwise.step_height); + +- for (w = size.stepwise.min_width, h = size.stepwise.min_height; +- w < size.stepwise.max_width && h < size.stepwise.max_height; +- w += size.stepwise.step_width, h += size.stepwise.step_height) { ++ for (w = size.un.stepwise.min_width, h = size.un.stepwise.min_height; ++ w < size.un.stepwise.max_width && h < size.un.stepwise.max_height; ++ w += size.un.stepwise.step_width, h += size.un.stepwise.step_height) { + if (w == 0 || h == 0) + continue; + +@@ -1639,18 +1639,18 @@ gst_v4l2_object_probe_caps_for_format (GstV4l2Object * + + GST_DEBUG_OBJECT (v4l2object->element, "we have continuous frame sizes:"); + GST_DEBUG_OBJECT (v4l2object->element, "min width: %d", +- size.stepwise.min_width); ++ size.un.stepwise.min_width); + GST_DEBUG_OBJECT (v4l2object->element, "min height: %d", +- size.stepwise.min_height); ++ size.un.stepwise.min_height); + GST_DEBUG_OBJECT (v4l2object->element, "max width: %d", +- size.stepwise.max_width); ++ size.un.stepwise.max_width); + GST_DEBUG_OBJECT (v4l2object->element, "min height: %d", +- size.stepwise.max_height); ++ size.un.stepwise.max_height); + +- w = MAX (size.stepwise.min_width, 1); +- h = MAX (size.stepwise.min_height, 1); +- maxw = MIN (size.stepwise.max_width, G_MAXINT); +- maxh = MIN (size.stepwise.max_height, G_MAXINT); ++ w = MAX (size.un.stepwise.min_width, 1); ++ h = MAX (size.un.stepwise.min_height, 1); ++ maxw = MIN (size.un.stepwise.max_width, G_MAXINT); ++ maxh = MIN (size.un.stepwise.max_height, G_MAXINT); + + tmp = + gst_v4l2_object_probe_caps_for_format_and_size (v4l2object, pixelformat, Index: x11/video/Makefile =================================================================== RCS file: /cvs/ports/x11/video/Makefile,v retrieving revision 1.3 diff -N -u -p x11/video/Makefile --- x11/video/Makefile 8 Aug 2010 20:00:16 -0000 1.3 +++ x11/video/Makefile 31 Aug 2010 13:51:07 -0000 @@ -3,12 +3,11 @@ MASTER_SITES = http://www.bsdfrog.org/OpenBSD/distfiles/ \ ftp://quatramaran.ens.fr/pub/espie/ DISTNAME = video-0 -REVISION = 0 +REVISION = 1 WRKSRC = ${WRKDIR}/video COMMENT = record and display with video(4) CATEGORIES = x11 sysutils -NOT_FOR_ARCHS = ${GCC2_ARCHS} NO_REGRESS = Yes WANTLIB = X11 Xv c @@ -19,15 +18,15 @@ PERMIT_PACKAGE_CDROM = Yes PERMIT_DISTFILES_FTP = Yes PERMIT_DISTFILES_CDROM = Yes +WRKDIST = ${WRKDIR}/video -do-build: +do-build: cd ${WRKBUILD} && ${CC} -I${X11BASE}/include ${CFLAGS} \ -o video video.c -L${X11BASE}/lib -lX11 -lXv - cd ${WRKBUILD} && mandoc video.1 >video.cat1 + cd ${WRKBUILD} && mandoc video.1 > video.cat1 do-install: ${INSTALL_PROGRAM} ${WRKBUILD}/video ${PREFIX}/bin ${INSTALL_MAN} ${WRKBUILD}/video.cat1 ${PREFIX}/man/cat1/video.0 - .include <bsd.port.mk> Index: x11/video/patches/patch-video_c =================================================================== RCS file: x11/video/patches/patch-video_c diff -N -u -p x11/video/patches/patch-video_c --- /dev/null 31 Aug 2010 07:51:08 -0000 +++ x11/video/patches/patch-video_c 31 Aug 2010 13:51:07 -0000 @@ -0,0 +1,64 @@ +$OpenBSD$ +--- video.c.orig Tue Aug 31 06:32:00 2010 ++++ video.c Tue Aug 31 06:31:39 2010 +@@ -710,19 +710,19 @@ dev_get_sizes(struct video *vid) + while (ioctl(d->fd, VIDIOC_ENUM_FRAMESIZES, &fsize) == 0) { + switch (fsize.type) { + case V4L2_FRMSIZE_TYPE_DISCRETE: +- sizes[nsizes].w = fsize.discrete.width; +- sizes[nsizes].h = fsize.discrete.height; ++ sizes[nsizes].w = fsize.un.discrete.width; ++ sizes[nsizes].h = fsize.un.discrete.height; + nsizes++; + break; + case V4L2_FRMSIZE_TYPE_CONTINUOUS: +- step_w = (((fsize.stepwise.max_width - +- fsize.stepwise.min_width) / MAX_DSZS) + 15) & ~15; +- step_h = (((fsize.stepwise.max_height - +- fsize.stepwise.min_height) / MAX_DSZS) + 15) & ~15; +- for (tmp_w = fsize.stepwise.min_width, +- tmp_h = fsize.stepwise.min_height; +- tmp_w <= fsize.stepwise.max_width && +- tmp_h <= fsize.stepwise.max_height; ++ step_w = (((fsize.un.stepwise.max_width - ++ fsize.un.stepwise.min_width) / MAX_DSZS) + 15) & ~15; ++ step_h = (((fsize.un.stepwise.max_height - ++ fsize.un.stepwise.min_height) / MAX_DSZS) + 15) & ~15; ++ for (tmp_w = fsize.un.stepwise.min_width, ++ tmp_h = fsize.un.stepwise.min_height; ++ tmp_w <= fsize.un.stepwise.max_width && ++ tmp_h <= fsize.un.stepwise.max_height; + tmp_w += step_w, tmp_h += step_h) { + sizes[nsizes].w = tmp_w; + sizes[nsizes].h = tmp_h; +@@ -731,18 +731,18 @@ dev_get_sizes(struct video *vid) + } + break; + case V4L2_FRMSIZE_TYPE_STEPWISE: +- step_w = (((fsize.stepwise.max_width - +- fsize.stepwise.min_width) / MAX_DSZS) + +- fsize.stepwise.step_width - 1) & +- ~(fsize.stepwise.step_width - 1); +- step_h = (((fsize.stepwise.max_height - +- fsize.stepwise.min_height) / MAX_DSZS) + +- fsize.stepwise.step_height - 1) & +- ~(fsize.stepwise.step_height - 1); +- for (tmp_w = fsize.stepwise.min_width, +- tmp_h = fsize.stepwise.min_height; +- tmp_w <= fsize.stepwise.max_width && +- tmp_h <= fsize.stepwise.max_height; ++ step_w = (((fsize.un.stepwise.max_width - ++ fsize.un.stepwise.min_width) / MAX_DSZS) + ++ fsize.un.stepwise.step_width - 1) & ++ ~(fsize.un.stepwise.step_width - 1); ++ step_h = (((fsize.un.stepwise.max_height - ++ fsize.un.stepwise.min_height) / MAX_DSZS) + ++ fsize.un.stepwise.step_height - 1) & ++ ~(fsize.un.stepwise.step_height - 1); ++ for (tmp_w = fsize.un.stepwise.min_width, ++ tmp_h = fsize.un.stepwise.min_height; ++ tmp_w <= fsize.un.stepwise.max_width && ++ tmp_h <= fsize.un.stepwise.max_height; + tmp_w += step_w, tmp_h += step_h) { + sizes[nsizes].w = tmp_w; + sizes[nsizes].h = tmp_h; Index: x11/vlc/Makefile =================================================================== RCS file: /cvs/ports/x11/vlc/Makefile,v retrieving revision 1.97 diff -N -u -p x11/vlc/Makefile --- x11/vlc/Makefile 25 Aug 2010 23:27:21 -0000 1.97 +++ x11/vlc/Makefile 31 Aug 2010 13:51:07 -0000 @@ -7,7 +7,7 @@ COMMENT-main= VideoLAN client; multimedia player V= 1.0.6 DISTNAME= vlc-${V} PKGNAME-main= ${DISTNAME} -REVISION-main= 7 +REVISION-main= 8 CATEGORIES= x11 MASTER_SITES= http://download.videolan.org/pub/videolan/vlc/${V}/ EXTRACT_SUFX= .tar.bz2 Index: x11/vlc/patches/patch-modules_access_v4l2_c =================================================================== RCS file: /cvs/ports/x11/vlc/patches/patch-modules_access_v4l2_c,v retrieving revision 1.2 diff -N -u -p x11/vlc/patches/patch-modules_access_v4l2_c --- x11/vlc/patches/patch-modules_access_v4l2_c 3 Jun 2010 01:05:03 -0000 1.2 +++ x11/vlc/patches/patch-modules_access_v4l2_c 31 Aug 2010 13:51:07 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-modules_access_v4l2_c,v 1.2 2010/06/03 01:05:03 sthen Exp $ ---- modules/access/v4l2.c.orig Wed May 5 18:50:08 2010 -+++ modules/access/v4l2.c Wed May 5 19:09:36 2010 +--- modules/access/v4l2.c.orig Sun Mar 7 10:38:01 2010 ++++ modules/access/v4l2.c Mon Aug 30 17:38:54 2010 @@ -49,7 +49,13 @@ #include <sys/ioctl.h> #include <sys/mman.h> @@ -15,4 +15,215 @@ $OpenBSD: patch-modules_access_v4l2_c,v 1.2 2010/06/03 +#endif #include <poll.h> + +@@ -1655,8 +1661,8 @@ static float GetMaxFrameRate( demux_t *p_demux, int i_ + float f_fps_max = -1; + do + { +- float f_fps = (float)frmival.discrete.denominator +- / (float)frmival.discrete.numerator; ++ float f_fps = (float)frmival.un.discrete.denominator ++ / (float)frmival.un.discrete.numerator; + if( f_fps > f_fps_max ) f_fps_max = f_fps; + frmival.index++; + } while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FRAMEINTERVALS, +@@ -1665,10 +1671,10 @@ static float GetMaxFrameRate( demux_t *p_demux, int i_ + } + case V4L2_FRMSIZE_TYPE_STEPWISE: + case V4L2_FRMIVAL_TYPE_CONTINUOUS: +- return __MAX( (float)frmival.stepwise.max.denominator +- / (float)frmival.stepwise.max.numerator, +- (float)frmival.stepwise.min.denominator +- / (float)frmival.stepwise.min.numerator ); ++ return __MAX( (float)frmival.un.stepwise.max.denominator ++ / (float)frmival.un.stepwise.max.numerator, ++ (float)frmival.un.stepwise.min.denominator ++ / (float)frmival.un.stepwise.min.numerator ); + } + } + #endif +@@ -1697,21 +1703,21 @@ static float GetAbsoluteMaxFrameRate( demux_t *p_demux + frmsize.index++; + float f_fps = GetMaxFrameRate( p_demux, i_fd, + i_pixel_format, +- frmsize.discrete.width, +- frmsize.discrete.height ); ++ frmsize.un.discrete.width, ++ frmsize.un.discrete.height ); + if( f_fps > f_fps_max ) f_fps_max = f_fps; + } while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FRAMESIZES, + &frmsize ) >= 0 ); + break; + case V4L2_FRMSIZE_TYPE_STEPWISE: + { +- uint32_t i_width = frmsize.stepwise.min_width; +- uint32_t i_height = frmsize.stepwise.min_height; ++ uint32_t i_width = frmsize.un.stepwise.min_width; ++ uint32_t i_height = frmsize.un.stepwise.min_height; + for( ; +- i_width <= frmsize.stepwise.max_width && +- i_height <= frmsize.stepwise.max_width; +- i_width += frmsize.stepwise.step_width, +- i_height += frmsize.stepwise.step_height ) ++ i_width <= frmsize.un.stepwise.max_width && ++ i_height <= frmsize.un.stepwise.max_width; ++ i_width += frmsize.un.stepwise.step_width, ++ i_height += frmsize.un.stepwise.step_height ) + { + float f_fps = GetMaxFrameRate( p_demux, i_fd, + i_pixel_format, +@@ -1725,8 +1731,8 @@ static float GetAbsoluteMaxFrameRate( demux_t *p_demux + msg_Err( p_demux, "GetAbsoluteMaxFrameRate implementation for V4L2_FRMSIZE_TYPE_CONTINUOUS isn't correct" ); + f_fps_max = GetMaxFrameRate( p_demux, i_fd, + i_pixel_format, +- frmsize.stepwise.max_width, +- frmsize.stepwise.max_height ); ++ frmsize.un.stepwise.max_width, ++ frmsize.un.stepwise.max_height ); + break; + } + } +@@ -1758,26 +1764,26 @@ static void GetMaxDimensions( demux_t *p_demux, int i_ + frmsize.index++; + float f_fps = GetMaxFrameRate( p_demux, i_fd, + i_pixel_format, +- frmsize.discrete.width, +- frmsize.discrete.height ); ++ frmsize.un.discrete.width, ++ frmsize.un.discrete.height ); + if( f_fps >= f_fps_min && +- frmsize.discrete.width > *pi_width ) ++ frmsize.un.discrete.width > *pi_width ) + { +- *pi_width = frmsize.discrete.width; +- *pi_height = frmsize.discrete.height; ++ *pi_width = frmsize.un.discrete.width; ++ *pi_height = frmsize.un.discrete.height; + } + } while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FRAMESIZES, + &frmsize ) >= 0 ); + break; + case V4L2_FRMSIZE_TYPE_STEPWISE: + { +- uint32_t i_width = frmsize.stepwise.min_width; +- uint32_t i_height = frmsize.stepwise.min_height; ++ uint32_t i_width = frmsize.un.stepwise.min_width; ++ uint32_t i_height = frmsize.un.stepwise.min_height; + for( ; +- i_width <= frmsize.stepwise.max_width && +- i_height <= frmsize.stepwise.max_width; +- i_width += frmsize.stepwise.step_width, +- i_height += frmsize.stepwise.step_height ) ++ i_width <= frmsize.un.stepwise.max_width && ++ i_height <= frmsize.un.stepwise.max_width; ++ i_width += frmsize.un.stepwise.step_width, ++ i_height += frmsize.un.stepwise.step_height ) + { + float f_fps = GetMaxFrameRate( p_demux, i_fd, + i_pixel_format, +@@ -1795,13 +1801,13 @@ static void GetMaxDimensions( demux_t *p_demux, int i_ + msg_Err( p_demux, "GetMaxDimension implementation for V4L2_FRMSIZE_TYPE_CONTINUOUS isn't correct" ); + float f_fps = GetMaxFrameRate( p_demux, i_fd, + i_pixel_format, +- frmsize.stepwise.max_width, +- frmsize.stepwise.max_height ); ++ frmsize.un.stepwise.max_width, ++ frmsize.un.stepwise.max_height ); + if( f_fps >= f_fps_min && +- frmsize.stepwise.max_width > *pi_width ) ++ frmsize.un.stepwise.max_width > *pi_width ) + { +- *pi_width = frmsize.stepwise.max_width; +- *pi_height = frmsize.stepwise.max_height; ++ *pi_width = frmsize.un.stepwise.max_width; ++ *pi_height = frmsize.un.stepwise.max_height; + } + break; + } +@@ -2212,27 +2218,27 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sy + do + { + msg_Dbg( p_obj, " supported frame interval: %d/%d", +- frmival.discrete.numerator, +- frmival.discrete.denominator ); ++ frmival.un.discrete.numerator, ++ frmival.un.discrete.denominator ); + frmival.index++; + } while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FRAMEINTERVALS, &frmival ) >= 0 ); + break; + case V4L2_FRMIVAL_TYPE_STEPWISE: + msg_Dbg( p_obj, " supported frame intervals: %d/%d to " + "%d/%d using %d/%d increments", +- frmival.stepwise.min.numerator, +- frmival.stepwise.min.denominator, +- frmival.stepwise.max.numerator, +- frmival.stepwise.max.denominator, +- frmival.stepwise.step.numerator, +- frmival.stepwise.step.denominator ); ++ frmival.un.stepwise.min.numerator, ++ frmival.un.stepwise.min.denominator, ++ frmival.un.stepwise.max.numerator, ++ frmival.un.stepwise.max.denominator, ++ frmival.un.stepwise.step.numerator, ++ frmival.un.stepwise.step.denominator ); + break; + case V4L2_FRMIVAL_TYPE_CONTINUOUS: + msg_Dbg( p_obj, " supported frame intervals: %d/%d to %d/%d", +- frmival.stepwise.min.numerator, +- frmival.stepwise.min.denominator, +- frmival.stepwise.max.numerator, +- frmival.stepwise.max.denominator ); ++ frmival.un.stepwise.min.numerator, ++ frmival.un.stepwise.min.denominator, ++ frmival.un.stepwise.max.numerator, ++ frmival.un.stepwise.max.denominator ); + break; + } + } +@@ -2681,22 +2687,22 @@ static bool ProbeVideoDev( vlc_object_t *p_obj, demux_ + { + msg_Dbg( p_obj, + " device supports size %dx%d", +- frmsize.discrete.width, frmsize.discrete.height ); ++ frmsize.un.discrete.width, frmsize.un.discrete.height ); + frmsize.index++; + } while( v4l2_ioctl( i_fd, VIDIOC_ENUM_FRAMESIZES, &frmsize ) >= 0 ); + break; + case V4L2_FRMSIZE_TYPE_STEPWISE: + msg_Dbg( p_obj, + " device supports sizes %dx%d to %dx%d using %dx%d increments", +- frmsize.stepwise.min_width, frmsize.stepwise.min_height, +- frmsize.stepwise.max_width, frmsize.stepwise.max_height, +- frmsize.stepwise.step_width, frmsize.stepwise.step_height ); ++ frmsize.un.stepwise.min_width, frmsize.un.stepwise.min_height, ++ frmsize.un.stepwise.max_width, frmsize.un.stepwise.max_height, ++ frmsize.un.stepwise.step_width, frmsize.un.stepwise.step_height ); + break; + case V4L2_FRMSIZE_TYPE_CONTINUOUS: + msg_Dbg( p_obj, + " device supports all sizes %dx%d to %dx%d", +- frmsize.stepwise.min_width, frmsize.stepwise.min_height, +- frmsize.stepwise.max_width, frmsize.stepwise.max_height ); ++ frmsize.un.stepwise.min_width, frmsize.un.stepwise.min_height, ++ frmsize.un.stepwise.max_width, frmsize.un.stepwise.max_height ); + break; + } + } +@@ -3231,7 +3237,7 @@ static int Control( vlc_object_t *p_obj, demux_sys_t * + + if( i_value >= queryctrl.minimum && i_value <= queryctrl.maximum ) + { +- ext_control.value = i_value; ++ ext_control.un.value = i_value; + if( v4l2_ioctl( i_fd, VIDIOC_S_EXT_CTRLS, &ext_controls ) < 0 ) + { + control.value = i_value; +@@ -3246,7 +3252,7 @@ static int Control( vlc_object_t *p_obj, demux_sys_t * + else + { + i_ret = v4l2_ioctl( i_fd, VIDIOC_G_EXT_CTRLS, &ext_controls ); +- control.value = ext_control.value; ++ control.value = ext_control.un.value; + } + }
