Commit 7f88d691 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

windowscodecs: Implement CommonEncoderFrame_GetMetadataQueryWriter().

parent 82cab7bb
......@@ -467,8 +467,20 @@ static HRESULT WINAPI CommonEncoderFrame_Commit(IWICBitmapFrameEncode *iface)
static HRESULT WINAPI CommonEncoderFrame_GetMetadataQueryWriter(IWICBitmapFrameEncode *iface,
IWICMetadataQueryWriter **ppIMetadataQueryWriter)
{
FIXME("(%p, %p): stub\n", iface, ppIMetadataQueryWriter);
return E_NOTIMPL;
CommonEncoderFrame *encoder = impl_from_IWICBitmapFrameEncode(iface);
TRACE("iface, %p, ppIMetadataQueryWriter %p.\n", iface, ppIMetadataQueryWriter);
if (!ppIMetadataQueryWriter)
return E_INVALIDARG;
if (!encoder->initialized)
return WINCODEC_ERR_NOTINITIALIZED;
if (!(encoder->parent->encoder_info.flags & ENCODER_FLAGS_SUPPORTS_METADATA))
return WINCODEC_ERR_UNSUPPORTEDOPERATION;
return MetadataQueryWriter_CreateInstance(&encoder->IWICMetadataBlockWriter_iface, NULL, ppIMetadataQueryWriter);
}
static const IWICBitmapFrameEncodeVtbl CommonEncoderFrame_Vtbl = {
......
......@@ -2117,8 +2117,17 @@ static HRESULT WINAPI GifFrameEncode_Commit(IWICBitmapFrameEncode *iface)
static HRESULT WINAPI GifFrameEncode_GetMetadataQueryWriter(IWICBitmapFrameEncode *iface, IWICMetadataQueryWriter **writer)
{
FIXME("%p, %p: stub\n", iface, writer);
return E_NOTIMPL;
GifFrameEncode *encode = impl_from_IWICBitmapFrameEncode(iface);
TRACE("iface, %p, writer %p.\n", iface, writer);
if (!writer)
return E_INVALIDARG;
if (!encode->initialized)
return WINCODEC_ERR_NOTINITIALIZED;
return MetadataQueryWriter_CreateInstance(&encode->IWICMetadataBlockWriter_iface, NULL, writer);
}
static const IWICBitmapFrameEncodeVtbl GifFrameEncode_Vtbl =
......
......@@ -3106,8 +3106,7 @@ static void test_metadata_writer(void)
ok(hr == (tests[i].metadata_supported ? S_OK : E_INVALIDARG), "Got unexpected hr %#x, i %u.\n", hr, i);
hr = IWICBitmapFrameEncode_GetMetadataQueryWriter(frameencode, &querywriter2);
todo_wine
ok(hr == (tests[i].succeeds_unitialized ? S_OK : WINCODEC_ERR_NOTINITIALIZED),
todo_wine_if(!i) ok(hr == (tests[i].succeeds_unitialized ? S_OK : WINCODEC_ERR_NOTINITIALIZED),
"Got unexpected hr %#x, i %u.\n", hr, i);
if (hr == S_OK)
IWICMetadataQueryWriter_Release(querywriter2);
......@@ -3116,7 +3115,7 @@ static void test_metadata_writer(void)
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
hr = IWICBitmapFrameEncode_GetMetadataQueryWriter(frameencode, &querywriter2);
todo_wine ok(hr == (tests[i].metadata_supported ? S_OK : WINCODEC_ERR_UNSUPPORTEDOPERATION),
todo_wine_if(!i) ok(hr == (tests[i].metadata_supported ? S_OK : WINCODEC_ERR_UNSUPPORTEDOPERATION),
"Got unexpected hr %#x, i %u.\n", hr, i);
if (tests[i].metadata_supported)
......@@ -3126,8 +3125,7 @@ static void test_metadata_writer(void)
if (querywriter)
{
IWICMetadataQueryWriter_Release(querywriter);
if (querywriter2)
IWICMetadataQueryWriter_Release(querywriter2);
IWICMetadataQueryWriter_Release(querywriter2);
IWICMetadataBlockWriter_Release(blockwriter);
}
IWICBitmapFrameEncode_Release(frameencode);
......
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