Vincent Povirk : windowscodecs: Implement Initialize for the PNG frame encoder.
Alexandre Julliard
julliard at winehq.org
Fri Oct 9 09:24:15 CDT 2009
Module: wine
Branch: master
Commit: 6afcb2eb33a32a14d7a556038cb46616a2ed2ac1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6afcb2eb33a32a14d7a556038cb46616a2ed2ac1
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Wed Sep 23 15:06:11 2009 -0500
windowscodecs: Implement Initialize for the PNG frame encoder.
---
dlls/windowscodecs/pngformat.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index 61efb8b..cfae867 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -673,6 +673,7 @@ typedef struct PngEncoder {
png_structp png_ptr;
png_infop info_ptr;
UINT frame_count;
+ BOOL frame_initialized;
} PngEncoder;
static inline PngEncoder *encoder_from_frame(IWICBitmapFrameEncode *iface)
@@ -718,8 +719,14 @@ static ULONG WINAPI PngFrameEncode_Release(IWICBitmapFrameEncode *iface)
static HRESULT WINAPI PngFrameEncode_Initialize(IWICBitmapFrameEncode *iface,
IPropertyBag2 *pIEncoderOptions)
{
- FIXME("(%p,%p): stub\n", iface, pIEncoderOptions);
- return E_NOTIMPL;
+ PngEncoder *This = encoder_from_frame(iface);
+ TRACE("(%p,%p)\n", iface, pIEncoderOptions);
+
+ if (This->frame_initialized) return WINCODEC_ERR_WRONGSTATE;
+
+ This->frame_initialized = TRUE;
+
+ return S_OK;
}
static HRESULT WINAPI PngFrameEncode_SetSize(IWICBitmapFrameEncode *iface,
@@ -1038,6 +1045,7 @@ HRESULT PngEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
This->info_ptr = NULL;
This->stream = NULL;
This->frame_count = 0;
+ This->frame_initialized = FALSE;
ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv);
IUnknown_Release((IUnknown*)This);
More information about the wine-cvs
mailing list