SDL_camera_v4l2: allow building against older kernel headers

This commit is contained in:
Ozkan Sezer
2024-02-22 00:04:10 +03:00
committed by Ozkan Sezer
parent 58e6eacf97
commit 3b7533f4a2

View File

@@ -22,6 +22,7 @@
#ifdef SDL_CAMERA_DRIVER_V4L2
#include <stddef.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <fcntl.h> // low-level i/o
@@ -30,6 +31,12 @@
#include <sys/stat.h>
#include <linux/videodev2.h>
#ifndef V4L2_CAP_DEVICE_CAPS
// device_caps was added to struct v4l2_capability as of kernel 3.4.
#define device_caps reserved[0]
SDL_COMPILE_TIME_ASSERT(v4l2devicecaps, offsetof(struct v4l2_capability,device_caps) == offsetof(struct v4l2_capability,capabilities) + 4);
#endif
#include "../SDL_syscamera.h"
#include "../SDL_camera_c.h"
#include "../../video/SDL_pixels_c.h"