From: Akihiro Sagawa sagawa.aki@gmail.com
--- dlls/quartz/tests/avisplit.c | 4 ++-- dlls/winegstreamer/quartz_parser.c | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index c47c6f3f99a..c6e5687f8e2 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -1802,7 +1802,7 @@ static void test_32bpp_media_types(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(IsEqualGUID(&pmt->majortype, &MEDIATYPE_Video), "Got major type %s\n", wine_dbgstr_guid(&pmt->majortype)); - todo_wine ok(IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_ARGB32), "Got subtype %s\n", + ok(IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_ARGB32), "Got subtype %s\n", wine_dbgstr_guid(&pmt->subtype)); ok(!pmt->bFixedSizeSamples, "Got fixed size %d.\n", pmt->bFixedSizeSamples); ok(pmt->lSampleSize == 1, "Got sample size %lu.\n", pmt->lSampleSize); @@ -1828,7 +1828,7 @@ static void test_32bpp_media_types(void)
/* 2: RGB32 */ hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(hr == S_OK, "Got hr %#lx.\n", hr); if (hr == S_FALSE) goto done;
ok(hr == S_OK, "Got hr %#lx.\n", hr); diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index abfe4763697..d8462770bb5 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -2436,6 +2436,19 @@ static HRESULT avi_splitter_source_query_accept(struct parser_source *pin, const return E_OUTOFMEMORY; hr = compare_media_types(mt, &pad_mt) ? S_OK : S_FALSE; FreeMediaType(&pad_mt); + + /* For 32 bpp AVI files, also accept ARGB32 format. */ + if (hr == S_FALSE + && format.major_type == WG_MAJOR_TYPE_VIDEO + && format.u.video.format == WG_VIDEO_FORMAT_BGRx) + { + format.u.video.format = WG_VIDEO_FORMAT_BGRA; + if (!amt_from_wg_format(&pad_mt, &format, false)) + return E_OUTOFMEMORY; + hr = compare_media_types(mt, &pad_mt) ? S_OK : S_FALSE; + FreeMediaType(&pad_mt); + } + return hr; }
@@ -2444,9 +2457,20 @@ static HRESULT avi_splitter_source_get_media_type(struct parser_source *pin, { struct wg_format format;
- if (index > 0) + if (index > 1) return VFW_S_NO_MORE_ITEMS; + wg_parser_stream_get_current_format(pin->wg_stream, &format); + if (format.major_type == WG_MAJOR_TYPE_VIDEO + && format.u.video.format == WG_VIDEO_FORMAT_BGRx) + { + /* Offer ARGB32 format as the first candidate for 32 bpp AVI files. */ + if (index == 0) + format.u.video.format = WG_VIDEO_FORMAT_BGRA; + } + else if (index > 0) + return VFW_S_NO_MORE_ITEMS; + if (!amt_from_wg_format(mt, &format, false)) return E_OUTOFMEMORY; return S_OK;