windowscodecs: Add a stubbed out IWICMetadataBlockReader to TIFF decoder.

This commit is contained in:
Dmitry Timoshkov 2012-06-06 18:44:11 +09:00 committed by Alexandre Julliard
parent 89d43a3dd7
commit 34229e5fb6
1 changed files with 71 additions and 0 deletions

View File

@ -33,6 +33,7 @@
#include "winbase.h" #include "winbase.h"
#include "objbase.h" #include "objbase.h"
#include "wincodec.h" #include "wincodec.h"
#include "wincodecsdk.h"
#include "wincodecs_private.h" #include "wincodecs_private.h"
@ -231,6 +232,7 @@ typedef struct {
typedef struct { typedef struct {
IWICBitmapFrameDecode IWICBitmapFrameDecode_iface; IWICBitmapFrameDecode IWICBitmapFrameDecode_iface;
IWICMetadataBlockReader IWICMetadataBlockReader_iface;
LONG ref; LONG ref;
TiffDecoder *parent; TiffDecoder *parent;
UINT index; UINT index;
@ -240,6 +242,7 @@ typedef struct {
} TiffFrameDecode; } TiffFrameDecode;
static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl; static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl;
static const IWICMetadataBlockReaderVtbl TiffFrameDecode_BlockVtbl;
static inline TiffDecoder *impl_from_IWICBitmapDecoder(IWICBitmapDecoder *iface) static inline TiffDecoder *impl_from_IWICBitmapDecoder(IWICBitmapDecoder *iface)
{ {
@ -251,6 +254,11 @@ static inline TiffFrameDecode *impl_from_IWICBitmapFrameDecode(IWICBitmapFrameDe
return CONTAINING_RECORD(iface, TiffFrameDecode, IWICBitmapFrameDecode_iface); return CONTAINING_RECORD(iface, TiffFrameDecode, IWICBitmapFrameDecode_iface);
} }
static inline TiffFrameDecode *impl_from_IWICMetadataBlockReader(IWICMetadataBlockReader *iface)
{
return CONTAINING_RECORD(iface, TiffFrameDecode, IWICMetadataBlockReader_iface);
}
static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
{ {
uint16 photometric, bps, samples, planar; uint16 photometric, bps, samples, planar;
@ -690,6 +698,7 @@ static HRESULT WINAPI TiffDecoder_GetFrame(IWICBitmapDecoder *iface,
if (result) if (result)
{ {
result->IWICBitmapFrameDecode_iface.lpVtbl = &TiffFrameDecode_Vtbl; result->IWICBitmapFrameDecode_iface.lpVtbl = &TiffFrameDecode_Vtbl;
result->IWICMetadataBlockReader_iface.lpVtbl = &TiffFrameDecode_BlockVtbl;
result->ref = 1; result->ref = 1;
result->parent = This; result->parent = This;
result->index = index; result->index = index;
@ -744,6 +753,10 @@ static HRESULT WINAPI TiffFrameDecode_QueryInterface(IWICBitmapFrameDecode *ifac
{ {
*ppv = This; *ppv = This;
} }
else if (IsEqualIID(&IID_IWICMetadataBlockReader, iid))
{
*ppv = &This->IWICMetadataBlockReader_iface;
}
else else
{ {
*ppv = NULL; *ppv = NULL;
@ -1098,6 +1111,64 @@ static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl = {
TiffFrameDecode_GetThumbnail TiffFrameDecode_GetThumbnail
}; };
static HRESULT WINAPI TiffFrameDecode_Block_QueryInterface(IWICMetadataBlockReader *iface,
REFIID iid, void **ppv)
{
TiffFrameDecode *This = impl_from_IWICMetadataBlockReader(iface);
return IWICBitmapFrameDecode_QueryInterface(&This->IWICBitmapFrameDecode_iface, iid, ppv);
}
static ULONG WINAPI TiffFrameDecode_Block_AddRef(IWICMetadataBlockReader *iface)
{
TiffFrameDecode *This = impl_from_IWICMetadataBlockReader(iface);
return IWICBitmapFrameDecode_AddRef(&This->IWICBitmapFrameDecode_iface);
}
static ULONG WINAPI TiffFrameDecode_Block_Release(IWICMetadataBlockReader *iface)
{
TiffFrameDecode *This = impl_from_IWICMetadataBlockReader(iface);
return IWICBitmapFrameDecode_Release(&This->IWICBitmapFrameDecode_iface);
}
static HRESULT WINAPI TiffFrameDecode_Block_GetContainerFormat(IWICMetadataBlockReader *iface,
GUID *guid)
{
FIXME("(%p,%p): stub\n", iface, guid);
return E_NOTIMPL;
}
static HRESULT WINAPI TiffFrameDecode_Block_GetCount(IWICMetadataBlockReader *iface,
UINT *count)
{
FIXME("(%p,%p): stub\n", iface, count);
return E_NOTIMPL;
}
static HRESULT WINAPI TiffFrameDecode_Block_GetReaderByIndex(IWICMetadataBlockReader *iface,
UINT index, IWICMetadataReader **reader)
{
FIXME("(%p,%u,%p): stub\n", iface, index, reader);
return E_NOTIMPL;
}
static HRESULT WINAPI TiffFrameDecode_Block_GetEnumerator(IWICMetadataBlockReader *iface,
IEnumUnknown **enum_metadata)
{
FIXME("(%p,%p): stub\n", iface, enum_metadata);
return E_NOTIMPL;
}
static const IWICMetadataBlockReaderVtbl TiffFrameDecode_BlockVtbl =
{
TiffFrameDecode_Block_QueryInterface,
TiffFrameDecode_Block_AddRef,
TiffFrameDecode_Block_Release,
TiffFrameDecode_Block_GetContainerFormat,
TiffFrameDecode_Block_GetCount,
TiffFrameDecode_Block_GetReaderByIndex,
TiffFrameDecode_Block_GetEnumerator
};
HRESULT TiffDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) HRESULT TiffDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
{ {
HRESULT ret; HRESULT ret;