Download raw body.
multimedia/gstreamer1/plugins-good: fix v4l plugin
On Sun, Jul 20, 2025 at 01:25:40PM +0200, Kirill A. Korinsky wrote:
> Antoine, ports@,
>
> I'd like to bring back support of v4l plugin for gstreamer which was
> disabled as part of update to 1.26.1 a few months ago.
>
> It needs a trivial patch.
>
> Ok?
ratchov@ already has a diff for this which I already OK'ed.
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/multimedia/gstreamer1/plugins-good/Makefile,v
> diff -u -p -r1.89 Makefile
> --- Makefile 1 May 2025 06:55:57 -0000 1.89
> +++ Makefile 20 Jul 2025 11:25:20 -0000
> @@ -1,5 +1,7 @@
> COMMENT= good elements for GStreamer
>
> +REVISION= 0
> +
> DISTNAME= gst-plugins-good-${V}
>
> SITES= ${SITE_GST:=gst-plugins-good/}
> @@ -9,12 +11,12 @@ COMPILER_LANGS= c c++
>
> WANTLIB += ${COMPILER_LIBCXX} FLAC X11 Xdamage Xext Xfixes Xtst
> WANTLIB += bz2 cairo cairo-gobject gdk-3 gdk_pixbuf-2.0 gio-2.0
> -WANTLIB += glib-2.0 gobject-2.0 gstaudio-1.0 gstbase-1.0 gstfft-1.0
> -WANTLIB += gstgl-1.0 gstnet-1.0 gstpbutils-1.0 gstreamer-1.0 gstriff-1.0
> -WANTLIB += gstrtp-1.0 gstrtsp-1.0 gstsdp-1.0 gsttag-1.0 gstvideo-1.0
> -WANTLIB += gtk-3 intl jpeg m mp3lame nettle opencore-amrnb opencore-amrwb
> -WANTLIB += orc-0.4 png shout speex tag twolame vpx wavpack xml2
> -WANTLIB += z
> +WANTLIB += glib-2.0 gobject-2.0 gstallocators-1.0 gstaudio-1.0
> +WANTLIB += gstbase-1.0 gstfft-1.0 gstgl-1.0 gstnet-1.0 gstpbutils-1.0
> +WANTLIB += gstreamer-1.0 gstriff-1.0 gstrtp-1.0 gstrtsp-1.0 gstsdp-1.0
> +WANTLIB += gsttag-1.0 gstvideo-1.0 gtk-3 intl jpeg m mp3lame nettle
> +WANTLIB += opencore-amrnb opencore-amrwb orc-0.4 png shout speex
> +WANTLIB += tag twolame v4l2 vpx wavpack xml2 z
>
> LIB_DEPENDS= multimedia/gstreamer1/plugins-base=${V} \
> archivers/bzip2 \
> @@ -25,6 +27,7 @@ LIB_DEPENDS= multimedia/gstreamer1/plug
> audio/taglib \
> audio/twolame \
> audio/wavpack \
> + multimedia/libv4l \
> multimedia/libvpx \
> net/libshout \
> x11/gtk+3
> @@ -52,10 +55,6 @@ CONFIGURE_ARGS= -Daalib=disabled \
> -Dwaveform=disabled \
> -Dv4l2-gudev=disabled \
> -Drpicamsrc=disabled
> -
> -# XXX
> -# ../gst-plugins-good-1.26.1/sys/v4l2/gstv4l2object.c:601:25: error: use of undeclared identifier 'v4l2_ioctl_wrapper'
> -CONFIGURE_ARGS += -Dv4l2=disabled
>
> .if ${MACHINE_ARCH} == "amd64"
> BUILD_DEPENDS += devel/nasm
> Index: patches/patch-sys_v4l2_gstv4l2object_c
> ===================================================================
> RCS file: /cvs/ports/multimedia/gstreamer1/plugins-good/patches/patch-sys_v4l2_gstv4l2object_c,v
> diff -u -p -r1.14 patch-sys_v4l2_gstv4l2object_c
> --- patches/patch-sys_v4l2_gstv4l2object_c 27 Jun 2025 10:12:15 -0000 1.14
> +++ patches/patch-sys_v4l2_gstv4l2object_c 20 Jul 2025 11:25:20 -0000
> @@ -1,6 +1,15 @@
> Index: sys/v4l2/gstv4l2object.c
> --- sys/v4l2/gstv4l2object.c.orig
> +++ sys/v4l2/gstv4l2object.c
> +@@ -529,7 +529,7 @@ v4l2_mmap_wrapper (gpointer start, gsize length, gint
> +
> + #endif /* SIZEOF_OFF_T < 8 */
> +
> +-#if defined(__linux__) && !defined(__GLIBC__)
> ++#if !defined(__GLIBC__)
> + /* v4l2_ioctl always takes request as unsigned long int, not ioctl_req_t */
> + static gint
> + v4l2_ioctl_wrapper (gint fd, ioctl_req_t request, ...)
> @@ -5332,7 +5332,9 @@ gst_v4l2_object_probe_caps (GstV4l2Object * v4l2object
> if (v4l2object->ioctl (v4l2object->video_fd, VIDIOC_CROPCAP, &cropcap) < 0) {
>
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/multimedia/gstreamer1/plugins-good/pkg/PLIST,v
> diff -u -p -r1.6 PLIST
> --- pkg/PLIST 1 May 2025 06:55:57 -0000 1.6
> +++ pkg/PLIST 20 Jul 2025 11:25:20 -0000
> @@ -58,6 +58,7 @@
> @so lib/gstreamer-${API}/libgsttaglib.so
> @so lib/gstreamer-${API}/libgsttwolame.so
> @so lib/gstreamer-${API}/libgstudp.so
> +@so lib/gstreamer-${API}/libgstvideo4linux2.so
> @so lib/gstreamer-${API}/libgstvideobox.so
> @so lib/gstreamer-${API}/libgstvideocrop.so
> @so lib/gstreamer-${API}/libgstvideofilter.so
--
Antoine
multimedia/gstreamer1/plugins-good: fix v4l plugin