Enable the libv4l2 support in VLC.

from Brad (maintainer)
This commit is contained in:
ajacoutot 2016-01-23 08:09:50 +00:00
parent 2533020314
commit 5a82f26bad
4 changed files with 44 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.200 2016/01/17 17:29:12 sthen Exp $
# $OpenBSD: Makefile,v 1.201 2016/01/23 08:09:50 ajacoutot Exp $
SHARED_ONLY= Yes
@ -9,7 +9,7 @@ V= 2.2.1
DISTNAME= vlc-${V}
PKGNAME-main= ${DISTNAME}
PKGNAME-jack= vlc-jack-${V}
REVISION-main= 5
REVISION-main= 6
CATEGORIES= x11
MASTER_SITES= https://download.videolan.org/pub/videolan/vlc/${V}/
EXTRACT_SUFX= .tar.xz
@ -26,6 +26,7 @@ PERMIT_PACKAGE_CDROM= patents
PERMIT_PACKAGE_FTP= Yes
WANTLIB-common= c dbus-1 idn m pthread ${MODGETTEXT_WANTLIB}
# v4l2 is dlopen'd
WANTLIB-main= EGL GL ICE lib/qt4/QtGui QtCore SM SDL SDL_image X11 \
Xcomposite Xcursor Xdamage Xext Xfixes Xi Xinerama Xpm \
Xrender Xrandr ass atk-1.0 avcodec avformat avutil bluray \
@ -37,7 +38,7 @@ WANTLIB-main= EGL GL ICE lib/qt4/QtGui QtCore SM SDL SDL_image X11 \
ogg p11-kit pango-1.0 pangocairo-1.0 pangoft2-1.0 pcre \
pixman-1 png postproc pthread-stubs rsvg-2 samplerate sndio \
speex speexdsp stdc++ swscale tag tar tasn1 tiff usbhid \
vorbis vorbisenc webp x264 x265 xcb-composite xcb-keysyms \
v4l2 vorbis vorbisenc webp x264 x265 xcb-composite xcb-keysyms \
xcb-randr xcb-render xcb-shape xcb-shm xcb-xfixes xcb-xv \
xcb xml2 z X11-xcb Xxf86vm drm gbm glapi xcb-dri2 xcb-glx \
${WANTLIB-common}
@ -74,6 +75,7 @@ LIB_DEPENDS-main= ${MODQT4_LIB_DEPENDS} \
multimedia/libbluray>=0.8.0 \
multimedia/libdvdnav \
multimedia/libmatroska \
multimedia/libv4l \
multimedia/x264 \
multimedia/x265 \
security/gnutls \
@ -147,7 +149,6 @@ CONFIGURE_ARGS+=--disable-a52 \
--disable-twolame \
--disable-udev \
--disable-upnp \
--disable-v4l2 \
--disable-vdpau \
--disable-vnc \
--disable-vpx \

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-modules_access_v4l2_lib_c,v 1.1 2016/01/23 08:09:50 ajacoutot Exp $
Linux driver doesn't exist on OpenBSD and adjust dlopen() use
for OpenBSD.
--- modules/access/v4l2/lib.c.orig Sat Jan 9 21:59:47 2016
+++ modules/access/v4l2/lib.c Sat Jan 9 22:00:24 2016
@@ -50,9 +50,7 @@ static void v4l2_lib_load (void)
{
void *h;
- h = dlopen ("libmediaclient.so", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (h == NULL)
- h = dlopen ("libv4l2.so.0", RTLD_LAZY | RTLD_LOCAL);
+ h = dlopen ("libv4l2.so", RTLD_LAZY | RTLD_LOCAL);
if (h == NULL)
goto fallback;

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-modules_access_v4l2_v4l2_h,v 1.1 2016/01/23 08:09:50 ajacoutot Exp $
Use OpenBSD's videoio.h header.
--- modules/access/v4l2/v4l2.h.orig Sat Jan 9 21:39:10 2016
+++ modules/access/v4l2/v4l2.h Sat Jan 9 21:51:49 2016
@@ -18,7 +18,12 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#ifdef HAVE_SYS_VIDEOIO_H
+#include <sys/ioccom.h>
+#include <sys/videoio.h>
+#else
#include <linux/videodev2.h>
+#endif
/* libv4l2 functions */
extern int v4l2_fd_open (int, int);

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-main,v 1.38 2015/10/01 15:16:14 ajacoutot Exp $
@comment $OpenBSD: PLIST-main,v 1.39 2016/01/23 08:09:50 ajacoutot Exp $
@pkgpath x11/vlc
%%amd64%%
%%i386%%
@ -128,6 +128,7 @@ lib/vlc/plugins/access/libshm_plugin.so
lib/vlc/plugins/access/libtcp_plugin.so
lib/vlc/plugins/access/libtimecode_plugin.so
lib/vlc/plugins/access/libudp_plugin.so
lib/vlc/plugins/access/libv4l2_plugin.so
lib/vlc/plugins/access/libvcd_plugin.so
lib/vlc/plugins/access/libvdr_plugin.so
lib/vlc/plugins/access/libxcb_screen_plugin.so