v4l2-apps: rename capture_example to capture-example
authorHans Verkuil <hverkuil@xs4all.nl>
Fri, 13 Feb 2009 12:23:52 +0000 (13:23 +0100)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 13 Feb 2009 12:23:52 +0000 (13:23 +0100)
From: Hans Verkuil <hverkuil@xs4all.nl>

Follow the existing naming conventions.
Also did a few small cleanups in this source.

Priority: normal

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
contrib/test/Makefile
contrib/test/capture-example.c [moved from contrib/test/capture_example.c with 98% similarity]

index 554940e..d118b92 100644 (file)
@@ -10,7 +10,7 @@ binaries = ioctl-test                 \
           driver-test          \
           pixfmt-test          \
           stress-buffer        \
-          capture_example
+          capture-example
 
 .PHONY: all clean install
 
similarity index 98%
rename from contrib/test/capture_example.c
rename to contrib/test/capture-example.c
index 0cd1298..9d5b0d6 100644 (file)
 #include <sys/mman.h>
 #include <sys/ioctl.h>
 
-#include <asm/types.h>          /* for videodev2.h */
-
 #include <linux/videodev2.h>
 
 #define CLEAR(x) memset(&(x), 0, sizeof(x))
 
-typedef enum {
+enum io_method {
        IO_METHOD_READ,
        IO_METHOD_MMAP,
        IO_METHOD_USERPTR,
-} io_method;
+};
 
 struct buffer {
        void   *start;
@@ -41,7 +39,7 @@ struct buffer {
 };
 
 static char            *dev_name;
-static io_method        io = IO_METHOD_MMAP;
+static enum io_method   io = IO_METHOD_MMAP;
 static int              fd = -1;
 struct buffer          *buffers;
 static unsigned int     n_buffers;
@@ -570,7 +568,7 @@ static void usage(FILE *fp, int argc, char **argv)
                 "-f | --format        Force format to 640x480 YUYV\n"
                 "-c | --count         Number of frames to grab [%i]\n"
                 "",
-                argv[0],dev_name,frame_count );
+                argv[0], dev_name, frame_count);
 }
 
 static const char short_options[] = "d:hmruofc:";