Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/videorenderer.c | 76 ++++++++++++++++++++++ dlls/quartz/tests/vmr7.c | 101 ++++++++++++++++++++++++++++++ dlls/quartz/tests/vmr9.c | 98 +++++++++++++++++++++++++++++ 3 files changed, 275 insertions(+)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 4e26a18f83..f0c84c60e3 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -1071,6 +1071,81 @@ static void test_eos(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph) IMediaControl_Release(control); }
+static void test_current_image(IBaseFilter *filter, IMemInputPin *input, + IFilterGraph2 *graph, const BITMAPINFOHEADER *expect_bih) +{ + LONG buffer[(sizeof(BITMAPINFOHEADER) + 32 * 16 * 2) / 4]; + const BITMAPINFOHEADER *bih = (BITMAPINFOHEADER *)buffer; + IMediaControl *control; + OAFilterState state; + IBasicVideo *video; + unsigned int i; + HANDLE thread; + HRESULT hr; + LONG size; + + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + IBaseFilter_QueryInterface(filter, &IID_IBasicVideo, (void **)&video); + + hr = IBasicVideo_GetCurrentImage(video, NULL, NULL); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + hr = IBasicVideo_GetCurrentImage(video, NULL, buffer); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + size = 0xdeadbeef; + hr = IBasicVideo_GetCurrentImage(video, &size, NULL); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(size == sizeof(BITMAPINFOHEADER) + 32 * 16 * 2, "Got size %d.\n", size); + + size = 0xdeadbeef; + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + ok(hr == VFW_E_NOT_PAUSED, "Got hr %#x.\n", hr); + ok(size == 0xdeadbeef, "Got size %d.\n", size); + + hr = IMediaControl_Pause(control); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + size = 0xdeadbeef; + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + ok(hr == E_UNEXPECTED, "Got hr %#x.\n", hr); + ok(size == 0xdeadbeef, "Got size %d.\n", size); + + thread = send_frame(input); + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + size = sizeof(BITMAPINFOHEADER) + 32 * 16 * 2 - 1; + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + todo_wine ok(hr == E_OUTOFMEMORY, "Got hr %#x.\n", hr); + todo_wine ok(size == sizeof(BITMAPINFOHEADER) + 32 * 16 * 2 - 1, "Got size %d.\n", size); + + size = sizeof(BITMAPINFOHEADER) + 32 * 16 * 2; + memset(buffer, 0xcc, sizeof(buffer)); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(size == sizeof(BITMAPINFOHEADER) + 32 * 16 * 2, "Got size %d.\n", size); + ok(!memcmp(bih, expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + for (i = 0; i < 32 * 16 * 2; ++i) + { + const unsigned char *data = (unsigned char *)buffer + sizeof(BITMAPINFOHEADER); + ok(data[i] == 0x55, "Got unexpected byte %02x at %u.\n", data[i], i); + } + + hr = IMediaControl_Run(control); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + join_thread(thread); + + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + ok(hr == VFW_E_NOT_PAUSED, "Got hr %#x.\n", hr); + + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + IBasicVideo_Release(video); + IMediaControl_Release(control); +} + static void test_connect_pin(void) { VIDEOINFOHEADER vih = @@ -1178,6 +1253,7 @@ static void test_connect_pin(void) test_flushing(pin, input, graph); test_sample_time(pin, input, graph); test_eos(pin, input, graph); + test_current_image(filter, input, graph, &vih.bmiHeader);
hr = IFilterGraph2_Disconnect(graph, pin); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index bb793741e9..32b2ae7bef 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -1223,6 +1223,106 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph) IMediaControl_Release(control); }
+static void test_current_image(IBaseFilter *filter, IMemInputPin *input, + IFilterGraph2 *graph, const BITMAPINFOHEADER *req_bih) +{ + LONG buffer[(sizeof(BITMAPINFOHEADER) + 32 * 16 * 4) / 4]; + const BITMAPINFOHEADER *bih = (BITMAPINFOHEADER *)buffer; + const DWORD *data = (DWORD *)((char *)buffer + sizeof(BITMAPINFOHEADER)); + BITMAPINFOHEADER expect_bih = *req_bih; + IMemAllocator *allocator; + IMediaControl *control; + OAFilterState state; + IBasicVideo *video; + unsigned int i; + HANDLE thread; + HRESULT hr; + LONG size; + + /* Note that the bitmap returned by GetCurrentImage() has a bit depth of + * 32 regardless of the format used for pin connection. */ + expect_bih.biBitCount = 32; + expect_bih.biSizeImage = 32 * 16 * 4; + + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + IBaseFilter_QueryInterface(filter, &IID_IBasicVideo, (void **)&video); + + hr = IBasicVideo_GetCurrentImage(video, NULL, NULL); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + hr = IBasicVideo_GetCurrentImage(video, NULL, buffer); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + size = 0xdeadbeef; + hr = IBasicVideo_GetCurrentImage(video, &size, NULL); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(size == sizeof(BITMAPINFOHEADER) + 32 * 16 * 4, "Got size %d.\n", size); + + size = sizeof(buffer); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(size == sizeof(buffer), "Got size %d.\n", size); + todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + /* The contents seem to reflect the last frame rendered. */ + + hr = IMemInputPin_GetAllocator(input, &allocator); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IMemAllocator_Commit(allocator); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IMemAllocator_Release(allocator); + + hr = IMediaControl_Pause(control); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + size = sizeof(buffer); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(size == sizeof(buffer), "Got size %d.\n", size); + todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + /* The contents seem to reflect the last frame rendered. */ + + thread = send_frame(input); + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + size = 1; + memset(buffer, 0xcc, sizeof(buffer)); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(size == 1, "Got size %d.\n", size); + + size = sizeof(buffer); + memset(buffer, 0xcc, sizeof(buffer)); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(size == sizeof(buffer), "Got size %d.\n", size); + todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + for (i = 0; i < 32 * 16; ++i) + ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); + + hr = IMediaControl_Run(control); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + join_thread(thread); + + size = sizeof(buffer); + memset(buffer, 0xcc, sizeof(buffer)); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(size == sizeof(buffer), "Got size %d.\n", size); + if (hr == S_OK) + { + ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + for (i = 0; i < 32 * 16; ++i) + ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); + } + + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + IBasicVideo_Release(video); + IMediaControl_Release(control); +} + static void test_connect_pin(void) { VIDEOINFOHEADER vih = @@ -1361,6 +1461,7 @@ static void test_connect_pin(void)
test_filter_state(input, graph); test_flushing(pin, input, graph); + test_current_image(filter, input, graph, &vih.bmiHeader);
hr = IFilterGraph2_Disconnect(graph, pin); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index a800aaeb70..293cc6d959 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -1227,6 +1227,103 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph) IMediaControl_Release(control); }
+static void test_current_image(IBaseFilter *filter, IMemInputPin *input, + IFilterGraph2 *graph, const BITMAPINFOHEADER *req_bih) +{ + LONG buffer[(sizeof(BITMAPINFOHEADER) + 32 * 16 * 4) / 4]; + const BITMAPINFOHEADER *bih = (BITMAPINFOHEADER *)buffer; + const DWORD *data = (DWORD *)((char *)buffer + sizeof(BITMAPINFOHEADER)); + BITMAPINFOHEADER expect_bih = *req_bih; + IMemAllocator *allocator; + IMediaControl *control; + OAFilterState state; + IBasicVideo *video; + unsigned int i; + HANDLE thread; + HRESULT hr; + LONG size; + + expect_bih.biSizeImage = 32 * 16 * 4; + + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + IBaseFilter_QueryInterface(filter, &IID_IBasicVideo, (void **)&video); + + hr = IBasicVideo_GetCurrentImage(video, NULL, NULL); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + hr = IBasicVideo_GetCurrentImage(video, NULL, buffer); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + size = 0xdeadbeef; + hr = IBasicVideo_GetCurrentImage(video, &size, NULL); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(size == sizeof(BITMAPINFOHEADER) + 32 * 16 * 4, "Got size %d.\n", size); + + size = sizeof(buffer); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(size == sizeof(buffer), "Got size %d.\n", size); + todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + /* The contents seem to reflect the last frame rendered. */ + + hr = IMemInputPin_GetAllocator(input, &allocator); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IMemAllocator_Commit(allocator); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IMemAllocator_Release(allocator); + + hr = IMediaControl_Pause(control); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + size = sizeof(buffer); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(size == sizeof(buffer), "Got size %d.\n", size); + todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + /* The contents seem to reflect the last frame rendered. */ + + thread = send_frame(input); + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + size = 1; + memset(buffer, 0xcc, sizeof(buffer)); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(size == 1, "Got size %d.\n", size); + + size = sizeof(buffer); + memset(buffer, 0xcc, sizeof(buffer)); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(size == sizeof(buffer), "Got size %d.\n", size); + todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + for (i = 0; i < 32 * 16; ++i) + ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); + + hr = IMediaControl_Run(control); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + join_thread(thread); + + size = sizeof(buffer); + memset(buffer, 0xcc, sizeof(buffer)); + hr = IBasicVideo_GetCurrentImage(video, &size, buffer); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(size == sizeof(buffer), "Got size %d.\n", size); + if (hr == S_OK) + { + ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + for (i = 0; i < 32 * 16; ++i) + ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); + } + + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + IBasicVideo_Release(video); + IMediaControl_Release(control); +} + static void test_connect_pin(void) { VIDEOINFOHEADER vih = @@ -1364,6 +1461,7 @@ static void test_connect_pin(void)
test_filter_state(input, graph); test_flushing(pin, input, graph); + test_current_image(filter, input, graph, &vih.bmiHeader);
hr = IFilterGraph2_Disconnect(graph, pin); ok(hr == S_OK, "Got hr %#x.\n", hr);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr7.c | 25 +++++++----- dlls/quartz/tests/vmr9.c | 25 +++++++----- dlls/quartz/vmr9.c | 88 +++++++++++++++++++--------------------- 3 files changed, 70 insertions(+), 68 deletions(-)
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 32b2ae7bef..6d578e80cf 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -1260,9 +1260,9 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input,
size = sizeof(buffer); hr = IBasicVideo_GetCurrentImage(video, &size, buffer); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); - todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); /* The contents seem to reflect the last frame rendered. */
hr = IMemInputPin_GetAllocator(input, &allocator); @@ -1276,9 +1276,9 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input,
size = sizeof(buffer); hr = IBasicVideo_GetCurrentImage(video, &size, buffer); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); - todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); /* The contents seem to reflect the last frame rendered. */
thread = send_frame(input); @@ -1289,16 +1289,19 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input, memset(buffer, 0xcc, sizeof(buffer)); hr = IBasicVideo_GetCurrentImage(video, &size, buffer); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(size == 1, "Got size %d.\n", size); + ok(size == 1, "Got size %d.\n", size);
size = sizeof(buffer); memset(buffer, 0xcc, sizeof(buffer)); hr = IBasicVideo_GetCurrentImage(video, &size, buffer); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); - todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); - for (i = 0; i < 32 * 16; ++i) - ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); + ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + if (0) /* FIXME: Rendering is currently broken on Wine. */ + { + for (i = 0; i < 32 * 16; ++i) + ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); + }
hr = IMediaControl_Run(control); todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -1307,11 +1310,11 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input, size = sizeof(buffer); memset(buffer, 0xcc, sizeof(buffer)); hr = IBasicVideo_GetCurrentImage(video, &size, buffer); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); - if (hr == S_OK) + ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + if (0) /* FIXME: Rendering is currently broken on Wine. */ { - ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); for (i = 0; i < 32 * 16; ++i) ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); } diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 293cc6d959..2bb1166cba 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -1261,9 +1261,9 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input,
size = sizeof(buffer); hr = IBasicVideo_GetCurrentImage(video, &size, buffer); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); - todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); /* The contents seem to reflect the last frame rendered. */
hr = IMemInputPin_GetAllocator(input, &allocator); @@ -1277,9 +1277,9 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input,
size = sizeof(buffer); hr = IBasicVideo_GetCurrentImage(video, &size, buffer); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); - todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); /* The contents seem to reflect the last frame rendered. */
thread = send_frame(input); @@ -1290,16 +1290,19 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input, memset(buffer, 0xcc, sizeof(buffer)); hr = IBasicVideo_GetCurrentImage(video, &size, buffer); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(size == 1, "Got size %d.\n", size); + ok(size == 1, "Got size %d.\n", size);
size = sizeof(buffer); memset(buffer, 0xcc, sizeof(buffer)); hr = IBasicVideo_GetCurrentImage(video, &size, buffer); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); - todo_wine ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); - for (i = 0; i < 32 * 16; ++i) - ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); + ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + if (0) /* FIXME: Rendering is currently broken on Wine. */ + { + for (i = 0; i < 32 * 16; ++i) + ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); + }
hr = IMediaControl_Run(control); todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -1308,11 +1311,11 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input, size = sizeof(buffer); memset(buffer, 0xcc, sizeof(buffer)); hr = IBasicVideo_GetCurrentImage(video, &size, buffer); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); - if (hr == S_OK) + ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); + if (0) /* FIXME: Rendering is currently broken on Wine. */ { - ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); for (i = 0; i < 32 * 16; ++i) ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); } diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index bd92416e49..928e98f605 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -620,63 +620,59 @@ static HRESULT WINAPI VMR9_GetSourceRect(BaseControlVideo* This, RECT *pSourceRe return S_OK; }
-static HRESULT WINAPI VMR9_GetStaticImage(BaseControlVideo* This, LONG *pBufferSize, LONG *pDIBImage) -{ - struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); - AM_MEDIA_TYPE *amt = &pVMR9->renderer.sink.pin.mt; - BITMAPINFOHEADER *bmiHeader; - LONG needed_size; - char *ptr; +static HRESULT WINAPI VMR9_GetStaticImage(BaseControlVideo *iface, LONG *size, LONG *image) +{ + struct quartz_vmr *filter = impl_from_BaseControlVideo(iface); + const AM_MEDIA_TYPE *mt = &filter->renderer.sink.pin.mt; + IDirect3DSurface9 *rt = NULL, *surface = NULL; + D3DLOCKED_RECT locked_rect; + IDirect3DDevice9 *device; + BITMAPINFOHEADER bih; + HRESULT hr;
- FIXME("(%p/%p)->(%p, %p): partial stub\n", pVMR9, This, pBufferSize, pDIBImage); + TRACE("filter %p, size %d, image %p.\n", filter, *size, image);
- EnterCriticalSection(&pVMR9->renderer.filter.csFilter); + EnterCriticalSection(&filter->renderer.csRenderLock); + device = filter->allocator_d3d9_dev;
- if (!pVMR9->renderer.pMediaSample) - { - LeaveCriticalSection(&pVMR9->renderer.filter.csFilter); - return (pVMR9->renderer.filter.state == State_Paused ? E_UNEXPECTED : VFW_E_NOT_PAUSED); - } + if (IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo)) + bih = ((VIDEOINFOHEADER *)mt->pbFormat)->bmiHeader; + else if (IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo2)) + bih = ((VIDEOINFOHEADER2 *)mt->pbFormat)->bmiHeader; + bih.biSizeImage = bih.biWidth * bih.biHeight * bih.biBitCount / 8;
- if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo)) + if (!image) { - bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader; - } - else if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo2)) - { - bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader; - } - else - { - FIXME("Unknown type %s\n", debugstr_guid(&amt->subtype)); - LeaveCriticalSection(&pVMR9->renderer.filter.csFilter); - return VFW_E_RUNTIME_ERROR; + *size = sizeof(BITMAPINFOHEADER) + bih.biSizeImage; + LeaveCriticalSection(&filter->renderer.csRenderLock); + return S_OK; }
- needed_size = bmiHeader->biSize; - needed_size += IMediaSample_GetActualDataLength(pVMR9->renderer.pMediaSample); + if (FAILED(hr = IDirect3DDevice9_GetRenderTarget(device, 0, &rt))) + goto out;
- if (!pDIBImage) - { - *pBufferSize = needed_size; - LeaveCriticalSection(&pVMR9->renderer.filter.csFilter); - return S_OK; - } + if (FAILED(hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, bih.biWidth, + bih.biHeight, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, &surface, NULL))) + goto out;
- if (needed_size < *pBufferSize) - { - ERR("Buffer too small %u/%u\n", needed_size, *pBufferSize); - LeaveCriticalSection(&pVMR9->renderer.filter.csFilter); - return E_FAIL; - } - *pBufferSize = needed_size; + if (FAILED(hr = IDirect3DDevice9_GetRenderTargetData(device, rt, surface))) + goto out;
- memcpy(pDIBImage, bmiHeader, bmiHeader->biSize); - IMediaSample_GetPointer(pVMR9->renderer.pMediaSample, (BYTE **)&ptr); - memcpy((char *)pDIBImage + bmiHeader->biSize, ptr, IMediaSample_GetActualDataLength(pVMR9->renderer.pMediaSample)); + if (FAILED(hr = IDirect3DSurface9_LockRect(surface, &locked_rect, NULL, D3DLOCK_READONLY))) + goto out;
- LeaveCriticalSection(&pVMR9->renderer.filter.csFilter); - return S_OK; + memcpy(image, &bih, min(*size, sizeof(BITMAPINFOHEADER))); + if (*size > sizeof(BITMAPINFOHEADER)) + memcpy((char *)image + sizeof(BITMAPINFOHEADER), locked_rect.pBits, + min(*size - sizeof(BITMAPINFOHEADER), bih.biSizeImage)); + + IDirect3DSurface9_UnlockRect(surface); + +out: + if (surface) IDirect3DSurface9_Release(surface); + if (rt) IDirect3DSurface9_Release(rt); + LeaveCriticalSection(&filter->renderer.csRenderLock); + return hr; }
static HRESULT WINAPI VMR9_GetTargetRect(BaseControlVideo* This, RECT *pTargetRect)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64855
Your paranoid android.
=== wxppro (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w864 (64 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1507 (64 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1809 (64 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== wxppro (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w864 (64 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1507 (64 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1809 (64 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== debian10 (32 bit report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (32 bit WoW report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (64 bit WoW report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/videorenderer.c | 4 +- dlls/quartz/videorenderer.c | 70 ++++++++++++++----------------- 2 files changed, 33 insertions(+), 41 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index f0c84c60e3..dae4d7ed66 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -1117,8 +1117,8 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input,
size = sizeof(BITMAPINFOHEADER) + 32 * 16 * 2 - 1; hr = IBasicVideo_GetCurrentImage(video, &size, buffer); - todo_wine ok(hr == E_OUTOFMEMORY, "Got hr %#x.\n", hr); - todo_wine ok(size == sizeof(BITMAPINFOHEADER) + 32 * 16 * 2 - 1, "Got size %d.\n", size); + ok(hr == E_OUTOFMEMORY, "Got hr %#x.\n", hr); + ok(size == sizeof(BITMAPINFOHEADER) + 32 * 16 * 2 - 1, "Got size %d.\n", size);
size = sizeof(BITMAPINFOHEADER) + 32 * 16 * 2; memset(buffer, 0xcc, sizeof(buffer)); diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 9b671ff370..31110e7794 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -350,62 +350,54 @@ static HRESULT WINAPI VideoRenderer_GetSourceRect(BaseControlVideo* iface, RECT return S_OK; }
-static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo* iface, LONG *pBufferSize, LONG *pDIBImage) +static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG *size, LONG *image) { - VideoRendererImpl *This = impl_from_BaseControlVideo(iface); - AM_MEDIA_TYPE *amt = &This->renderer.sink.pin.mt; - BITMAPINFOHEADER *bmiHeader; - LONG needed_size; - char *ptr; + VideoRendererImpl *filter = impl_from_BaseControlVideo(iface); + const AM_MEDIA_TYPE *mt = &filter->renderer.sink.pin.mt; + const BITMAPINFOHEADER *bih; + size_t image_size; + BYTE *sample_data;
- FIXME("(%p/%p)->(%p, %p): partial stub\n", This, iface, pBufferSize, pDIBImage); + TRACE("filter %p, size %p, image %p.\n", filter, size, image);
- EnterCriticalSection(&This->renderer.filter.csFilter); + EnterCriticalSection(&filter->renderer.csRenderLock);
- if (!This->renderer.pMediaSample) - { - LeaveCriticalSection(&This->renderer.filter.csFilter); - return (This->renderer.filter.state == State_Paused ? E_UNEXPECTED : VFW_E_NOT_PAUSED); - } + if (IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo)) + bih = &((VIDEOINFOHEADER *)mt->pbFormat)->bmiHeader; + else if (IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo2)) + bih = &((VIDEOINFOHEADER2 *)mt->pbFormat)->bmiHeader; + image_size = bih->biWidth * bih->biHeight * bih->biBitCount / 8;
- if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo)) + if (!image) { - bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader; - } - else if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo2)) - { - bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader; + LeaveCriticalSection(&filter->renderer.csRenderLock); + *size = sizeof(BITMAPINFOHEADER) + image_size; + return S_OK; } - else + + if (filter->renderer.filter.state != State_Paused) { - FIXME("Unknown type %s\n", debugstr_guid(&amt->subtype)); - LeaveCriticalSection(&This->renderer.filter.csFilter); - return VFW_E_RUNTIME_ERROR; + LeaveCriticalSection(&filter->renderer.csRenderLock); + return VFW_E_NOT_PAUSED; }
- needed_size = bmiHeader->biSize; - needed_size += IMediaSample_GetActualDataLength(This->renderer.pMediaSample); - - if (!pDIBImage) + if (!filter->renderer.pMediaSample) { - *pBufferSize = needed_size; - LeaveCriticalSection(&This->renderer.filter.csFilter); - return S_OK; + LeaveCriticalSection(&filter->renderer.csRenderLock); + return E_UNEXPECTED; }
- if (needed_size < *pBufferSize) + if (*size < sizeof(BITMAPINFOHEADER) + image_size) { - ERR("Buffer too small %u/%u\n", needed_size, *pBufferSize); - LeaveCriticalSection(&This->renderer.filter.csFilter); - return E_FAIL; + LeaveCriticalSection(&filter->renderer.csRenderLock); + return E_OUTOFMEMORY; } - *pBufferSize = needed_size;
- memcpy(pDIBImage, bmiHeader, bmiHeader->biSize); - IMediaSample_GetPointer(This->renderer.pMediaSample, (BYTE **)&ptr); - memcpy((char *)pDIBImage + bmiHeader->biSize, ptr, IMediaSample_GetActualDataLength(This->renderer.pMediaSample)); + memcpy(image, bih, sizeof(BITMAPINFOHEADER)); + IMediaSample_GetPointer(filter->renderer.pMediaSample, &sample_data); + memcpy((char *)image + sizeof(BITMAPINFOHEADER), sample_data, image_size);
- LeaveCriticalSection(&This->renderer.filter.csFilter); + LeaveCriticalSection(&filter->renderer.csRenderLock); return S_OK; }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64856
Your paranoid android.
=== wxppro (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
quartz: videorenderer.c:911: Test failed: Thread should block in Receive().
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?) quartz:videorenderer has unaccounted for failure messages
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w864 (64 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1507 (64 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1809 (64 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== debian10 (32 bit report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (32 bit WoW report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (64 bit WoW report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
Only the video renderer uses it.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/videorenderer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 31110e7794..60776707c6 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -56,6 +56,7 @@ typedef struct VideoRendererImpl DWORD saved_style;
HANDLE run_event; + IMediaSample *current_sample; } VideoRendererImpl;
static inline VideoRendererImpl *impl_from_BaseWindow(BaseWindow *iface) @@ -177,9 +178,13 @@ static HRESULT WINAPI VideoRenderer_DoRenderSample(struct strmbase_renderer *ifa { const HANDLE events[2] = {filter->run_event, filter->renderer.flush_event};
+ filter->current_sample = pSample; + LeaveCriticalSection(&filter->renderer.csRenderLock); WaitForMultipleObjects(2, events, FALSE, INFINITE); EnterCriticalSection(&filter->renderer.csRenderLock); + + filter->current_sample = NULL; }
return S_OK; @@ -381,7 +386,7 @@ static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG return VFW_E_NOT_PAUSED; }
- if (!filter->renderer.pMediaSample) + if (!filter->current_sample) { LeaveCriticalSection(&filter->renderer.csRenderLock); return E_UNEXPECTED; @@ -394,7 +399,7 @@ static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG }
memcpy(image, bih, sizeof(BITMAPINFOHEADER)); - IMediaSample_GetPointer(filter->renderer.pMediaSample, &sample_data); + IMediaSample_GetPointer(filter->current_sample, &sample_data); memcpy((char *)image + sizeof(BITMAPINFOHEADER), sample_data, image_size);
LeaveCriticalSection(&filter->renderer.csRenderLock);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64857
Your paranoid android.
=== debian10 (32 bit report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (32 bit Chinese:China report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (32 bit WoW report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (64 bit WoW report) ===
Report validation errors: quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/renderer.c | 17 ----------------- include/wine/strmbase.h | 2 -- 2 files changed, 19 deletions(-)
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 8470da40f0..1f2154393d 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -84,7 +84,6 @@ static HRESULT renderer_init_stream(struct strmbase_filter *iface) if (filter->sink.pin.peer) ResetEvent(filter->state_event); filter->eos = FALSE; - BaseRendererImpl_ClearPendingSample(filter); ResetEvent(filter->flush_event); if (filter->pFuncsTable->renderer_init_stream) filter->pFuncsTable->renderer_init_stream(filter); @@ -228,7 +227,6 @@ static HRESULT sink_begin_flush(struct strmbase_sink *iface) { struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
- BaseRendererImpl_ClearPendingSample(filter); SetEvent(filter->flush_event);
return S_OK; @@ -279,7 +277,6 @@ void strmbase_renderer_cleanup(struct strmbase_renderer *filter) filter->csRenderLock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&filter->csRenderLock);
- BaseRendererImpl_ClearPendingSample(filter); CloseHandle(filter->state_event); CloseHandle(filter->advise_event); CloseHandle(filter->flush_event); @@ -313,9 +310,6 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa DeleteMediaType(pmt); }
- This->pMediaSample = pSample; - IMediaSample_AddRef(pSample); - if (This->pFuncsTable->pfnPrepareReceive) hr = This->pFuncsTable->pfnPrepareReceive(This, pSample); if (FAILED(hr)) @@ -388,22 +382,11 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa
QualityControlRender_DoQOS(This->qcimpl);
- BaseRendererImpl_ClearPendingSample(This); LeaveCriticalSection(&This->csRenderLock);
return hr; }
-HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *iface) -{ - if (iface->pMediaSample) - { - IMediaSample_Release(iface->pMediaSample); - iface->pMediaSample = NULL; - } - return S_OK; -} - HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer, const CLSID *clsid, const WCHAR *sink_name, const struct strmbase_renderer_ops *ops) { diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 57ff024708..5151e68644 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -483,7 +483,6 @@ struct strmbase_renderer /* Signaled when a flush or state change occurs, i.e. anything that needs * to immediately unblock the streaming thread. */ HANDLE flush_event; - IMediaSample *pMediaSample; REFERENCE_TIME stream_start;
IQualityControl *pQSink; @@ -522,7 +521,6 @@ struct strmbase_renderer_ops HRESULT (*renderer_pin_query_interface)(struct strmbase_renderer *iface, REFIID iid, void **out); };
-HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *filter); HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *filter, IMediaSample *sample);
HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64858
Your paranoid android.
=== debian10 (32 bit report) ===
Report validation errors: qcap:audiorecord has no test summary line (early exit of the main process?) qcap:avico has no test summary line (early exit of the main process?) qcap:avimux has no test summary line (early exit of the main process?) qcap:qcap has no test summary line (early exit of the main process?) qcap:smartteefilter has no test summary line (early exit of the main process?) qcap:videocapture has no test summary line (early exit of the main process?) quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (32 bit Chinese:China report) ===
Report validation errors: qcap:audiorecord has no test summary line (early exit of the main process?) qcap:avico has no test summary line (early exit of the main process?) qcap:avimux has no test summary line (early exit of the main process?) qcap:qcap has no test summary line (early exit of the main process?) qcap:smartteefilter has no test summary line (early exit of the main process?) qcap:videocapture has no test summary line (early exit of the main process?) quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (32 bit WoW report) ===
Report validation errors: qcap:audiorecord has no test summary line (early exit of the main process?) qcap:avico has no test summary line (early exit of the main process?) qcap:avimux has no test summary line (early exit of the main process?) qcap:qcap has no test summary line (early exit of the main process?) qcap:smartteefilter has no test summary line (early exit of the main process?) qcap:videocapture has no test summary line (early exit of the main process?) quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
=== debian10 (64 bit WoW report) ===
Report validation errors: qcap:audiorecord has no test summary line (early exit of the main process?) qcap:avico has no test summary line (early exit of the main process?) qcap:avimux has no test summary line (early exit of the main process?) qcap:qcap has no test summary line (early exit of the main process?) qcap:smartteefilter has no test summary line (early exit of the main process?) qcap:videocapture has no test summary line (early exit of the main process?) quartz:acmwrapper has no test summary line (early exit of the main process?) quartz:avidec has no test summary line (early exit of the main process?) quartz:avisplit has no test summary line (early exit of the main process?) quartz:dsoundrender has no test summary line (early exit of the main process?) quartz:filesource has no test summary line (early exit of the main process?) quartz:filtergraph has no test summary line (early exit of the main process?) quartz:filtermapper has no test summary line (early exit of the main process?) quartz:memallocator has no test summary line (early exit of the main process?) quartz:mpegsplit has no test summary line (early exit of the main process?) quartz:systemclock has no test summary line (early exit of the main process?) quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?) quartz:waveparser has no test summary line (early exit of the main process?)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64854
Your paranoid android.
=== wxppro (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w864 (64 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1507 (64 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== w1064v1809 (64 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?)
=== wxppro (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w864 (64 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1507 (64 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== w1064v1809 (64 bit report) ===
Report validation errors: quartz:vmr7 has no test summary line (early exit of the main process?)
=== wxppro (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w2008s64 (32 bit report) ===
=== w8 (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w2008s64 (64 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w864 (64 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1507 (64 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== w1064v1809 (64 bit report) ===
Report validation errors: quartz:vmr9 has no test summary line (early exit of the main process?)
=== debian10 (32 bit report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?)
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?)
=== debian10 (32 bit WoW report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?)
=== debian10 (64 bit WoW report) ===
Report validation errors: quartz:videorenderer has no test summary line (early exit of the main process?) quartz:vmr7 has no test summary line (early exit of the main process?) quartz:vmr9 has no test summary line (early exit of the main process?)