Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1dee3734
Commit
1dee3734
authored
Nov 12, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement ComponentFactory_CreateMetadataReaderFromContainer.
parent
8d96b22d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
11 deletions
+115
-11
imgfactory.c
dlls/windowscodecs/imgfactory.c
+99
-2
metadata.c
dlls/windowscodecs/tests/metadata.c
+16
-9
No files found.
dlls/windowscodecs/imgfactory.c
View file @
1dee3734
...
...
@@ -956,9 +956,106 @@ static HRESULT WINAPI ComponentFactory_CreateMetadataReader(IWICComponentFactory
static
HRESULT
WINAPI
ComponentFactory_CreateMetadataReaderFromContainer
(
IWICComponentFactory
*
iface
,
REFGUID
format
,
const
GUID
*
vendor
,
DWORD
options
,
IStream
*
stream
,
IWICMetadataReader
**
reader
)
{
FIXME
(
"%p,%s,%s,%x,%p,%p: stub
\n
"
,
iface
,
debugstr_guid
(
format
),
debugstr_guid
(
vendor
),
HRESULT
hr
;
IEnumUnknown
*
enumreaders
;
IUnknown
*
unkreaderinfo
;
IWICMetadataReaderInfo
*
readerinfo
;
IWICPersistStream
*
wicpersiststream
;
ULONG
num_fetched
;
GUID
decoder_vendor
;
BOOL
matches
;
LARGE_INTEGER
zero
;
TRACE
(
"%p,%s,%s,%x,%p,%p
\n
"
,
iface
,
debugstr_guid
(
format
),
debugstr_guid
(
vendor
),
options
,
stream
,
reader
);
return
E_NOTIMPL
;
if
(
!
format
||
!
stream
||
!
reader
)
return
E_INVALIDARG
;
zero
.
QuadPart
=
0
;
hr
=
CreateComponentEnumerator
(
WICMetadataReader
,
WICComponentEnumerateDefault
,
&
enumreaders
);
if
(
FAILED
(
hr
))
return
hr
;
*
reader
=
NULL
;
start:
while
(
!*
reader
)
{
hr
=
IEnumUnknown_Next
(
enumreaders
,
1
,
&
unkreaderinfo
,
&
num_fetched
);
if
(
hr
==
S_OK
)
{
hr
=
IUnknown_QueryInterface
(
unkreaderinfo
,
&
IID_IWICMetadataReaderInfo
,
(
void
**
)
&
readerinfo
);
if
(
SUCCEEDED
(
hr
))
{
if
(
vendor
)
{
hr
=
IWICMetadataReaderInfo_GetVendorGUID
(
readerinfo
,
&
decoder_vendor
);
if
(
FAILED
(
hr
)
||
!
IsEqualIID
(
vendor
,
&
decoder_vendor
))
{
IWICMetadataReaderInfo_Release
(
readerinfo
);
IUnknown_Release
(
unkreaderinfo
);
continue
;
}
}
hr
=
IWICMetadataReaderInfo_MatchesPattern
(
readerinfo
,
format
,
stream
,
&
matches
);
if
(
SUCCEEDED
(
hr
)
&&
matches
)
{
hr
=
IStream_Seek
(
stream
,
zero
,
STREAM_SEEK_SET
,
NULL
);
if
(
SUCCEEDED
(
hr
))
hr
=
IWICMetadataReaderInfo_CreateInstance
(
readerinfo
,
reader
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICMetadataReader_QueryInterface
(
*
reader
,
&
IID_IWICPersistStream
,
(
void
**
)
&
wicpersiststream
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICPersistStream_LoadEx
(
wicpersiststream
,
stream
,
vendor
,
options
&
WICPersistOptionsMask
);
IWICPersistStream_Release
(
wicpersiststream
);
}
if
(
FAILED
(
hr
))
{
IWICMetadataReader_Release
(
*
reader
);
*
reader
=
NULL
;
}
}
}
IUnknown_Release
(
readerinfo
);
}
IUnknown_Release
(
unkreaderinfo
);
}
else
break
;
}
if
(
!*
reader
&&
vendor
)
{
vendor
=
NULL
;
IEnumUnknown_Reset
(
enumreaders
);
goto
start
;
}
IEnumUnknown_Release
(
enumreaders
);
if
(
!*
reader
&&
!
(
options
&
WICMetadataCreationFailUnknown
))
FIXME
(
"create unknown metadata reader
\n
"
);
if
(
*
reader
)
return
S_OK
;
else
return
WINCODEC_ERR_COMPONENTNOTFOUND
;
}
static
HRESULT
WINAPI
ComponentFactory_CreateMetadataWriter
(
IWICComponentFactory
*
iface
,
...
...
dlls/windowscodecs/tests/metadata.c
View file @
1dee3734
...
...
@@ -841,17 +841,24 @@ static void test_create_reader(void)
stream
=
create_stream
(
metadata_tEXt
,
sizeof
(
metadata_tEXt
));
hr
=
IWICComponentFactory_CreateMetadataReaderFromContainer
(
factory
,
NULL
,
NULL
,
WICPersistOptionsDefault
,
stream
,
&
reader
);
ok
(
hr
==
E_INVALIDARG
,
"CreateMetadataReaderFromContainer failed, hr=%x
\n
"
,
hr
);
hr
=
IWICComponentFactory_CreateMetadataReaderFromContainer
(
factory
,
&
GUID_ContainerFormatPng
,
NULL
,
WICPersistOptionsDefault
,
NULL
,
&
reader
);
ok
(
hr
==
E_INVALIDARG
,
"CreateMetadataReaderFromContainer failed, hr=%x
\n
"
,
hr
);
hr
=
IWICComponentFactory_CreateMetadataReaderFromContainer
(
factory
,
&
GUID_ContainerFormatPng
,
NULL
,
WICPersistOptionsDefault
,
stream
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"CreateMetadataReaderFromContainer failed, hr=%x
\n
"
,
hr
);
hr
=
IWICComponentFactory_CreateMetadataReaderFromContainer
(
factory
,
&
GUID_ContainerFormatPng
,
NULL
,
WICPersistOptionsDefault
,
stream
,
&
reader
);
todo_wine
ok
(
hr
==
S_OK
,
"CreateMetadataReaderFromContainer failed, hr=%x
\n
"
,
hr
);
/* NOTE: removed once Wine is fixed */
if
(
FAILED
(
hr
))
{
IStream_Release
(
stream
);
IWICComponentFactory_Release
(
factory
);
return
;
}
if
(
SUCCEEDED
(
hr
))
{
...
...
@@ -869,7 +876,7 @@ todo_wine
hr
=
IWICComponentFactory_CreateMetadataReaderFromContainer
(
factory
,
&
GUID_ContainerFormatWmp
,
NULL
,
WICPersistOptionsDefault
,
stream
,
&
reader
);
ok
(
hr
==
S_OK
,
"CreateMetadataReaderFromContainer failed, hr=%x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
S_OK
,
"CreateMetadataReaderFromContainer failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
...
...
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