v4l2: Add PJPG mapping
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Tue, 15 Feb 2011 18:59:32 +0000 (15:59 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Tue, 15 Feb 2011 19:14:25 +0000 (16:14 -0300)
Adds mapping of progressive jpeg format

sys/v4l2/gstv4l2object.c

index 5c9022c..6cf9036 100644 (file)
@@ -774,6 +774,7 @@ static const GstV4L2FormatDesc gst_v4l2_formats[] = {
   /* compressed formats */
   {V4L2_PIX_FMT_MJPEG, TRUE},
   {V4L2_PIX_FMT_JPEG, TRUE},
+  {V4L2_PIX_FMT_PJPG, TRUE},
   {V4L2_PIX_FMT_DV, TRUE},
   {V4L2_PIX_FMT_MPEG, FALSE},
 
@@ -813,10 +814,13 @@ gst_v4l2_object_get_format_from_fourcc (GstV4l2Object * v4l2object,
     if (fmt->pixelformat == fourcc)
       return fmt;
     /* special case for jpeg */
-    if ((fmt->pixelformat == V4L2_PIX_FMT_MJPEG && fourcc == V4L2_PIX_FMT_JPEG)
-        || (fmt->pixelformat == V4L2_PIX_FMT_JPEG
-            && fourcc == V4L2_PIX_FMT_MJPEG)) {
-      return fmt;
+    if (fmt->pixelformat == V4L2_PIX_FMT_MJPEG ||
+        fmt->pixelformat == V4L2_PIX_FMT_JPEG ||
+        fmt->pixelformat == V4L2_PIX_FMT_PJPG) {
+      if (fourcc == V4L2_PIX_FMT_JPEG
+          || fourcc == V4L2_PIX_FMT_MJPEG || fourcc == V4L2_PIX_FMT_PJPG) {
+        return fmt;
+      }
     }
     walk = g_slist_next (walk);
   }
@@ -854,6 +858,7 @@ gst_v4l2_object_format_get_rank (const struct v4l2_fmtdesc *fmt)
 
   switch (fourcc) {
     case V4L2_PIX_FMT_MJPEG:
+    case V4L2_PIX_FMT_PJPG:
       rank = JPEG_BASE_RANK;
       break;
     case V4L2_PIX_FMT_JPEG:
@@ -1072,6 +1077,7 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
 
   switch (fourcc) {
     case V4L2_PIX_FMT_MJPEG:   /* Motion-JPEG */
+    case V4L2_PIX_FMT_PJPG:    /* Progressive-JPEG */
     case V4L2_PIX_FMT_JPEG:    /* JFIF JPEG */
       structure = gst_structure_new ("image/jpeg", NULL);
       break;