Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/mfplat/buffer.c | 22 +++++++++++++++++++--- dlls/mfplat/tests/mfplat.c | 9 ++------- 2 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index eada3df18ad..39407ccc9e2 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -1351,8 +1351,25 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo if (is_yuv && bottom_up) return MF_E_INVALIDMEDIATYPE;
- if (FAILED(hr = MFGetPlaneSize(fourcc, width, height, &plane_size))) - return hr; + switch (fourcc) + { + case MAKEFOURCC('I','M','C','1'): + case MAKEFOURCC('I','M','C','3'): + plane_size = stride * height * 2; + break; + case MAKEFOURCC('I','M','C','2'): + case MAKEFOURCC('I','M','C','4'): + plane_size = stride * 3 / 2 * height; + break; + case MAKEFOURCC('N','V','1','2'): + case MAKEFOURCC('Y','V','1','2'): + case MAKEFOURCC('I','4','2','0'): + case MAKEFOURCC('I','Y','U','V'): + plane_size = stride * height * 3 / 2; + break; + default: + plane_size = stride * height; + }
if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY; @@ -1377,7 +1394,6 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo case MAKEFOURCC('I','M','C','1'): case MAKEFOURCC('I','M','C','3'): max_length = pitch * height * 2; - plane_size *= 2; break; case MAKEFOURCC('N','V','1','2'): case MAKEFOURCC('Y','V','1','2'): diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 28b89de4b1f..8fddef8fd40 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -5736,9 +5736,11 @@ static void test_MFCreate2DMediaBuffer(void) { 2, 2, MAKEFOURCC('I','M','C','2'), 6, 128, 0, 384 }, { 4, 2, MAKEFOURCC('I','M','C','2'), 12, 128 }, { 2, 4, MAKEFOURCC('I','M','C','2'), 12, 128 }, + { 3, 5, MAKEFOURCC('I','M','C','2'), 20, 128 }, { 2, 2, MAKEFOURCC('I','M','C','4'), 6, 128 }, { 4, 2, MAKEFOURCC('I','M','C','4'), 12, 128 }, { 2, 4, MAKEFOURCC('I','M','C','4'), 12, 128 }, + { 3, 5, MAKEFOURCC('I','M','C','4'), 20, 128 },
{ 4, 2, MAKEFOURCC('I','M','C','1'), 32, 128, 2 }, { 4, 4, MAKEFOURCC('I','M','C','1'), 64, 128, 2 }, @@ -5998,13 +6000,6 @@ static void test_MFCreate2DMediaBuffer(void) hr = IMFMediaBuffer_Unlock(buffer); ok(hr == S_OK, "Failed to unlock buffer, hr %#lx.\n", hr);
- hr = pMFGetPlaneSize(ptr->fourcc, ptr->width, ptr->height, &length2); - ok(hr == S_OK, "Failed to get plane size, hr %#lx.\n", hr); - if (ptr->plane_multiplier) - length2 *= ptr->plane_multiplier; - ok(length2 == length, "%d: contiguous length %lu does not match plane size %lu, %u x %u, format %s.\n", i, length, - length2, ptr->width, ptr->height, wine_dbgstr_an((char *)&ptr->fourcc, 4)); - hr = IMF2DBuffer_Lock2D(_2dbuffer, &data, &pitch); ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr);
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/mfplat/buffer.c | 3 +-- dlls/mfplat/tests/mfplat.c | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index 39407ccc9e2..a7ba306223d 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -100,8 +100,7 @@ static void copy_image_imc1(BYTE *dest, LONG dest_stride, const BYTE *src, LONG
static void copy_image_imc2(BYTE *dest, LONG dest_stride, const BYTE *src, LONG src_stride, DWORD width, DWORD lines) { - MFCopyImage(dest, dest_stride, src, src_stride, width / 2, lines / 2); - MFCopyImage(dest + dest_stride / 2, dest_stride, src + src_stride / 2, src_stride, width / 2, lines / 2); + MFCopyImage(dest, dest_stride / 2, src, src_stride / 2, width / 2, lines); }
static inline struct buffer *impl_from_IMFMediaBuffer(IMFMediaBuffer *iface) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 8fddef8fd40..9a326ae5243 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6028,12 +6028,11 @@ static void test_MFCreate2DMediaBuffer(void)
case MAKEFOURCC('I','M','C','2'): case MAKEFOURCC('I','M','C','4'): - for (j = ptr->height; j < length2 / stride; j++) + for (j = 0; ptr->height * stride + j * (stride / 2) < length2; j++) for (k = 0; k < ptr->width / 2; k++) - ok(data[j * pitch + k] == 0xff, "Unexpected byte %02x at test %d row %d column %d.\n", data[j * pitch + k], i, j, k); - for (j = ptr->height; j < length2 / stride; j++) - for (k = pitch / 2; k < pitch / 2 + ptr->width / 2; k++) - ok(data[j * pitch + k] == 0xff, "Unexpected byte %02x at test %d row %d column %d.\n", data[j * pitch + k], i, j, k); + ok(data[ptr->height * pitch + j * (pitch / 2) + k] == 0xff, + "Unexpected byte %02x at test %d row %d column %d.\n", + data[ptr->height * pitch + j * (pitch / 2) + k], i, j, k); break;
case MAKEFOURCC('N','V','1','2'):
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=116848
Your paranoid android.
=== w7u_adm (32 bit report) ===
mfplat: 0864:mfplat: unhandled exception c0000005 at 6F1C7D1C
=== w7u_el (32 bit report) ===
mfplat: 0868:mfplat: unhandled exception c0000005 at 72297D1C
=== debian11 (32 bit report) ===
Report validation errors: mfplat:mfplat prints too much data (36954 bytes)
=== debian11 (32 bit WoW report) ===
Report validation errors: mfplat:mfplat prints too much data (41318 bytes)
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/mfplat/tests/mfplat.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 9a326ae5243..c9da9fecef4 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6392,6 +6392,7 @@ static void test_MFCreateDXSurfaceBuffer(void) { IDirect3DSurface9 *backbuffer = NULL, *surface; IDirect3DSwapChain9 *swapchain; + D3DLOCKED_RECT locked_rect; DWORD length, max_length; IDirect3DDevice9 *device; IMF2DBuffer2 *_2dbuffer2; @@ -6464,9 +6465,32 @@ static void test_MFCreateDXSurfaceBuffer(void) ok(hr == S_OK, "Failed to get length, hr %#lx.\n", hr); ok(length == 2 * max_length, "Unexpected length %lu.\n", length);
+ hr = IDirect3DSurface9_LockRect(backbuffer, &locked_rect, NULL, 0); + ok(hr == S_OK, "Failed to lock back buffer, hr %#lx.\n", hr); + + /* Cannot lock while the surface is locked. */ + hr = IMFMediaBuffer_Lock(buffer, &data, NULL, &length); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + hr = IDirect3DSurface9_UnlockRect(backbuffer); + ok(hr == S_OK, "Failed to unlock back buffer, hr %#lx.\n", hr); + + hr = IMFMediaBuffer_Lock(buffer, &data, NULL, &length); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(length == max_length, "Unexpected length %lu instead of %lu.\n", length, max_length); + + /* You can lock the surface while the media buffer is locked. */ + hr = IDirect3DSurface9_LockRect(backbuffer, &locked_rect, NULL, 0); + ok(hr == S_OK, "Failed to lock back buffer, hr %#lx.\n", hr); + hr = IMFMediaBuffer_Lock(buffer, &data, NULL, &length); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - ok(length == max_length, "Unexpected length.\n"); + + hr = IMFMediaBuffer_Unlock(buffer); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IDirect3DSurface9_UnlockRect(backbuffer); + ok(hr == S_OK, "Failed to unlock back buffer, hr %#lx.\n", hr);
/* Unlock twice. */ hr = IMFMediaBuffer_Unlock(buffer);
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=116849
Your paranoid android.
=== w7u_adm (32 bit report) ===
mfplat: 0868:mfplat: unhandled exception c0000005 at 6F0B7D1C
=== w8 (32 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6572: Test failed: Unexpected leading byte. mfplat.c:6574: Test failed: Unexpected hr 0x80070057.
=== w8adm (32 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6572: Test failed: Unexpected leading byte. mfplat.c:6574: Test failed: Unexpected hr 0x80070057.
=== w864 (32 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6572: Test failed: Unexpected leading byte. mfplat.c:6574: Test failed: Unexpected hr 0x80070057.
=== w1064v1507 (32 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6572: Test failed: Unexpected leading byte. mfplat.c:6574: Test failed: Unexpected hr 0x80070057.
=== w864 (64 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6572: Test failed: Unexpected leading byte. mfplat.c:6574: Test failed: Unexpected hr 0x80070057.
=== w1064v1507 (64 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6572: Test failed: Unexpected leading byte. mfplat.c:6574: Test failed: Unexpected hr 0x80070057.
=== debian11 (32 bit report) ===
Report validation errors: mfplat:mfplat prints too much data (41310 bytes)
=== debian11 (32 bit Hindi:India report) ===
mfplat: Unhandled exception: assertion failed in 32-bit code (0xf7f70559).
=== debian11 (32 bit WoW report) ===
Report validation errors: mfplat:mfplat prints too much data (38258 bytes)
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/mfplat/tests/mfplat.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index c9da9fecef4..16599532d8f 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6520,9 +6520,23 @@ static void test_MFCreateDXSurfaceBuffer(void) hr = IMF2DBuffer_GetScanline0AndPitch(_2dbuffer, &data, &pitch); ok(hr == HRESULT_FROM_WIN32(ERROR_WAS_UNLOCKED), "Unexpected hr %#lx.\n", hr);
+ hr = IDirect3DSurface9_LockRect(backbuffer, &locked_rect, NULL, 0); + ok(hr == S_OK, "Failed to lock back buffer, hr %#lx.\n", hr); + + /* Cannot lock the buffer while the surface is locked. */ + hr = IMF2DBuffer_Lock2D(_2dbuffer, &data, &pitch); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + + hr = IDirect3DSurface9_UnlockRect(backbuffer); + ok(hr == S_OK, "Failed to unlock back buffer, hr %#lx.\n", hr); + hr = IMF2DBuffer_Lock2D(_2dbuffer, &data, &pitch); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ /* Cannot lock the surface once the buffer is locked. */ + hr = IDirect3DSurface9_LockRect(backbuffer, &locked_rect, NULL, 0); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); + hr = IMF2DBuffer_GetScanline0AndPitch(_2dbuffer, &data, &pitch); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
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=116850
Your paranoid android.
=== w7u_adm (32 bit report) ===
mfplat: 0868:mfplat: unhandled exception c0000005 at 6F0B7D1C
=== w8 (32 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6586: Test failed: Unexpected leading byte. mfplat.c:6588: Test failed: Unexpected hr 0x80070057.
=== w8adm (32 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6586: Test failed: Unexpected leading byte. mfplat.c:6588: Test failed: Unexpected hr 0x80070057.
=== w864 (32 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6586: Test failed: Unexpected leading byte. mfplat.c:6588: Test failed: Unexpected hr 0x80070057.
=== w1064v1507 (32 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6586: Test failed: Unexpected leading byte. mfplat.c:6588: Test failed: Unexpected hr 0x80070057.
=== w864 (64 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6586: Test failed: Unexpected leading byte. mfplat.c:6588: Test failed: Unexpected hr 0x80070057.
=== w1064v1507 (64 bit report) ===
mfplat: mfplat.c:6480: Test failed: Unexpected length 0 instead of 1228800. mfplat.c:6497: Test failed: Unexpected hr 0x80070057. mfplat.c:6514: Test failed: Unexpected hr 0x80070057. mfplat.c:6586: Test failed: Unexpected leading byte. mfplat.c:6588: Test failed: Unexpected hr 0x80070057.
=== debian11 (32 bit report) ===
Report validation errors: mfplat:mfplat prints too much data (41310 bytes)
=== debian11 (32 bit WoW report) ===
Report validation errors: mfplat:mfplat prints too much data (41338 bytes)
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/mfplat/buffer.c | 114 +++++++------------------------------------ 1 file changed, 18 insertions(+), 96 deletions(-)
diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index a7ba306223d..2bf06469576 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -485,44 +485,14 @@ static ULONG WINAPI memory_2d_buffer_Release(IMF2DBuffer2 *iface) return IMFMediaBuffer_Release(&buffer->IMFMediaBuffer_iface); }
-static HRESULT memory_2d_buffer_lock(struct buffer *buffer, BYTE **scanline0, LONG *pitch, - BYTE **buffer_start, DWORD *buffer_length) -{ - HRESULT hr = S_OK; - - if (buffer->_2d.linear_buffer) - hr = MF_E_UNEXPECTED; - else - { - ++buffer->_2d.locks; - *scanline0 = buffer->_2d.scanline0; - *pitch = buffer->_2d.pitch; - if (buffer_start) - *buffer_start = buffer->data; - if (buffer_length) - *buffer_length = buffer->max_length; - } - - return hr; -} - static HRESULT WINAPI memory_2d_buffer_Lock2D(IMF2DBuffer2 *iface, BYTE **scanline0, LONG *pitch) { - struct buffer *buffer = impl_from_IMF2DBuffer2(iface); - HRESULT hr; + DWORD buffer_length; + BYTE *buffer_start;
TRACE("%p, %p, %p.\n", iface, scanline0, pitch);
- if (!scanline0 || !pitch) - return E_POINTER; - - EnterCriticalSection(&buffer->cs); - - hr = memory_2d_buffer_lock(buffer, scanline0, pitch, NULL, NULL); - - LeaveCriticalSection(&buffer->cs); - - return hr; + return IMF2DBuffer2_Lock2DSize(iface, MF2DBuffer_LockFlags_ReadWrite, scanline0, pitch, &buffer_start, &buffer_length); }
static HRESULT WINAPI memory_2d_buffer_Unlock2D(IMF2DBuffer2 *iface) @@ -616,7 +586,7 @@ static HRESULT WINAPI memory_2d_buffer_Lock2DSize(IMF2DBuffer2 *iface, MF2DBuffe LONG *pitch, BYTE **buffer_start, DWORD *buffer_length) { struct buffer *buffer = impl_from_IMF2DBuffer2(iface); - HRESULT hr; + HRESULT hr = S_OK;
TRACE("%p, %#x, %p, %p, %p, %p.\n", iface, flags, scanline0, pitch, buffer_start, buffer_length);
@@ -625,7 +595,18 @@ static HRESULT WINAPI memory_2d_buffer_Lock2DSize(IMF2DBuffer2 *iface, MF2DBuffe
EnterCriticalSection(&buffer->cs);
- hr = memory_2d_buffer_lock(buffer, scanline0, pitch, buffer_start, buffer_length); + if (buffer->_2d.linear_buffer) + hr = MF_E_UNEXPECTED; + else + { + ++buffer->_2d.locks; + *scanline0 = buffer->_2d.scanline0; + *pitch = buffer->_2d.pitch; + if (buffer_start) + *buffer_start = buffer->data; + if (buffer_length) + *buffer_length = buffer->max_length; + }
LeaveCriticalSection(&buffer->cs);
@@ -655,37 +636,6 @@ static const IMF2DBuffer2Vtbl memory_2d_buffer_vtbl = memory_2d_buffer_Copy2DTo, };
-static HRESULT WINAPI d3d9_surface_buffer_Lock2D(IMF2DBuffer2 *iface, BYTE **scanline0, LONG *pitch) -{ - struct buffer *buffer = impl_from_IMF2DBuffer2(iface); - HRESULT hr = S_OK; - - TRACE("%p, %p, %p.\n", iface, scanline0, pitch); - - if (!scanline0 || !pitch) - return E_POINTER; - - EnterCriticalSection(&buffer->cs); - - if (buffer->_2d.linear_buffer) - hr = MF_E_UNEXPECTED; - else if (!buffer->_2d.locks) - { - hr = IDirect3DSurface9_LockRect(buffer->d3d9_surface.surface, &buffer->d3d9_surface.rect, NULL, 0); - } - - if (SUCCEEDED(hr)) - { - buffer->_2d.locks++; - *scanline0 = buffer->d3d9_surface.rect.pBits; - *pitch = buffer->d3d9_surface.rect.Pitch; - } - - LeaveCriticalSection(&buffer->cs); - - return hr; -} - static HRESULT WINAPI d3d9_surface_buffer_Unlock2D(IMF2DBuffer2 *iface) { struct buffer *buffer = impl_from_IMF2DBuffer2(iface); @@ -781,7 +731,7 @@ static const IMF2DBuffer2Vtbl d3d9_surface_buffer_vtbl = memory_2d_buffer_QueryInterface, memory_2d_buffer_AddRef, memory_2d_buffer_Release, - d3d9_surface_buffer_Lock2D, + memory_2d_buffer_Lock2D, d3d9_surface_buffer_Unlock2D, d3d9_surface_buffer_GetScanline0AndPitch, memory_2d_buffer_IsContiguousFormat, @@ -1030,34 +980,6 @@ static HRESULT WINAPI dxgi_surface_buffer_SetCurrentLength(IMFMediaBuffer *iface return S_OK; }
-static HRESULT WINAPI dxgi_surface_buffer_Lock2D(IMF2DBuffer2 *iface, BYTE **scanline0, LONG *pitch) -{ - struct buffer *buffer = impl_from_IMF2DBuffer2(iface); - HRESULT hr = S_OK; - - TRACE("%p, %p, %p.\n", iface, scanline0, pitch); - - if (!scanline0 || !pitch) - return E_POINTER; - - EnterCriticalSection(&buffer->cs); - - if (buffer->_2d.linear_buffer) - hr = MF_E_UNEXPECTED; - else if (!buffer->_2d.locks++) - hr = dxgi_surface_buffer_map(buffer); - - if (SUCCEEDED(hr)) - { - *scanline0 = buffer->dxgi_surface.map_desc.pData; - *pitch = buffer->dxgi_surface.map_desc.RowPitch; - } - - LeaveCriticalSection(&buffer->cs); - - return hr; -} - static HRESULT WINAPI dxgi_surface_buffer_Unlock2D(IMF2DBuffer2 *iface) { struct buffer *buffer = impl_from_IMF2DBuffer2(iface); @@ -1236,7 +1158,7 @@ static const IMF2DBuffer2Vtbl dxgi_surface_buffer_vtbl = memory_2d_buffer_QueryInterface, memory_2d_buffer_AddRef, memory_2d_buffer_Release, - dxgi_surface_buffer_Lock2D, + memory_2d_buffer_Lock2D, dxgi_surface_buffer_Unlock2D, dxgi_surface_buffer_GetScanline0AndPitch, memory_2d_buffer_IsContiguousFormat,
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=116851
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors: mfplat:mfplat prints too much data (38279 bytes)
=== debian11 (32 bit WoW report) ===
Report validation errors: mfplat:mfplat prints too much data (41338 bytes)
I didn't do that to avoid two traces per Lock2D() call. Why is it better to forward?
Hi,
Il 13/06/22 18:33, Nikolay Sivov ha scritto:
I didn't do that to avoid two traces per Lock2D() call. Why is it better to forward?
Well, we get rid of something like 70 lines of boilerplate and duplicated code. If you don't like the double trace, I can get rid of the one in Lock2D().
Giovanni.
On 6/14/22 11:52, Giovanni Mascellani wrote:
Hi,
Il 13/06/22 18:33, Nikolay Sivov ha scritto:
I didn't do that to avoid two traces per Lock2D() call. Why is it better to forward?
Well, we get rid of something like 70 lines of boilerplate and duplicated code. If you don't like the double trace, I can get rid of the one in Lock2D().
I don't what to get rid of it, I want to see which method is called, including non-generic name of method itself.
Giovanni.
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=116847
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors: mfplat:mfplat prints too much data (38251 bytes)
=== debian11 (32 bit Hindi:India report) ===
mfplat: Unhandled exception: assertion failed in 32-bit code (0xf7fa8559).
=== debian11 (32 bit WoW report) ===
Report validation errors: mfplat:mfplat prints too much data (38238 bytes)
Hi,
Il 13/06/22 15:42, Marvin ha scritto:
=== debian11 (32 bit report) ===
Report validation errors: mfplat:mfplat prints too much data (38251 bytes)
=== debian11 (32 bit Hindi:India report) ===
mfplat: Unhandled exception: assertion failed in 32-bit code (0xf7fa8559).
=== debian11 (32 bit WoW report) ===
Report validation errors: mfplat:mfplat prints too much data (38238 bytes)
I don't think these failures are related to my patches. They appear even with a trivial empty patch.
Giovanni.
On 6/13/22 16:14, Giovanni Mascellani wrote:
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 28b89de4b1f..8fddef8fd40 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -5736,9 +5736,11 @@ static void test_MFCreate2DMediaBuffer(void) { 2, 2, MAKEFOURCC('I','M','C','2'), 6, 128, 0, 384 }, { 4, 2, MAKEFOURCC('I','M','C','2'), 12, 128 }, { 2, 4, MAKEFOURCC('I','M','C','2'), 12, 128 },
{ 3, 5, MAKEFOURCC('I','M','C','2'), 20, 128 }, { 2, 2, MAKEFOURCC('I','M','C','4'), 6, 128 }, { 4, 2, MAKEFOURCC('I','M','C','4'), 12, 128 }, { 2, 4, MAKEFOURCC('I','M','C','4'), 12, 128 },
{ 3, 5, MAKEFOURCC('I','M','C','4'), 20, 128 }, { 4, 2, MAKEFOURCC('I','M','C','1'), 32, 128, 2 }, { 4, 4, MAKEFOURCC('I','M','C','1'), 64, 128, 2 },
@@ -5998,13 +6000,6 @@ static void test_MFCreate2DMediaBuffer(void) hr = IMFMediaBuffer_Unlock(buffer); ok(hr == S_OK, "Failed to unlock buffer, hr %#lx.\n", hr);
hr = pMFGetPlaneSize(ptr->fourcc, ptr->width, ptr->height, &length2);
ok(hr == S_OK, "Failed to get plane size, hr %#lx.\n", hr);
if (ptr->plane_multiplier)
length2 *= ptr->plane_multiplier;
ok(length2 == length, "%d: contiguous length %lu does not match plane size %lu, %u x %u, format %s.\n", i, length,
length2, ptr->width, ptr->height, wine_dbgstr_an((char *)&ptr->fourcc, 4));
Do we have all interesting tests cases for MFGetPlaneSize duplicated in other tests, to remove this one? Also if it needs to be removed multiplier field becomes unused.
Hi,
Il 13/06/22 18:27, Nikolay Sivov ha scritto:
Do we have all interesting tests cases for MFGetPlaneSize duplicated in other tests, to remove this one? Also if it needs to be removed multiplier field becomes unused.
I think test_MFGetPlaneSize() does a more thorough testing. But maybe even better would be to merge the two test datasets. All these tests are quite quick and shouldn't add too much load. I'll submit another patch set.
You're right the unused multiplier.
Thanks, Giovanni.