mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-28 11:57:24 +08:00
SDL_camera_v4l2: allow building against older kernel headers
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#ifdef SDL_CAMERA_DRIVER_V4L2
|
#ifdef SDL_CAMERA_DRIVER_V4L2
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <fcntl.h> // low-level i/o
|
#include <fcntl.h> // low-level i/o
|
||||||
@@ -30,6 +31,12 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <linux/videodev2.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_syscamera.h"
|
||||||
#include "../SDL_camera_c.h"
|
#include "../SDL_camera_c.h"
|
||||||
#include "../../video/SDL_pixels_c.h"
|
#include "../../video/SDL_pixels_c.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user