Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
fd31112a
Commit
fd31112a
authored
May 28, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add support for preferred vendor guid in CreateDecoderFromStream.
parent
74d53af5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
11 deletions
+32
-11
imgfactory.c
dlls/windowscodecs/imgfactory.c
+32
-11
No files found.
dlls/windowscodecs/imgfactory.c
View file @
fd31112a
...
...
@@ -122,11 +122,11 @@ static HRESULT WINAPI ImagingFactory_CreateDecoderFromStream(
IWICImagingFactory
*
iface
,
IStream
*
pIStream
,
const
GUID
*
pguidVendor
,
WICDecodeOptions
metadataOptions
,
IWICBitmapDecoder
**
ppIDecoder
)
{
static
int
fixme
=
0
;
IEnumUnknown
*
enumdecoders
;
IUnknown
*
unkdecoderinfo
;
IWICBitmapDecoderInfo
*
decoderinfo
;
IWICBitmapDecoder
*
decoder
=
NULL
;
IWICBitmapDecoder
*
decoder
=
NULL
,
*
preferred_decoder
=
NULL
;
GUID
vendor
;
HRESULT
res
=
S_OK
;
ULONG
num_fetched
;
BOOL
matches
;
...
...
@@ -134,13 +134,10 @@ static HRESULT WINAPI ImagingFactory_CreateDecoderFromStream(
TRACE
(
"(%p,%p,%s,%u,%p)
\n
"
,
iface
,
pIStream
,
debugstr_guid
(
pguidVendor
),
metadataOptions
,
ppIDecoder
);
if
(
pguidVendor
&&
!
fixme
++
)
FIXME
(
"ignoring vendor GUID
\n
"
);
res
=
CreateComponentEnumerator
(
WICDecoder
,
WICComponentEnumerateDefault
,
&
enumdecoders
);
if
(
FAILED
(
res
))
return
res
;
while
(
!
decoder
)
while
(
!
preferred_
decoder
)
{
res
=
IEnumUnknown_Next
(
enumdecoders
,
1
,
&
unkdecoderinfo
,
&
num_fetched
);
...
...
@@ -154,19 +151,36 @@ static HRESULT WINAPI ImagingFactory_CreateDecoderFromStream(
if
(
SUCCEEDED
(
res
)
&&
matches
)
{
res
=
IWICBitmapDecoderInfo_CreateInstance
(
decoderinfo
,
&
decoder
);
IWICBitmapDecoder
*
new_decoder
;
res
=
IWICBitmapDecoderInfo_CreateInstance
(
decoderinfo
,
&
new_decoder
);
/* FIXME: should use QueryCapability to choose a decoder */
if
(
SUCCEEDED
(
res
))
{
res
=
IWICBitmapDecoder_Initialize
(
decoder
,
pIStream
,
metadataOptions
);
res
=
IWICBitmapDecoder_Initialize
(
new_
decoder
,
pIStream
,
metadataOptions
);
if
(
FAIL
ED
(
res
))
if
(
SUCCEED
ED
(
res
))
{
IWICBitmapDecoder_Release
(
decoder
);
decoder
=
NULL
;
if
(
pguidVendor
)
{
res
=
IWICBitmapDecoderInfo_GetVendorGUID
(
decoderinfo
,
&
vendor
);
if
(
SUCCEEDED
(
res
)
&&
IsEqualIID
(
&
vendor
,
pguidVendor
))
{
preferred_decoder
=
new_decoder
;
new_decoder
=
NULL
;
}
}
if
(
new_decoder
&&
!
decoder
)
{
decoder
=
new_decoder
;
new_decoder
=
NULL
;
}
}
if
(
new_decoder
)
IWICBitmapDecoder_Release
(
new_decoder
);
}
}
...
...
@@ -181,6 +195,13 @@ static HRESULT WINAPI ImagingFactory_CreateDecoderFromStream(
IEnumUnknown_Release
(
enumdecoders
);
if
(
preferred_decoder
)
{
*
ppIDecoder
=
preferred_decoder
;
if
(
decoder
)
IWICBitmapDecoder_Release
(
decoder
);
return
S_OK
;
}
if
(
decoder
)
{
*
ppIDecoder
=
decoder
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment