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
609b9a4d
Commit
609b9a4d
authored
Sep 18, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Create global metadata readers from GIF decoder data.
parent
47864728
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
10 deletions
+32
-10
gifformat.c
dlls/windowscodecs/gifformat.c
+32
-6
metadata.c
dlls/windowscodecs/tests/metadata.c
+0
-4
No files found.
dlls/windowscodecs/gifformat.c
View file @
609b9a4d
...
...
@@ -1285,15 +1285,18 @@ static HRESULT WINAPI GifDecoder_Block_GetContainerFormat(IWICMetadataBlockReade
static
HRESULT
WINAPI
GifDecoder_Block_GetCount
(
IWICMetadataBlockReader
*
iface
,
UINT
*
count
)
{
GifDecoder
*
This
=
impl_from_IWICMetadataBlockReader
(
iface
);
TRACE
(
"%p,%p
\n
"
,
iface
,
count
);
if
(
!
count
)
return
E_INVALIDARG
;
*
count
=
1
;
*
count
=
This
->
gif
->
Extensions
.
ExtensionBlockCount
+
1
;
return
S_OK
;
}
static
HRESULT
create_LSD_metadata_reader
(
GifDecoder
*
This
,
IWICMetadataReader
**
reader
)
static
HRESULT
create_metadata_reader
(
const
void
*
data
,
int
data_size
,
const
CLSID
*
clsid
,
IWICMetadataReader
**
reader
)
{
HRESULT
hr
;
IWICMetadataReader
*
metadata_reader
;
...
...
@@ -1302,7 +1305,7 @@ static HRESULT create_LSD_metadata_reader(GifDecoder *This, IWICMetadataReader *
/* FIXME: Use IWICComponentFactory_CreateMetadataReader once it's implemented */
hr
=
CoCreateInstance
(
&
CLSID_WICLSDMetadataReader
,
NULL
,
CLSCTX_INPROC_SERVER
,
hr
=
CoCreateInstance
(
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICMetadataReader
,
(
void
**
)
&
metadata_reader
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -1313,7 +1316,7 @@ static HRESULT create_LSD_metadata_reader(GifDecoder *This, IWICMetadataReader *
return
hr
;
}
stream
=
create_stream
(
This
->
LSD_data
,
sizeof
(
This
->
LSD_data
)
);
stream
=
create_stream
(
data
,
data_size
);
IWICPersistStream_LoadEx
(
persist
,
stream
,
NULL
,
WICPersistOptionsDefault
);
IStream_Release
(
stream
);
...
...
@@ -1327,12 +1330,35 @@ static HRESULT WINAPI GifDecoder_Block_GetReaderByIndex(IWICMetadataBlockReader
UINT
index
,
IWICMetadataReader
**
reader
)
{
GifDecoder
*
This
=
impl_from_IWICMetadataBlockReader
(
iface
);
int
i
;
TRACE
(
"(%p,%u,%p)
\n
"
,
iface
,
index
,
reader
);
if
(
!
reader
||
index
!=
0
)
return
E_INVALIDARG
;
if
(
!
reader
)
return
E_INVALIDARG
;
if
(
index
==
0
)
return
create_metadata_reader
(
&
This
->
LSD_data
,
sizeof
(
This
->
LSD_data
),
&
CLSID_WICLSDMetadataReader
,
reader
);
for
(
i
=
0
;
i
<
This
->
gif
->
Extensions
.
ExtensionBlockCount
;
i
++
)
{
const
CLSID
*
clsid
;
if
(
index
!=
i
+
1
)
continue
;
if
(
This
->
gif
->
Extensions
.
ExtensionBlocks
[
i
].
Function
==
APPLICATION_EXT_FUNC_CODE
)
clsid
=
&
CLSID_WICAPEMetadataReader
;
else
if
(
This
->
gif
->
Extensions
.
ExtensionBlocks
[
i
].
Function
==
COMMENT_EXT_FUNC_CODE
)
clsid
=
&
CLSID_WICGifCommentMetadataReader
;
else
clsid
=
&
CLSID_WICUnknownMetadataReader
;
return
create_LSD_metadata_reader
(
This
,
reader
);
return
create_metadata_reader
(
This
->
gif
->
Extensions
.
ExtensionBlocks
[
i
].
Bytes
,
This
->
gif
->
Extensions
.
ExtensionBlocks
[
i
].
ByteCount
,
clsid
,
reader
);
}
return
E_INVALIDARG
;
}
static
HRESULT
WINAPI
GifDecoder_Block_GetEnumerator
(
IWICMetadataBlockReader
*
iface
,
...
...
dlls/windowscodecs/tests/metadata.c
View file @
609b9a4d
...
...
@@ -1204,7 +1204,6 @@ static void test_metadata_gif(void)
hr
=
IWICMetadataBlockReader_GetCount
(
blockreader
,
&
count
);
ok
(
hr
==
S_OK
,
"GetCount error %#x
\n
"
,
hr
);
todo_wine
ok
(
count
==
4
,
"expected 4, got %u
\n
"
,
count
);
hr
=
IWICMetadataBlockReader_GetReaderByIndex
(
blockreader
,
0
,
&
reader
);
...
...
@@ -1226,7 +1225,6 @@ todo_wine
}
hr
=
IWICMetadataBlockReader_GetReaderByIndex
(
blockreader
,
1
,
&
reader
);
todo_wine
ok
(
hr
==
S_OK
,
"GetReaderByIndex error %#x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
...
...
@@ -1245,7 +1243,6 @@ todo_wine
}
hr
=
IWICMetadataBlockReader_GetReaderByIndex
(
blockreader
,
2
,
&
reader
);
todo_wine
ok
(
hr
==
S_OK
,
"GetReaderByIndex error %#x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
...
...
@@ -1264,7 +1261,6 @@ todo_wine
}
hr
=
IWICMetadataBlockReader_GetReaderByIndex
(
blockreader
,
3
,
&
reader
);
todo_wine
ok
(
hr
==
S_OK
,
"GetReaderByIndex error %#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