From 4497ab31c2e2fc17b8f5296780354006631eda64 Mon Sep 17 00:00:00 2001 From: fryshorts Date: Sat, 2 May 2015 15:05:38 +0200 Subject: [PATCH] linux-v4l2: Fix build errors for older api Fix build errors for older versions of the api where VIDIOC_ENUM_DV_TIMINGS was defined but V4L2_IN_CAP_DV_TIMINGS was not. I was under the impression that they were added at the same time, but apparently i was wrong there. Thanks to kmoore@FreeBSD.org for spotting this on FreeBSD. --- plugins/linux-v4l2/v4l2-helpers.c | 2 +- plugins/linux-v4l2/v4l2-input.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/linux-v4l2/v4l2-helpers.c b/plugins/linux-v4l2/v4l2-helpers.c index d468b9011..97ec3aa73 100644 --- a/plugins/linux-v4l2/v4l2-helpers.c +++ b/plugins/linux-v4l2/v4l2-helpers.c @@ -240,7 +240,7 @@ int_fast32_t v4l2_set_standard(int_fast32_t dev, int *standard) int_fast32_t v4l2_enum_dv_timing(int_fast32_t dev, struct v4l2_dv_timings *dvt, int index) { -#ifndef VIDIOC_ENUM_DV_TIMINGS +#if !defined(VIDIOC_ENUM_DV_TIMINGS) || !defined(V4L2_IN_CAP_DV_TIMINGS) UNUSED_PARAMETER(dev); UNUSED_PARAMETER(dvt); UNUSED_PARAMETER(index); diff --git a/plugins/linux-v4l2/v4l2-input.c b/plugins/linux-v4l2/v4l2-input.c index 422306262..0a4d7f4ac 100644 --- a/plugins/linux-v4l2/v4l2-input.c +++ b/plugins/linux-v4l2/v4l2-input.c @@ -43,7 +43,7 @@ along with this program. If not, see . /* The new dv timing api was introduced in Linux 3.4 * Currently we simply disable dv timings when this is not defined */ -#ifndef VIDIOC_ENUM_DV_TIMINGS +#if !defined(VIDIOC_ENUM_DV_TIMINGS) || !defined(V4L2_IN_CAP_DV_TIMINGS) #define V4L2_IN_CAP_DV_TIMINGS 0 #endif @@ -949,7 +949,7 @@ static void *v4l2_create(obs_data_t *settings, obs_source_t *source) #ifndef V4L2_CAP_DEVICE_CAPS blog(LOG_WARNING, "Plugin built without device caps support!"); #endif -#ifndef VIDIOC_ENUM_DV_TIMINGS +#if !defined(VIDIOC_ENUM_DV_TIMINGS) || !defined(V4L2_IN_CAP_DV_TIMINGS) blog(LOG_WARNING, "Plugin built without dv-timing support!"); #endif