| 1 | /* $Id: imem.c,v 1.3 2001-09-05 13:36:35 bird Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * Implementation of CLSID_MemoryAllocator.
|
|---|
| 4 | *
|
|---|
| 5 | * FIXME - stub.
|
|---|
| 6 | *
|
|---|
| 7 | * hidenori@a2.ctktv.ne.jp
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 | #include "config.h"
|
|---|
| 11 |
|
|---|
| 12 | #include "windef.h"
|
|---|
| 13 | #include "winbase.h"
|
|---|
| 14 | #include "wingdi.h"
|
|---|
| 15 | #include "winerror.h"
|
|---|
| 16 | #include "wine/obj_base.h"
|
|---|
| 17 | #include "strmif.h"
|
|---|
| 18 | #include "uuids.h"
|
|---|
| 19 |
|
|---|
| 20 | #include "debugtools.h"
|
|---|
| 21 | DEFAULT_DEBUG_CHANNEL(quartz);
|
|---|
| 22 |
|
|---|
| 23 | #include "quartz_private.h"
|
|---|
| 24 | #include "memalloc.h"
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 | static HRESULT WINAPI
|
|---|
| 28 | IMemAllocator_fnQueryInterface(IMemAllocator* iface,REFIID riid,void** ppobj)
|
|---|
| 29 | {
|
|---|
| 30 | CMemoryAllocator_THIS(iface,memalloc);
|
|---|
| 31 |
|
|---|
| 32 | TRACE("(%p)->()\n",This);
|
|---|
| 33 |
|
|---|
| 34 | return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | static ULONG WINAPI
|
|---|
| 38 | IMemAllocator_fnAddRef(IMemAllocator* iface)
|
|---|
| 39 | {
|
|---|
| 40 | CMemoryAllocator_THIS(iface,memalloc);
|
|---|
| 41 |
|
|---|
| 42 | TRACE("(%p)->()\n",This);
|
|---|
| 43 |
|
|---|
| 44 | return IUnknown_AddRef(This->unk.punkControl);
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| 47 | static ULONG WINAPI
|
|---|
| 48 | IMemAllocator_fnRelease(IMemAllocator* iface)
|
|---|
| 49 | {
|
|---|
| 50 | CMemoryAllocator_THIS(iface,memalloc);
|
|---|
| 51 |
|
|---|
| 52 | TRACE("(%p)->()\n",This);
|
|---|
| 53 |
|
|---|
| 54 | return IUnknown_Release(This->unk.punkControl);
|
|---|
| 55 | }
|
|---|
| 56 |
|
|---|
| 57 | static HRESULT WINAPI
|
|---|
| 58 | IMemAllocator_fnSetProperties(IMemAllocator* iface,ALLOCATOR_PROPERTIES* pPropReq,ALLOCATOR_PROPERTIES* pPropActual)
|
|---|
| 59 | {
|
|---|
| 60 | CMemoryAllocator_THIS(iface,memalloc);
|
|---|
| 61 |
|
|---|
| 62 | FIXME( "(%p)->() stub!\n", This );
|
|---|
| 63 | return E_NOTIMPL;
|
|---|
| 64 | }
|
|---|
| 65 |
|
|---|
| 66 | static HRESULT WINAPI
|
|---|
| 67 | IMemAllocator_fnGetProperties(IMemAllocator* iface,ALLOCATOR_PROPERTIES* pProp)
|
|---|
| 68 | {
|
|---|
| 69 | CMemoryAllocator_THIS(iface,memalloc);
|
|---|
| 70 |
|
|---|
| 71 | FIXME( "(%p)->() stub!\n", This );
|
|---|
| 72 | return E_NOTIMPL;
|
|---|
| 73 | }
|
|---|
| 74 |
|
|---|
| 75 | static HRESULT WINAPI
|
|---|
| 76 | IMemAllocator_fnCommit(IMemAllocator* iface)
|
|---|
| 77 | {
|
|---|
| 78 | CMemoryAllocator_THIS(iface,memalloc);
|
|---|
| 79 |
|
|---|
| 80 | FIXME( "(%p)->() stub!\n", This );
|
|---|
| 81 | return E_NOTIMPL;
|
|---|
| 82 | }
|
|---|
| 83 |
|
|---|
| 84 | static HRESULT WINAPI
|
|---|
| 85 | IMemAllocator_fnDecommit(IMemAllocator* iface)
|
|---|
| 86 | {
|
|---|
| 87 | CMemoryAllocator_THIS(iface,memalloc);
|
|---|
| 88 |
|
|---|
| 89 | FIXME( "(%p)->() stub!\n", This );
|
|---|
| 90 | return E_NOTIMPL;
|
|---|
| 91 | }
|
|---|
| 92 |
|
|---|
| 93 | static HRESULT WINAPI
|
|---|
| 94 | IMemAllocator_fnGetBuffer(IMemAllocator* iface,IMediaSample** ppSample,REFERENCE_TIME* prtStart,REFERENCE_TIME* prtEnd,DWORD dwFlags)
|
|---|
| 95 | {
|
|---|
| 96 | CMemoryAllocator_THIS(iface,memalloc);
|
|---|
| 97 |
|
|---|
| 98 | FIXME( "(%p)->() stub!\n", This );
|
|---|
| 99 | return E_NOTIMPL;
|
|---|
| 100 | }
|
|---|
| 101 |
|
|---|
| 102 | static HRESULT WINAPI
|
|---|
| 103 | IMemAllocator_fnReleaseBuffer(IMemAllocator* iface,IMediaSample* pSample)
|
|---|
| 104 | {
|
|---|
| 105 | CMemoryAllocator_THIS(iface,memalloc);
|
|---|
| 106 |
|
|---|
| 107 | FIXME( "(%p)->() stub!\n", This );
|
|---|
| 108 | return E_NOTIMPL;
|
|---|
| 109 | }
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 | static ICOM_VTABLE(IMemAllocator) imemalloc =
|
|---|
| 114 | {
|
|---|
| 115 | ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|---|
| 116 | /* IUnknown fields */
|
|---|
| 117 | IMemAllocator_fnQueryInterface,
|
|---|
| 118 | IMemAllocator_fnAddRef,
|
|---|
| 119 | IMemAllocator_fnRelease,
|
|---|
| 120 | /* IMemAllocator fields */
|
|---|
| 121 | IMemAllocator_fnSetProperties,
|
|---|
| 122 | IMemAllocator_fnGetProperties,
|
|---|
| 123 | IMemAllocator_fnCommit,
|
|---|
| 124 | IMemAllocator_fnDecommit,
|
|---|
| 125 | IMemAllocator_fnGetBuffer,
|
|---|
| 126 | IMemAllocator_fnReleaseBuffer,
|
|---|
| 127 | };
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 | void CMemoryAllocator_InitIMemAllocator( CMemoryAllocator* pma )
|
|---|
| 131 | {
|
|---|
| 132 | TRACE("(%p)\n",pma);
|
|---|
| 133 | ICOM_VTBL(&pma->memalloc) = &imemalloc;
|
|---|
| 134 | }
|
|---|