Skip to content

Commit

Permalink
Merge pull request #247 from cockroach/master
Browse files Browse the repository at this point in the history
Fix compile-time issue on very old kernels
  • Loading branch information
bbonev authored Apr 6, 2023
2 parents 9bcbc13 + 09b536e commit 39979dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/v4l_id/v4l_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <linux/version.h>
#include <linux/videodev2.h>

#include "util.h"
Expand Down Expand Up @@ -71,9 +72,11 @@ int main(int argc, char *argv[]) {
printf("ID_V4L_VERSION=2\n");
printf("ID_V4L_PRODUCT=%s\n", v2cap.card);
printf("ID_V4L_CAPABILITIES=:");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
if (v2cap.capabilities & V4L2_CAP_DEVICE_CAPS)
capabilities = v2cap.device_caps;
else
#endif
capabilities = v2cap.capabilities;
if ((capabilities & V4L2_CAP_VIDEO_CAPTURE) > 0 ||
(capabilities & V4L2_CAP_VIDEO_CAPTURE_MPLANE) > 0)
Expand Down

0 comments on commit 39979dd

Please sign in to comment.