"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dlls/windowscodecs/imgfactory.c" between
wine-5.12.tar.xz and wine-5.13.tar.xz

About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs. Development release.

imgfactory.c  (wine-5.12.tar.xz):imgfactory.c  (wine-5.13.tar.xz)
skipping to change at line 137 skipping to change at line 137
IWICStream_Release(stream); IWICStream_Release(stream);
} }
return hr; return hr;
} }
static HRESULT find_decoder(IStream *pIStream, const GUID *pguidVendor, static HRESULT find_decoder(IStream *pIStream, const GUID *pguidVendor,
WICDecodeOptions metadataOptions, IWICBitmapDecoder **decoder) WICDecodeOptions metadataOptions, IWICBitmapDecoder **decoder)
{ {
IEnumUnknown *enumdecoders; IEnumUnknown *enumdecoders = NULL;
IUnknown *unkdecoderinfo; IUnknown *unkdecoderinfo = NULL;
IWICBitmapDecoderInfo *decoderinfo;
GUID vendor; GUID vendor;
HRESULT res; HRESULT res, res_wine;
ULONG num_fetched; ULONG num_fetched;
BOOL matches; BOOL matches, found;
*decoder = NULL; *decoder = NULL;
res = CreateComponentEnumerator(WICDecoder, WICComponentEnumerateDefault, &e numdecoders); res = CreateComponentEnumerator(WICDecoder, WICComponentEnumerateDefault, &e numdecoders);
if (FAILED(res)) return res; if (FAILED(res)) return res;
while (!*decoder) found = FALSE;
while (IEnumUnknown_Next(enumdecoders, 1, &unkdecoderinfo, &num_fetched) ==
S_OK)
{ {
res = IEnumUnknown_Next(enumdecoders, 1, &unkdecoderinfo, &num_fetched); IWICBitmapDecoderInfo *decoderinfo = NULL;
IWICWineDecoder *wine_decoder = NULL;
res = IUnknown_QueryInterface(unkdecoderinfo, &IID_IWICBitmapDecoderInfo
, (void**)&decoderinfo);
if (FAILED(res)) goto next;
if (res == S_OK) if (pguidVendor)
{ {
res = IUnknown_QueryInterface(unkdecoderinfo, &IID_IWICBitmapDecoder res = IWICBitmapDecoderInfo_GetVendorGUID(decoderinfo, &vendor);
Info, (void**)&decoderinfo); if (FAILED(res) || !IsEqualIID(&vendor, pguidVendor)) goto next;
}
res = IWICBitmapDecoderInfo_MatchesPattern(decoderinfo, pIStream, &match
es);
if (FAILED(res) || !matches) goto next;
res = IWICBitmapDecoderInfo_CreateInstance(decoderinfo, decoder);
if (FAILED(res)) goto next;
/* FIXME: should use QueryCapability to choose a decoder */
if (SUCCEEDED(res)) found = TRUE;
res = IWICBitmapDecoder_Initialize(*decoder, pIStream, metadataOptions);
if (FAILED(res))
{
res_wine = IWICBitmapDecoder_QueryInterface(*decoder, &IID_IWICWineD
ecoder, (void **)&wine_decoder);
if (FAILED(res_wine))
{ {
if (pguidVendor) IWICBitmapDecoder_Release(*decoder);
{ *decoder = NULL;
res = IWICBitmapDecoderInfo_GetVendorGUID(decoderinfo, &vend goto next;
or); }
if (FAILED(res) || !IsEqualIID(&vendor, pguidVendor))
{
IWICBitmapDecoderInfo_Release(decoderinfo);
IUnknown_Release(unkdecoderinfo);
continue;
}
}
res = IWICBitmapDecoderInfo_MatchesPattern(decoderinfo, pIStream
, &matches);
if (SUCCEEDED(res) && matches)
{
res = IWICBitmapDecoderInfo_CreateInstance(decoderinfo, deco
der);
/* FIXME: should use QueryCapability to choose a decoder */
if (SUCCEEDED(res))
{
res = IWICBitmapDecoder_Initialize(*decoder, pIStream, m
etadataOptions);
if (FAILED(res))
{
IWICBitmapDecoder_Release(*decoder);
IWICBitmapDecoderInfo_Release(decoderinfo);
IUnknown_Release(unkdecoderinfo);
IEnumUnknown_Release(enumdecoders);
*decoder = NULL;
return res;
}
}
}
IWICBitmapDecoderInfo_Release(decoderinfo); res_wine = IWICWineDecoder_Initialize(wine_decoder, pIStream, metada
taOptions);
if (FAILED(res_wine))
{
IWICBitmapDecoder_Release(*decoder);
*decoder = NULL;
goto next;
} }
IUnknown_Release(unkdecoderinfo); res = res_wine;
} }
else
break; next:
if (wine_decoder) IWICWineDecoder_Release(wine_decoder);
if (decoderinfo) IWICBitmapDecoderInfo_Release(decoderinfo);
IUnknown_Release(unkdecoderinfo);
if (found) break;
} }
IEnumUnknown_Release(enumdecoders); IEnumUnknown_Release(enumdecoders);
if (!found) res = WINCODEC_ERR_COMPONENTNOTFOUND;
return WINCODEC_ERR_COMPONENTNOTFOUND; return res;
} }
static HRESULT WINAPI ImagingFactory_CreateDecoderFromStream( static HRESULT WINAPI ImagingFactory_CreateDecoderFromStream(
IWICImagingFactory2 *iface, IStream *pIStream, const GUID *pguidVendor, IWICImagingFactory2 *iface, IStream *pIStream, const GUID *pguidVendor,
WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder) WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
{ {
HRESULT res; HRESULT res;
IWICBitmapDecoder *decoder = NULL; IWICBitmapDecoder *decoder = NULL;
TRACE("(%p,%p,%s,%u,%p)\n", iface, pIStream, debugstr_guid(pguidVendor), TRACE("(%p,%p,%s,%u,%p)\n", iface, pIStream, debugstr_guid(pguidVendor),
 End of changes. 13 change blocks. 
55 lines changed or deleted 53 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)