matroska: Add new pixels format support

- Add support for GRAY10_BE32
- Add support for RGBA64_LE and BGRA64_LE

Sponsored by Living Optics

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4824>
This commit is contained in:
Daniel Morin 2023-02-28 15:45:30 -05:00 committed by GStreamer Marge Bot
parent 32fbad8d39
commit 00178cbd89
2 changed files with 17 additions and 1 deletions

View file

@ -6501,12 +6501,21 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext *
case GST_MAKE_FOURCC ('Y', '8', ' ', ' '): case GST_MAKE_FOURCC ('Y', '8', ' ', ' '):
format = GST_VIDEO_FORMAT_GRAY8; format = GST_VIDEO_FORMAT_GRAY8;
break; break;
case GST_MAKE_FOURCC ('Y', '1', 0, 10):
format = GST_VIDEO_FORMAT_GRAY10_LE32;
break;
case GST_MAKE_FOURCC ('R', 'G', 'B', 24): case GST_MAKE_FOURCC ('R', 'G', 'B', 24):
format = GST_VIDEO_FORMAT_RGB; format = GST_VIDEO_FORMAT_RGB;
break; break;
case GST_MAKE_FOURCC ('B', 'G', 'R', 24): case GST_MAKE_FOURCC ('B', 'G', 'R', 24):
format = GST_VIDEO_FORMAT_BGR; format = GST_VIDEO_FORMAT_BGR;
break; break;
case GST_MAKE_FOURCC ('R', 'B', 'A', 64):
format = GST_VIDEO_FORMAT_RGBA64_LE;
break;
case GST_MAKE_FOURCC ('B', 'R', 'A', 64):
format = GST_VIDEO_FORMAT_BGRA64_LE;
break;
default: default:
GST_DEBUG ("Unknown fourcc %" GST_FOURCC_FORMAT, GST_DEBUG ("Unknown fourcc %" GST_FOURCC_FORMAT,
GST_FOURCC_ARGS (videocontext->fourcc)); GST_FOURCC_ARGS (videocontext->fourcc));

View file

@ -141,7 +141,8 @@ static GstStaticPadTemplate videosink_templ =
"video/x-vp9, " "video/x-vp9, "
COMMON_VIDEO_CAPS "; " COMMON_VIDEO_CAPS "; "
"video/x-raw, " "video/x-raw, "
"format = (string) { YUY2, I420, YV12, UYVY, AYUV, GRAY8, BGR, RGB }, " "format = (string) { YUY2, I420, YV12, UYVY, AYUV, GRAY8, GRAY10_LE32,"
" BGR, RGB, RGBA64_LE, BGRA64_LE }, "
COMMON_VIDEO_CAPS "; " COMMON_VIDEO_CAPS "; "
"video/x-prores, " "video/x-prores, "
COMMON_VIDEO_CAPS "; " COMMON_VIDEO_CAPS "; "
@ -1256,10 +1257,16 @@ skip_details:
videocontext->fourcc = GST_STR_FOURCC (fstr); videocontext->fourcc = GST_STR_FOURCC (fstr);
else if (!strcmp (fstr, "GRAY8")) else if (!strcmp (fstr, "GRAY8"))
videocontext->fourcc = GST_MAKE_FOURCC ('Y', '8', '0', '0'); videocontext->fourcc = GST_MAKE_FOURCC ('Y', '8', '0', '0');
else if (!strcmp (fstr, "GRAY10_LE32"))
videocontext->fourcc = GST_MAKE_FOURCC ('Y', '1', 0, 10);
else if (!strcmp (fstr, "BGR")) else if (!strcmp (fstr, "BGR"))
videocontext->fourcc = GST_MAKE_FOURCC ('B', 'G', 'R', 24); videocontext->fourcc = GST_MAKE_FOURCC ('B', 'G', 'R', 24);
else if (!strcmp (fstr, "RGB")) else if (!strcmp (fstr, "RGB"))
videocontext->fourcc = GST_MAKE_FOURCC ('R', 'G', 'B', 24); videocontext->fourcc = GST_MAKE_FOURCC ('R', 'G', 'B', 24);
else if (!strcmp (fstr, "RGBA64_LE"))
videocontext->fourcc = GST_MAKE_FOURCC ('R', 'B', 'A', 64);
else if (!strcmp (fstr, "BGRA64_LE"))
videocontext->fourcc = GST_MAKE_FOURCC ('B', 'R', 'A', 64);
} }
} else if (!strcmp (mimetype, "video/x-huffyuv") /* MS/VfW compatibility cases */ } else if (!strcmp (mimetype, "video/x-huffyuv") /* MS/VfW compatibility cases */
||!strcmp (mimetype, "video/x-divx") ||!strcmp (mimetype, "video/x-divx")