Commit dae643d2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplat: Fix SetCurrentLength() for d3d11 buffer.

parent ff056c3f
......@@ -856,6 +856,17 @@ static HRESULT WINAPI dxgi_surface_buffer_Unlock(IMFMediaBuffer *iface)
return E_NOTIMPL;
}
static HRESULT WINAPI dxgi_surface_buffer_SetCurrentLength(IMFMediaBuffer *iface, DWORD current_length)
{
struct memory_buffer *buffer = impl_from_IMFMediaBuffer(iface);
TRACE("%p, %u.\n", iface, current_length);
buffer->current_length = current_length;
return S_OK;
}
static HRESULT WINAPI dxgi_surface_buffer_Lock2D(IMF2DBuffer2 *iface, BYTE **scanline0, LONG *pitch)
{
FIXME("%p, %p, %p.\n", iface, scanline0, pitch);
......@@ -977,7 +988,7 @@ static const IMFMediaBufferVtbl dxgi_surface_1d_buffer_vtbl =
dxgi_surface_buffer_Lock,
dxgi_surface_buffer_Unlock,
memory_buffer_GetCurrentLength,
memory_buffer_SetCurrentLength,
dxgi_surface_buffer_SetCurrentLength,
memory_buffer_GetMaxLength,
};
......
......@@ -6350,6 +6350,22 @@ static void test_dxgi_surface_buffer(void)
check_interface(buffer, &IID_IMFDXGIBuffer, TRUE);
check_interface(buffer, &IID_IMFGetService, FALSE);
max_length = 0;
hr = IMFMediaBuffer_GetMaxLength(buffer, &max_length);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(!!max_length, "Unexpected length %u.\n", max_length);
hr = IMFMediaBuffer_GetCurrentLength(buffer, &cur_length);
ok(hr == S_OK, "Failed to get length, hr %#x.\n", hr);
ok(!cur_length, "Unexpected length %u.\n", cur_length);
hr = IMFMediaBuffer_SetCurrentLength(buffer, 2 * max_length);
ok(hr == S_OK, "Failed to get length, hr %#x.\n", hr);
hr = IMFMediaBuffer_GetCurrentLength(buffer, &cur_length);
ok(hr == S_OK, "Failed to get length, hr %#x.\n", hr);
ok(cur_length == 2 * max_length, "Unexpected length %u.\n", cur_length);
hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFDXGIBuffer, (void **)&dxgi_buffer);
ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment