Commit 7b751a9f authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz: Stub IVMRSurfaceAllocator on the VMR7 presenter.

parent cf44bec5
......@@ -27,6 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz);
struct vmr7_presenter
{
IVMRImagePresenter IVMRImagePresenter_iface;
IVMRSurfaceAllocator IVMRSurfaceAllocator_iface;
LONG refcount;
};
......@@ -43,6 +44,8 @@ static HRESULT WINAPI image_presenter_QueryInterface(IVMRImagePresenter *iface,
if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IVMRImagePresenter))
*out = iface;
else if (IsEqualGUID(iid, &IID_IVMRSurfaceAllocator))
*out = &presenter->IVMRSurfaceAllocator_iface;
else
{
*out = NULL;
......@@ -103,6 +106,70 @@ static const IVMRImagePresenterVtbl image_presenter_vtbl =
image_presenter_PresentImage,
};
static struct vmr7_presenter *impl_from_IVMRSurfaceAllocator(IVMRSurfaceAllocator *iface)
{
return CONTAINING_RECORD(iface, struct vmr7_presenter, IVMRSurfaceAllocator_iface);
}
static HRESULT WINAPI surface_allocator_QueryInterface(IVMRSurfaceAllocator *iface, REFIID iid, void **out)
{
struct vmr7_presenter *presenter = impl_from_IVMRSurfaceAllocator(iface);
return IVMRImagePresenter_QueryInterface(&presenter->IVMRImagePresenter_iface, iid, out);
}
static ULONG WINAPI surface_allocator_AddRef(IVMRSurfaceAllocator *iface)
{
struct vmr7_presenter *presenter = impl_from_IVMRSurfaceAllocator(iface);
return IVMRImagePresenter_AddRef(&presenter->IVMRImagePresenter_iface);
}
static ULONG WINAPI surface_allocator_Release(IVMRSurfaceAllocator *iface)
{
struct vmr7_presenter *presenter = impl_from_IVMRSurfaceAllocator(iface);
return IVMRImagePresenter_Release(&presenter->IVMRImagePresenter_iface);
}
static HRESULT WINAPI surface_allocator_AllocateSurface(IVMRSurfaceAllocator *iface,
DWORD_PTR id, VMRALLOCATIONINFO *info, DWORD *count, IDirectDrawSurface7 **surfaces)
{
FIXME("iface %p, id %#Ix, info %p, count %p, surfaces %p, stub!\n", iface, id, info, count, surfaces);
return E_NOTIMPL;
}
static HRESULT WINAPI surface_allocator_FreeSurface(IVMRSurfaceAllocator *iface, DWORD_PTR id)
{
FIXME("iface %p, id %#Ix, stub!\n", iface, id);
return E_NOTIMPL;
}
static HRESULT WINAPI surface_allocator_PrepareSurface(IVMRSurfaceAllocator *iface,
DWORD_PTR id, IDirectDrawSurface7 *surface, DWORD flags)
{
FIXME("iface %p, id %#Ix, surface %p, flags %#lx, stub!\n", iface, id, surface, flags);
return E_NOTIMPL;
}
static HRESULT WINAPI surface_allocator_AdviseNotify(IVMRSurfaceAllocator *iface,
IVMRSurfaceAllocatorNotify *notify)
{
FIXME("iface %p, notify %p, stub!\n", iface, notify);
return S_OK;
}
static const IVMRSurfaceAllocatorVtbl surface_allocator_vtbl =
{
surface_allocator_QueryInterface,
surface_allocator_AddRef,
surface_allocator_Release,
surface_allocator_AllocateSurface,
surface_allocator_FreeSurface,
surface_allocator_PrepareSurface,
surface_allocator_AdviseNotify,
};
HRESULT vmr7_presenter_create(IUnknown *outer, IUnknown **out)
{
struct vmr7_presenter *object;
......@@ -115,6 +182,7 @@ HRESULT vmr7_presenter_create(IUnknown *outer, IUnknown **out)
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
object->IVMRImagePresenter_iface.lpVtbl = &image_presenter_vtbl;
object->IVMRSurfaceAllocator_iface.lpVtbl = &surface_allocator_vtbl;
object->refcount = 1;
TRACE("Created VMR7 default presenter %p.\n", object);
......
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