From: Akihiro Sagawa sagawa.aki@gmail.com
GStreamer caps don't provide the scan direction of AVI files, and some downstream filters don't handle top-down correctly. --- dlls/quartz/tests/avisplit.c | 16 ++++------------ dlls/winegstreamer/quartz_parser.c | 4 ++++ 2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index c6e5687f8e2..cb756a07c5d 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -1810,16 +1810,12 @@ static void test_32bpp_media_types(void) wine_dbgstr_guid(&pmt->formattype)); ok(!pmt->pUnk, "Got pUnk %p.\n", pmt->pUnk); ok(pmt->cbFormat == sizeof(VIDEOINFOHEADER), "Got format size %lu.\n", pmt->cbFormat); - todo_wine ok(!memcmp(pmt->pbFormat, &expect_vih, sizeof(VIDEOINFOHEADER)), "Format blocks didn't match.\n"); - - vih = (VIDEOINFOHEADER *)pmt->pbFormat; - ok(vih->bmiHeader.biSize == expect_vih.bmiHeader.biSize, "Got biSize %lu.\n", vih->bmiHeader.biSize); - ok(vih->bmiHeader.biWidth == expect_vih.bmiHeader.biWidth, "Got biWidth %ld.\n", vih->bmiHeader.biWidth); - todo_wine ok(vih->bmiHeader.biHeight == expect_vih.bmiHeader.biHeight, "Got biHeight %ld.\n", vih->bmiHeader.biHeight); + ok(!memcmp(pmt->pbFormat, &expect_vih, sizeof(VIDEOINFOHEADER)), "Format blocks didn't match.\n");
hr = IPin_QueryAccept(pin, pmt); ok(hr == S_OK, "Got hr %#lx.\n", hr);
+ vih = (VIDEOINFOHEADER *)pmt->pbFormat; vih->bmiHeader.biHeight = -vih->bmiHeader.biHeight; hr = IPin_QueryAccept(pin, pmt); ok(hr == S_FALSE, "Got hr %#lx.\n", hr); @@ -1843,16 +1839,12 @@ static void test_32bpp_media_types(void) wine_dbgstr_guid(&pmt->formattype)); ok(!pmt->pUnk, "Got pUnk %p.\n", pmt->pUnk); ok(pmt->cbFormat == sizeof(VIDEOINFOHEADER), "Got format size %lu.\n", pmt->cbFormat); - todo_wine ok(!memcmp(pmt->pbFormat, &expect_vih, sizeof(VIDEOINFOHEADER)), "Format blocks didn't match.\n"); - - vih = (VIDEOINFOHEADER *)pmt->pbFormat; - ok(vih->bmiHeader.biSize == expect_vih.bmiHeader.biSize, "Got biSize %lu.\n", vih->bmiHeader.biSize); - ok(vih->bmiHeader.biWidth == expect_vih.bmiHeader.biWidth, "Got biWidth %ld.\n", vih->bmiHeader.biWidth); - todo_wine ok(vih->bmiHeader.biHeight == expect_vih.bmiHeader.biHeight, "Got biHeight %ld.\n", vih->bmiHeader.biHeight); + ok(!memcmp(pmt->pbFormat, &expect_vih, sizeof(VIDEOINFOHEADER)), "Format blocks didn't match.\n");
hr = IPin_QueryAccept(pin, pmt); ok(hr == S_OK, "Got hr %#lx.\n", hr);
+ vih = (VIDEOINFOHEADER *)pmt->pbFormat; vih->bmiHeader.biHeight = -vih->bmiHeader.biHeight; hr = IPin_QueryAccept(pin, pmt); ok(hr == S_FALSE, "Got hr %#lx.\n", hr); diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index d8462770bb5..6ba0b2128f2 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -2432,6 +2432,8 @@ static HRESULT avi_splitter_source_query_accept(struct parser_source *pin, const HRESULT hr;
wg_parser_stream_get_current_format(pin->wg_stream, &format); + if (wg_video_format_is_rgb(format.u.video.format)) + format.u.video.height = -format.u.video.height; if (!amt_from_wg_format(&pad_mt, &format, false)) return E_OUTOFMEMORY; hr = compare_media_types(mt, &pad_mt) ? S_OK : S_FALSE; @@ -2471,6 +2473,8 @@ static HRESULT avi_splitter_source_get_media_type(struct parser_source *pin, else if (index > 0) return VFW_S_NO_MORE_ITEMS;
+ if (wg_video_format_is_rgb(format.u.video.format)) + format.u.video.height = -format.u.video.height; if (!amt_from_wg_format(mt, &format, false)) return E_OUTOFMEMORY; return S_OK;