Commit 941f2d3a authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

windowscodecs: Implement Initialize for BMP encoder.

parent fbadf7c0
...@@ -38,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); ...@@ -38,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
typedef struct BmpEncoder { typedef struct BmpEncoder {
const IWICBitmapEncoderVtbl *lpVtbl; const IWICBitmapEncoderVtbl *lpVtbl;
LONG ref; LONG ref;
IStream *stream;
} BmpEncoder; } BmpEncoder;
static HRESULT WINAPI BmpEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID iid, static HRESULT WINAPI BmpEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID iid,
...@@ -82,6 +83,7 @@ static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface) ...@@ -82,6 +83,7 @@ static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface)
if (ref == 0) if (ref == 0)
{ {
if (This->stream) IStream_Release(This->stream);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
} }
...@@ -91,8 +93,14 @@ static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface) ...@@ -91,8 +93,14 @@ static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface)
static HRESULT WINAPI BmpEncoder_Initialize(IWICBitmapEncoder *iface, static HRESULT WINAPI BmpEncoder_Initialize(IWICBitmapEncoder *iface,
IStream *pIStream, WICBitmapEncoderCacheOption cacheOption) IStream *pIStream, WICBitmapEncoderCacheOption cacheOption)
{ {
FIXME("(%p,%p,%u): stub\n", iface, pIStream, cacheOption); BmpEncoder *This = (BmpEncoder*)iface;
return E_NOTIMPL;
TRACE("(%p,%p,%u)\n", iface, pIStream, cacheOption);
IStream_AddRef(pIStream);
This->stream = pIStream;
return S_OK;
} }
static HRESULT WINAPI BmpEncoder_GetContainerFormat(IWICBitmapEncoder *iface, static HRESULT WINAPI BmpEncoder_GetContainerFormat(IWICBitmapEncoder *iface,
...@@ -186,6 +194,7 @@ HRESULT BmpEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) ...@@ -186,6 +194,7 @@ HRESULT BmpEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
This->lpVtbl = &BmpEncoder_Vtbl; This->lpVtbl = &BmpEncoder_Vtbl;
This->ref = 1; This->ref = 1;
This->stream = NULL;
ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv);
IUnknown_Release((IUnknown*)This); IUnknown_Release((IUnknown*)This);
......
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