matroska: add support for GRAY8, BGR and RGB video colourspaces in V_UNCOMPRESSED...
authordivhaere <dirk.vanhaerenborgh@ugent.be>
Fri, 7 Feb 2014 13:00:15 +0000 (14:00 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 11 Feb 2014 20:22:33 +0000 (21:22 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=723849

gst/matroska/matroska-demux.c
gst/matroska/matroska-mux.c

index 010a221..aaa60a9 100644 (file)
@@ -4900,7 +4900,16 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext *
       case GST_MAKE_FOURCC ('A', 'Y', 'U', 'V'):
         format = GST_VIDEO_FORMAT_AYUV;
         break;
-
+      case GST_MAKE_FOURCC ('Y', '8', '0', '0'):
+      case GST_MAKE_FOURCC ('Y', '8', ' ', ' '):
+        format = GST_VIDEO_FORMAT_GRAY8;
+        break;
+      case GST_MAKE_FOURCC ('R', 'G', 'B', 24):
+        format = GST_VIDEO_FORMAT_RGB;
+        break;
+      case GST_MAKE_FOURCC ('B', 'G', 'R', 24):
+        format = GST_VIDEO_FORMAT_BGR;
+        break;
       default:
         GST_DEBUG ("Unknown fourcc %" GST_FOURCC_FORMAT,
             GST_FOURCC_ARGS (videocontext->fourcc));
index 3763cfe..d0958d1 100644 (file)
@@ -126,7 +126,7 @@ static GstStaticPadTemplate videosink_templ =
         "video/x-vp8, "
         COMMON_VIDEO_CAPS "; "
         "video/x-raw, "
-        "format = (string) { YUY2, I420, YV12, UYVY, AYUV }, "
+        "format = (string) { YUY2, I420, YV12, UYVY, AYUV, GRAY8, BGR, RGB }, "
         COMMON_VIDEO_CAPS "; "
         "video/x-wmv, " "wmvversion = (int) [ 1, 3 ], " COMMON_VIDEO_CAPS)
     );
@@ -1021,6 +1021,12 @@ skip_details:
     fstr = gst_structure_get_string (structure, "format");
     if (fstr && strlen (fstr) == 4)
       videocontext->fourcc = GST_STR_FOURCC (fstr);
+    else if (!strcmp (fstr, "GRAY8"))
+      videocontext->fourcc = GST_MAKE_FOURCC ('Y', '8', '0', '0');
+    else if (!strcmp (fstr, "BGR"))
+      videocontext->fourcc = GST_MAKE_FOURCC ('B', 'G', 'R', 24);
+    else if (!strcmp (fstr, "RGB"))
+      videocontext->fourcc = GST_MAKE_FOURCC ('R', 'G', 'B', 24);
   } else if (!strcmp (mimetype, "video/x-huffyuv")      /* MS/VfW compatibility cases */
       ||!strcmp (mimetype, "video/x-divx")
       || !strcmp (mimetype, "video/x-dv")