Zebediah Figura : winegstreamer: Use the "format" field to determine the subtype and bit depth.
Alexandre Julliard
julliard at winehq.org
Mon Sep 16 16:33:43 CDT 2019
Module: wine
Branch: master
Commit: 450d443b89d963774b9d662ce520210d7fa3738d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=450d443b89d963774b9d662ce520210d7fa3738d
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Sat Sep 14 12:43:27 2019 -0500
winegstreamer: Use the "format" field to determine the subtype and bit depth.
The "bits" field does not directly describe the total bit depth.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winegstreamer/gstdemux.c | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index e76ceda0fe..c733b6e7e6 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -207,16 +207,35 @@ static gboolean amt_from_gst_caps_video(GstCaps *caps, AM_MEDIA_TYPE *amt)
amt->pUnk = NULL;
ZeroMemory(vih, sizeof(*vih));
amt->majortype = MEDIATYPE_Video;
- if (GST_VIDEO_INFO_IS_RGB(&vinfo)) {
- bih->biBitCount = GST_VIDEO_FORMAT_INFO_BITS(vinfo.finfo);
- switch (bih->biBitCount) {
- case 16: amt->subtype = MEDIASUBTYPE_RGB555; break;
- case 24: amt->subtype = MEDIASUBTYPE_RGB24; break;
- case 32: amt->subtype = MEDIASUBTYPE_RGB32; break;
- default:
- FIXME("Unknown bpp %u\n", bih->biBitCount);
- heap_free(vih);
- return FALSE;
+
+ if (GST_VIDEO_INFO_IS_RGB(&vinfo))
+ {
+ switch (vinfo.finfo->format)
+ {
+ case GST_VIDEO_FORMAT_BGRA:
+ amt->subtype = MEDIASUBTYPE_ARGB32;
+ bih->biBitCount = 32;
+ break;
+ case GST_VIDEO_FORMAT_BGRx:
+ amt->subtype = MEDIASUBTYPE_RGB32;
+ bih->biBitCount = 32;
+ break;
+ case GST_VIDEO_FORMAT_BGR:
+ amt->subtype = MEDIASUBTYPE_RGB24;
+ bih->biBitCount = 24;
+ break;
+ case GST_VIDEO_FORMAT_BGR16:
+ amt->subtype = MEDIASUBTYPE_RGB565;
+ bih->biBitCount = 16;
+ break;
+ case GST_VIDEO_FORMAT_BGR15:
+ amt->subtype = MEDIASUBTYPE_RGB555;
+ bih->biBitCount = 16;
+ break;
+ default:
+ FIXME("Unhandled type %s.\n", vinfo.finfo->name);
+ heap_free(vih);
+ return FALSE;
}
bih->biCompression = BI_RGB;
} else {
More information about the wine-cvs
mailing list