changeset 973:136f654dfc03 libavformat

print a hint when trying V4L2 on V4L device
author alex
date Sun, 26 Feb 2006 13:22:32 +0000
parents d983c2b9333e
children e0cfc88ad93a
files v4l2.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/v4l2.c	Sat Feb 25 22:41:31 2006 +0000
+++ b/v4l2.c	Sun Feb 26 13:22:32 2006 +0000
@@ -122,6 +122,13 @@
     }
 
     res = ioctl(fd, VIDIOC_QUERYCAP, &cap);
+    // ENOIOCTLCMD definition only availble on __KERNEL__
+    if (res < 0 && errno == 515)
+    {
+        av_log(NULL, AV_LOG_ERROR, "QUERYCAP not implemented, probably V4L device but not supporting V4L2\n");
+
+        return -1;
+    }
     if (res < 0) {
         av_log(NULL, AV_LOG_ERROR, "ioctl(VIDIOC_QUERYCAP): %s\n",
                  strerror(errno));