Ludger Sprenker : windowscodecs: Implement ComponentFactory:: CreateEncoderPropertyBag.

Alexandre Julliard julliard at winehq.org
Wed Jan 30 13:43:22 CST 2013


Module: wine
Branch: master
Commit: d4b1db7141070f0db63e6a7703334a32c5c7aa28
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d4b1db7141070f0db63e6a7703334a32c5c7aa28

Author: Ludger Sprenker <Ludger at Sprenker.net>
Date:   Tue Jan 29 19:50:36 2013 +0100

windowscodecs: Implement ComponentFactory::CreateEncoderPropertyBag.

---

 dlls/windowscodecs/bmpencode.c         |    2 +-
 dlls/windowscodecs/icnsformat.c        |    2 +-
 dlls/windowscodecs/imgfactory.c        |    4 ++--
 dlls/windowscodecs/jpegformat.c        |    2 +-
 dlls/windowscodecs/pngformat.c         |    2 +-
 dlls/windowscodecs/propertybag.c       |    4 +++-
 dlls/windowscodecs/tests/propertybag.c |    2 --
 dlls/windowscodecs/tiffformat.c        |    2 +-
 dlls/windowscodecs/wincodecs_private.h |    3 ++-
 9 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c
index 27922e7..9bd2340 100644
--- a/dlls/windowscodecs/bmpencode.c
+++ b/dlls/windowscodecs/bmpencode.c
@@ -538,7 +538,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
 
     if (!This->stream) return WINCODEC_ERR_NOTINITIALIZED;
 
-    hr = CreatePropertyBag2(ppIEncoderOptions);
+    hr = CreatePropertyBag2(NULL, 0, ppIEncoderOptions);
     if (FAILED(hr)) return hr;
 
     encode = HeapAlloc(GetProcessHeap(), 0, sizeof(BmpFrameEncode));
diff --git a/dlls/windowscodecs/icnsformat.c b/dlls/windowscodecs/icnsformat.c
index c777581..254f81f 100644
--- a/dlls/windowscodecs/icnsformat.c
+++ b/dlls/windowscodecs/icnsformat.c
@@ -663,7 +663,7 @@ static HRESULT WINAPI IcnsEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
         goto end;
     }
 
-    hr = CreatePropertyBag2(ppIEncoderOptions);
+    hr = CreatePropertyBag2(NULL, 0, ppIEncoderOptions);
     if (FAILED(hr))
         goto end;
 
diff --git a/dlls/windowscodecs/imgfactory.c b/dlls/windowscodecs/imgfactory.c
index 3e574d5..7965c55 100644
--- a/dlls/windowscodecs/imgfactory.c
+++ b/dlls/windowscodecs/imgfactory.c
@@ -821,8 +821,8 @@ static HRESULT WINAPI ComponentFactory_CreateQueryWriterFromBlockWriter(IWICComp
 static HRESULT WINAPI ComponentFactory_CreateEncoderPropertyBag(IWICComponentFactory *iface,
         PROPBAG2 *options, UINT count, IPropertyBag2 **property)
 {
-    FIXME("%p,%p,%u,%p: stub\n", iface, options, count, property);
-    return E_NOTIMPL;
+    TRACE("(%p,%p,%u,%p)\n", iface, options, count, property);
+    return CreatePropertyBag2(options, count, property);
 }
 
 static const IWICComponentFactoryVtbl ComponentFactory_Vtbl = {
diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c
index 6463de5..1aca6d1 100644
--- a/dlls/windowscodecs/jpegformat.c
+++ b/dlls/windowscodecs/jpegformat.c
@@ -1389,7 +1389,7 @@ static HRESULT WINAPI JpegEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
         return WINCODEC_ERR_NOTINITIALIZED;
     }
 
-    hr = CreatePropertyBag2(ppIEncoderOptions);
+    hr = CreatePropertyBag2(NULL, 0, ppIEncoderOptions);
     if (FAILED(hr))
     {
         LeaveCriticalSection(&This->lock);
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index 4183d8e..e4236e2 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -1615,7 +1615,7 @@ static HRESULT WINAPI PngEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
         return WINCODEC_ERR_NOTINITIALIZED;
     }
 
-    hr = CreatePropertyBag2(ppIEncoderOptions);
+    hr = CreatePropertyBag2(NULL, 0, ppIEncoderOptions);
     if (FAILED(hr))
     {
         LeaveCriticalSection(&This->lock);
diff --git a/dlls/windowscodecs/propertybag.c b/dlls/windowscodecs/propertybag.c
index 3a85df0..1c90b15 100644
--- a/dlls/windowscodecs/propertybag.c
+++ b/dlls/windowscodecs/propertybag.c
@@ -1,5 +1,6 @@
 /*
  * Copyright 2009 Vincent Povirk for CodeWeavers
+ * Copyright 2013 Ludger Sprenker
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -136,7 +137,8 @@ static const IPropertyBag2Vtbl PropertyBag_Vtbl = {
     PropertyBag_LoadObject
 };
 
-HRESULT CreatePropertyBag2(IPropertyBag2 **ppPropertyBag2)
+HRESULT CreatePropertyBag2(PROPBAG2 *options, UINT count,
+                           IPropertyBag2 **ppPropertyBag2)
 {
     PropertyBag *This;
 
diff --git a/dlls/windowscodecs/tests/propertybag.c b/dlls/windowscodecs/tests/propertybag.c
index b7e5153..d5ac809 100644
--- a/dlls/windowscodecs/tests/propertybag.c
+++ b/dlls/windowscodecs/tests/propertybag.c
@@ -234,7 +234,6 @@ static void test_empty_propertybag(void)
 
     hr = IWICComponentFactory_CreateEncoderPropertyBag(factory, NULL, 0, &property);
 
-todo_wine
     ok(hr == S_OK, "Creating EncoderPropertyBag failed, hr=%x\n", hr);
     if (FAILED(hr)) return;
 
@@ -265,7 +264,6 @@ static void test_filled_propertybag(void)
 
     hr = IWICComponentFactory_CreateEncoderPropertyBag(factory, opts, 2, &property);
 
-todo_wine
     ok(hr == S_OK, "Creating EncoderPropertyBag failed, hr=%x\n", hr);
     if (FAILED(hr)) return;
 
diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c
index fcaa905..8cebb0c 100644
--- a/dlls/windowscodecs/tiffformat.c
+++ b/dlls/windowscodecs/tiffformat.c
@@ -1883,7 +1883,7 @@ static HRESULT WINAPI TiffEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
 
     if (SUCCEEDED(hr))
     {
-        hr = CreatePropertyBag2(ppIEncoderOptions);
+        hr = CreatePropertyBag2(NULL, 0, ppIEncoderOptions);
     }
 
     if (SUCCEEDED(hr))
diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h
index f8b7789..617db71 100644
--- a/dlls/windowscodecs/wincodecs_private.h
+++ b/dlls/windowscodecs/wincodecs_private.h
@@ -62,7 +62,8 @@ extern void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT heigh
 
 extern HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp) DECLSPEC_HIDDEN;
 
-extern HRESULT CreatePropertyBag2(IPropertyBag2 **ppPropertyBag2) DECLSPEC_HIDDEN;
+extern HRESULT CreatePropertyBag2(PROPBAG2 *options, UINT count,
+                                  IPropertyBag2 **property) DECLSPEC_HIDDEN;
 
 extern HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo) DECLSPEC_HIDDEN;
 extern HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnknown **ppIEnumUnknown) DECLSPEC_HIDDEN;




More information about the wine-cvs mailing list