[PATCH 3/4] winegstreamer: Use the "format" field to determine the subtype and bit depth.
Zebediah Figura
z.figura12 at gmail.com
Sat Sep 14 09:30:54 CDT 2019
On 9/14/19 4:51 AM, Jan Schmidt wrote:
>
> On 14/9/19 7:37 am, Zebediah Figura wrote:
>> The "bits" field does not directly describe the total bit depth.
>>
>> Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
>> ---
>> dlls/winegstreamer/gstdemux.c | 27 +++++++++++++++++----------
>> 1 file changed, 17 insertions(+), 10 deletions(-)
>>
>> diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
>> index e76ceda0fe6..b92bdfd7e49 100644
>> --- a/dlls/winegstreamer/gstdemux.c
>> +++ b/dlls/winegstreamer/gstdemux.c
>> @@ -207,16 +207,23 @@ 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_BGRx:
>> + amt->subtype = MEDIASUBTYPE_RGB32;
>> + bih->biBitCount = 32;
>> + break;
>> + case GST_VIDEO_FORMAT_BGR:
>> + amt->subtype = MEDIASUBTYPE_RGB24;
>> + bih->biBitCount = 24;
>> + break;
>> + default:
>> + FIXME("Unhandled type %u.\n", vinfo.finfo->format);
>> + heap_free(vih);
>> + return FALSE;
>
> This seems generally correct - a 32-bit format could be RGB32, or
> *MEDIASUBTYPE_ARGB32.*
That, and the "bits" field reports 8 for both ;-)
>
> *You seem to have dropped the 16-bit format handling though? Not so
> common any more, but used to be more popular in older games and things.*
>
Thanks for calling that to my attention. I originally assumed it wasn't
supported, because libgstriff doesn't handle it and I managed to
overlook it in the GstVideoFormat enum, but in fact it's
GST_VIDEO_FORMAT_BGR15. I'll send a v2 restoring that.
More information about the wine-devel
mailing list