libv4l: s/v4l2_pix_fmt_identical/v4l2_pix_fmt_compat/
authorHans de Goede <hdegoede@redhat.com>
Mon, 9 May 2011 11:56:14 +0000 (13:56 +0200)
committerHans de Goede <hdegoede@redhat.com>
Tue, 10 May 2011 07:44:52 +0000 (09:44 +0200)
The current identical function checks for compat pix formats, not for identical
ones (the padding may be different), so rename it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
lib/libv4l2/libv4l2.c

index 1ddd3d3..95d62e7 100644 (file)
@@ -772,7 +772,7 @@ static int v4l2_check_buffer_change_ok(int index)
        return 0;
 }
 
-static int v4l2_pix_fmt_identical(struct v4l2_format *a, struct v4l2_format *b)
+static int v4l2_pix_fmt_compat(struct v4l2_format *a, struct v4l2_format *b)
 {
        if (a->fmt.pix.width == b->fmt.pix.width &&
                        a->fmt.pix.height == b->fmt.pix.height &&
@@ -793,7 +793,7 @@ static void v4l2_set_src_and_dest_format(int index,
        dest_fmt->fmt.pix.field = src_fmt->fmt.pix.field;
        dest_fmt->fmt.pix.colorspace = src_fmt->fmt.pix.colorspace;
        /* When we're not converting use bytesperline and imagesize from src_fmt */
-       if (v4l2_pix_fmt_identical(src_fmt, dest_fmt)) {
+       if (v4l2_pix_fmt_compat(src_fmt, dest_fmt)) {
                dest_fmt->fmt.pix.bytesperline = src_fmt->fmt.pix.bytesperline;
                dest_fmt->fmt.pix.sizeimage = src_fmt->fmt.pix.sizeimage;
        }
@@ -966,7 +966,7 @@ int v4l2_ioctl(int fd, unsigned long int request, ...)
                /* Don't be lazy on uvc cams, as this triggers a bug in the uvcvideo
                   driver in kernel <= 2.6.28 (with certain cams) */
                if (!(devices[index].flags & V4L2_IS_UVC) &&
-                               v4l2_pix_fmt_identical(&devices[index].dest_fmt, dest_fmt)) {
+                               v4l2_pix_fmt_compat(&devices[index].dest_fmt, dest_fmt)) {
                        *dest_fmt = devices[index].dest_fmt;
                        result = 0;
                        break;
@@ -1012,7 +1012,7 @@ int v4l2_ioctl(int fd, unsigned long int request, ...)
                /* Maybe after try format has adjusted width/height etc, to whats
                   available nothing has changed (on the cam side) ? */
                if (!(devices[index].flags & V4L2_IS_UVC) &&
-                               v4l2_pix_fmt_identical(&devices[index].src_fmt, &src_fmt)) {
+                               v4l2_pix_fmt_compat(&devices[index].src_fmt, &src_fmt)) {
                        v4l2_set_src_and_dest_format(index, &devices[index].src_fmt,
                                        dest_fmt);
                        result = 0;