[vlc-commits] [Git][videolan/vlc][master] 2 commits: v4l2: use proper headers for OpenBSD's V4L2 support
Rémi Denis-Courmont (@Courmisch)
gitlab at videolan.org
Thu Feb 3 08:30:30 UTC 2022
Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC
Commits:
c7905ecc by Brad Smith at 2022-02-03T08:03:17+00:00
v4l2: use proper headers for OpenBSD's V4L2 support
Fixes #26572
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
- - - - -
ed4a5feb by Brad Smith at 2022-02-03T08:03:17+00:00
v4l2: dlopen proper library name on OpenBSD
Fixes #26573
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
- - - - -
3 changed files:
- configure.ac
- modules/access/v4l2/lib.c
- modules/access/v4l2/v4l2.h
Changes:
=====================================
configure.ac
=====================================
@@ -2103,7 +2103,7 @@ AC_ARG_ENABLE([v4l2], AS_HELP_STRING([--disable-v4l2],
[disable Video4Linux version 2 (default auto)]))
have_v4l2="no"
AS_IF([test "$enable_v4l2" != "no"], [
- AC_CHECK_HEADERS([linux/videodev2.h], [
+ AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
have_v4l2="yes"
])
])
=====================================
modules/access/v4l2/lib.c
=====================================
@@ -31,6 +31,12 @@
#include "v4l2.h"
+#ifdef __OpenBSD__
+#define V4L2_LIB "libv4l2.so"
+#else
+#define V4L2_LIB "libv4l2.so.0"
+#endif
+
static int fd_open (int fd, int flags)
{
(void) flags;
@@ -55,7 +61,7 @@ static void v4l2_lib_load (void)
h = dlopen ("libmediaclient.so", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
if (h == NULL)
- h = dlopen ("libv4l2.so.0", RTLD_LAZY | RTLD_LOCAL);
+ h = dlopen (V4L2_LIB, RTLD_LAZY | RTLD_LOCAL);
if (h == NULL)
return;
=====================================
modules/access/v4l2/v4l2.h
=====================================
@@ -18,7 +18,12 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#include <linux/videodev2.h>
+#if defined(HAVE_LINUX_VIDEODEV2_H)
+# include <linux/videodev2.h>
+#elif defined(HAVE_SYS_VIDEOIO_H)
+# include <sys/ioccom.h>
+# include <sys/videoio.h>
+#endif
/* libv4l2 functions */
extern int v4l2_fd_open(int, int);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dfbad0fbf8e372cef68863ad94a4185007895079...ed4a5feb243a201b7890672f3d376b4586a16593
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dfbad0fbf8e372cef68863ad94a4185007895079...ed4a5feb243a201b7890672f3d376b4586a16593
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list