From 19a307930a9e44b5453501ec3ae8b6890ed489c0 Mon Sep 17 00:00:00 2001 From: divhaere Date: Fri, 7 Feb 2014 14:00:15 +0100 Subject: [PATCH] matroska: add support for GRAY8, BGR and RGB video colourspaces in V_UNCOMPRESSED codec https://bugzilla.gnome.org/show_bug.cgi?id=723849 --- gst/matroska/matroska-demux.c | 11 ++++++++++- gst/matroska/matroska-mux.c | 8 +++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 010a2216c5..aaa60a94dc 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -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)); diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index 3763cfec19..d0958d1d73 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -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")