Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56698
I'm not hugely satisfied with some of those changes (especially how looping avi_decompressor_source_get_media_type now takes O(n^2) calls to ICDecompressQuery), but it gets the video in that issue working.
If you've got a better idea for how to implement this stuff, do tell.
-- v4: msvfw32/tests: Test that Cinepak rejects unsupported output types. iccvid: Reject unsupported output types. quartz/tests: Add Cinepak test to avi splitter. winegstreamer: Try DTS if PTS is absent. winegstreamer: Implement AM_MEDIA_TYPE to wg_format converter for Cinepak video.
From: Alfred Agrell floating@muncher.se
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56698 --- dlls/winegstreamer/quartz_parser.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 125e5c00c0f..69c618e213e 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -977,6 +977,30 @@ static bool amt_to_wg_format_video(const AM_MEDIA_TYPE *mt, struct wg_format *fo return false; }
+static bool amt_to_wg_format_video_cinepak(const AM_MEDIA_TYPE *mt, struct wg_format *format) +{ + const VIDEOINFOHEADER *video_format = (const VIDEOINFOHEADER *)mt->pbFormat; + + if (!IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo)) + { + FIXME("Unknown format type %s.\n", debugstr_guid(&mt->formattype)); + return false; + } + if (mt->cbFormat < sizeof(VIDEOINFOHEADER) || !mt->pbFormat) + { + ERR("Unexpected format size %lu.\n", mt->cbFormat); + return false; + } + + format->major_type = WG_MAJOR_TYPE_VIDEO_CINEPAK; + format->u.video.width = video_format->bmiHeader.biWidth; + format->u.video.height = video_format->bmiHeader.biHeight; + format->u.video.fps_n = 10000000; + format->u.video.fps_d = video_format->AvgTimePerFrame; + + return true; +} + static bool amt_to_wg_format_video_wmv(const AM_MEDIA_TYPE *mt, struct wg_format *format) { const VIDEOINFOHEADER *video_format = (const VIDEOINFOHEADER *)mt->pbFormat; @@ -1051,6 +1075,8 @@ bool amt_to_wg_format(const AM_MEDIA_TYPE *mt, struct wg_format *format)
if (IsEqualGUID(&mt->majortype, &MEDIATYPE_Video)) { + if (IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_CVID)) + return amt_to_wg_format_video_cinepak(mt, format); if (IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_WMV1) || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_WMV2) || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_WMVA)
From: Alfred Agrell floating@muncher.se
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56698 --- dlls/winegstreamer/wg_parser.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 431a8b74cb2..b6b2eeffcf4 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -369,6 +369,8 @@ static NTSTATUS wg_parser_stream_get_buffer(void *args)
if ((wg_buffer->has_pts = GST_BUFFER_PTS_IS_VALID(buffer))) wg_buffer->pts = GST_BUFFER_PTS(buffer) / 100; + else if ((wg_buffer->has_pts = GST_BUFFER_DTS_IS_VALID(buffer))) + wg_buffer->pts = GST_BUFFER_DTS(buffer) / 100; if ((wg_buffer->has_duration = GST_BUFFER_DURATION_IS_VALID(buffer))) wg_buffer->duration = GST_BUFFER_DURATION(buffer) / 100; wg_buffer->discontinuity = GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_DISCONT);
From: Alfred Agrell floating@muncher.se
--- dlls/quartz/tests/avisplit.c | 11 ++++++++--- dlls/quartz/tests/rsrc.rc | 4 ++++ dlls/quartz/tests/test_cinepak.avi | Bin 0 -> 6702 bytes 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 dlls/quartz/tests/test_cinepak.avi
diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index 25e313aa4b4..f7fadb606c4 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -1677,9 +1677,9 @@ static void test_seeking(void) ok(ret, "Failed to delete file, error %lu.\n", GetLastError()); }
-static void test_streaming(void) +static void test_streaming(const WCHAR *resname) { - const WCHAR *filename = load_resource(L"test.avi"); + const WCHAR *filename = load_resource(resname); IBaseFilter *filter = create_avi_splitter(); IFilterGraph2 *graph = connect_input(filter, filename); struct testfilter testsink; @@ -1691,6 +1691,8 @@ static void test_streaming(void) ULONG ref; DWORD ret;
+ winetest_push_context("File %ls", resname); + testfilter_init(&testsink); IFilterGraph2_AddFilter(graph, &testsink.filter.IBaseFilter_iface, L"sink"); IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); @@ -1761,6 +1763,8 @@ static void test_streaming(void) ok(!ref, "Got outstanding refcount %ld.\n", ref); ret = DeleteFileW(filename); ok(ret, "Failed to delete file, error %lu.\n", GetLastError()); + + winetest_pop_context(); }
START_TEST(avisplit) @@ -1787,7 +1791,8 @@ START_TEST(avisplit) test_unconnected_filter_state(); test_connect_pin(); test_seeking(); - test_streaming(); + test_streaming(L"test.avi"); + test_streaming(L"test_cinepak.avi");
CoUninitialize(); } diff --git a/dlls/quartz/tests/rsrc.rc b/dlls/quartz/tests/rsrc.rc index a16edacf1d1..a15520d21ac 100644 --- a/dlls/quartz/tests/rsrc.rc +++ b/dlls/quartz/tests/rsrc.rc @@ -39,3 +39,7 @@ test.wav RCDATA "test.wav" /* ffmpeg -f lavfi -i smptebars -f lavfi -i "sine=frequency=1000" -t 2.04 -r 25 -f mpeg -vcodec mpeg1video -vf scale=64x48 -acodec mp2 -ar 32k -ab 96k test2.mpg */ /* @makedep: test2.mpg */ test2.mpg RCDATA "test2.mpg" + +/* ffmpeg -f lavfi -i smptebars -t 5 -r 1 -f avi -vcodec cinepak -pix_fmt rgb24 -vf scale=32x24 test_cinepak.avi */ +/* @makedep: test_cinepak.avi */ +test_cinepak.avi RCDATA "test_cinepak.avi" diff --git a/dlls/quartz/tests/test_cinepak.avi b/dlls/quartz/tests/test_cinepak.avi new file mode 100644 index 0000000000000000000000000000000000000000..006ee289b37ff396103fae36050b8ba6bf8ce5be GIT binary patch literal 6702 zcmeHMO-vI(6n@(-rG+kR3qt9(vTgZoD703j{3PHHjg<<>Pc;z}357tyU%)iR7*Y!f zfqFK?iw6)i#ux}EB1BFKoIDyYCYl(355xmOWPQ`6hV<yk$b9Y0y!Ynqo0%^=yPG#H zKCidH2yi;!6aBu{Hjf^lH#pMY8S3lx06^WDba>Q>0)p27B*`K$vIRtJ4F|Tv4T<%R z2N=CE(vKw;E7TVp?ZWD?ABiK!l4C~|01_hZBVu&CzNZKcq=;C^cnsFDSU9IdTxf4> zFyPqiL5I^B>`L^ZI%R+|KpCJ6PzERilmW^BWq>k38K4YM1}FpnHv^&Jk>PWPmPqms zA{LTYP-4~~E)zSk#dXpqg5(-lbQ}r}^y9yGC(+>u=_KcasU+|<dYgQ$-nKN9{hgtn z^2*W^6{Rkx69`*7$|FPxT`FaOGVq51@`SjK`+s04)JL+iB-;z1h~gvG01OX`J26)S zh$1i(7K_bh=dMh(jAy(qzG}ag{h4Wi^AhuXd1Xl<Jw!a^GwY0goo-=aX670H<r_&H zPfbrviz@|%g3z?xj;J}6oT|dKbw6TrV|jk=-Yd=H=>3Ve-zyOB>-Q0oWK84KS$irK zF#GJ{?BeW84X4e}@BSJX92nf#`0+rRS1DhtFD|i?r^HjT>r#`6N`r&l-CJ9ek;zE< znqU%4E!z{5k#S+oU+b^cRxd9v;XFMaxBJ7{6tx1R{Yr<s<frp;{l(Lc;*Q3Srd)Gb znagGVNP>mK(Yuj|WmT3ZC&q8{>$1$^VA4L3C8@2oGvGPNaYVD^nXN_KEz_t`^NHx; zurw#lk+%_%1);F8X<L>X>Y6LH9$9V=1OnCW`RIJ~&DYhn)inkzdTWM|EcYI+tpMIt z1QW}~hr@E83t^1SnCS9If^g|zB-tX`L|d^IRQLlYz>~4DF$pr0GLxz_RT>j#;<ECy z@>6qDbNL)TNA)*7)zt<=W>Q*ml_tH&#My<cd;tSiR`59%o7r4mF7*PWq!bkBk15ou zQgwEo)(KXorsTNGYRphNw5(WGrc~$@I-OhR*3>v^9Bc{;<es$S5|BbW#O_I*{Q4&! z0-}gV3djlT0??9m68xK2^aXFanh$1&2O&UCLdaf=pM=byOx79KHxu-|1icjZEb;#h DyVUok
literal 0 HcmV?d00001
From: Alfred Agrell floating@muncher.se
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56698 --- dlls/iccvid/iccvid.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/dlls/iccvid/iccvid.c b/dlls/iccvid/iccvid.c index a1cfdc1ee21..56a882af659 100644 --- a/dlls/iccvid/iccvid.c +++ b/dlls/iccvid/iccvid.c @@ -797,26 +797,21 @@ static LRESULT ICCVID_DecompressQuery( ICCVID_Info *info, LPBITMAPINFO in, LPBIT if( in->bmiHeader.biWidth != out->bmiHeader.biWidth ) return ICERR_BADFORMAT;
- switch( out->bmiHeader.biBitCount ) + switch( out->bmiHeader.biCompression ) { - case 16: - if ( out->bmiHeader.biCompression == BI_BITFIELDS ) - { - if ( !ICCVID_CheckMask(out->bmiColors, 0x7C00, 0x03E0, 0x001F) && - !ICCVID_CheckMask(out->bmiColors, 0xF800, 0x07E0, 0x001F) ) - { - TRACE("unsupported output bit field(s) for 16-bit colors\n"); - return ICERR_BADFORMAT; - } - } + case BI_RGB: + if ( out->bmiHeader.biBitCount == 16 || out->bmiHeader.biBitCount == 24 || out->bmiHeader.biBitCount == 32 ) + return ICERR_OK; break; - case 24: - case 32: + case BI_BITFIELDS: + if ( out->bmiHeader.biBitCount == 16 && ICCVID_CheckMask(out->bmiColors, 0x7C00, 0x03E0, 0x001F) ) + return ICERR_OK; + if ( out->bmiHeader.biBitCount == 16 && ICCVID_CheckMask(out->bmiColors, 0xF800, 0x07E0, 0x001F) ) + return ICERR_OK; break; - default: - TRACE("unsupported output bitcount = %d\n", out->bmiHeader.biBitCount ); - return ICERR_BADFORMAT; } + TRACE("unsupported output format\n"); + return ICERR_BADFORMAT; }
return ICERR_OK;
From: Alfred Agrell floating@muncher.se
--- dlls/msvfw32/tests/msvfw.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/msvfw32/tests/msvfw.c b/dlls/msvfw32/tests/msvfw.c index b22b466f595..2a7d376917e 100644 --- a/dlls/msvfw32/tests/msvfw.c +++ b/dlls/msvfw32/tests/msvfw.c @@ -190,6 +190,13 @@ static void test_Locate(void) if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n"); bo.biHeight = - bo.biHeight;
+ bo.biCompression = mmioFOURCC('U','Y','V','Y'); + bo.biBitCount = bi.biBitCount = 16; + h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS); + ok(h == 0, "cvid->UYVY succeeded\n"); + if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n"); + bo.biCompression = BI_RGB; + bo.biBitCount = bi.biBitCount = 32; h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS); ok(h != 0, "cvid->RGB32 failed\n");
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=145879
Your paranoid android.
=== w864 (32 bit report) ===
quartz: systemclock.c:223: Test failed: Event should be signaled. systemclock.c:226: Test failed: Got hr 0.