Commit 0ff8a572 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

evr/sample: Implement GetService() for surface buffers.

parent 208520f8
......@@ -1075,9 +1075,14 @@ static ULONG WINAPI surface_buffer_gs_Release(IMFGetService *iface)
static HRESULT WINAPI surface_buffer_gs_GetService(IMFGetService *iface, REFGUID service, REFIID riid, void **obj)
{
FIXME("%p, %s, %s, %p.\n", iface, debugstr_guid(service), debugstr_guid(riid), obj);
struct surface_buffer *buffer = impl_from_IMFGetService(iface);
return E_NOTIMPL;
TRACE("%p, %s, %s, %p.\n", iface, debugstr_guid(service), debugstr_guid(riid), obj);
if (IsEqualGUID(service, &MR_BUFFER_SERVICE))
return IUnknown_QueryInterface(buffer->surface, riid, obj);
return E_NOINTERFACE;
}
static const IMFGetServiceVtbl surface_buffer_gs_vtbl =
......
......@@ -718,7 +718,7 @@ todo_wine
static void test_surface_sample(void)
{
IDirect3DSurface9 *backbuffer = NULL;
IDirect3DSurface9 *backbuffer = NULL, *surface;
IMFDesiredSample *desired_sample;
IMFMediaBuffer *buffer, *buffer2;
LONGLONG duration, time1, time2;
......@@ -870,6 +870,16 @@ static void test_surface_sample(void)
ok(hr == S_OK, "Failed to get buffer count, hr %#x.\n", hr);
ok(!count, "Unexpected attribute count.\n");
hr = MFGetService((IUnknown *)buffer, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)&surface);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(surface == backbuffer, "Unexpected instance.\n");
IDirect3DSurface9_Release(surface);
hr = MFGetService((IUnknown *)buffer, &MR_BUFFER_SERVICE, &IID_IUnknown, (void **)&surface);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(surface == backbuffer, "Unexpected instance.\n");
IDirect3DSurface9_Release(surface);
IMFMediaBuffer_Release(buffer);
hr = IMFSample_GetSampleFlags(sample, &flags);
......
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