matroska: add support for GRAY8, BGR and RGB video colourspaces in V_UNCOMPRESSED codec

https://bugzilla.gnome.org/show_bug.cgi?id=723849
This commit is contained in:
divhaere 2014-02-07 14:00:15 +01:00 committed by Sebastian Dröge
parent cf31a4284b
commit 19a307930a
2 changed files with 17 additions and 2 deletions

View 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));

View 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")