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
664f1c47
Commit
664f1c47
authored
Sep 13, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Create Graphic Control Extension metadata block for a GIF frame.
parent
003c2046
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
5 deletions
+67
-5
gifformat.c
dlls/windowscodecs/gifformat.c
+67
-3
metadata.c
dlls/windowscodecs/tests/metadata.c
+0
-2
No files found.
dlls/windowscodecs/gifformat.c
View file @
664f1c47
...
...
@@ -646,14 +646,30 @@ static HRESULT WINAPI GifFrameDecode_Block_GetContainerFormat(IWICMetadataBlockR
return
S_OK
;
}
static
const
void
*
get_GCE_data
(
GifFrameDecode
*
This
)
{
int
i
;
for
(
i
=
0
;
i
<
This
->
frame
->
ExtensionBlockCount
;
i
++
)
{
if
(
This
->
frame
->
ExtensionBlocks
[
i
].
Function
==
GRAPHICS_EXT_FUNC_CODE
&&
This
->
frame
->
ExtensionBlocks
[
i
].
ByteCount
==
4
)
return
This
->
frame
->
ExtensionBlocks
[
i
].
Bytes
;
}
return
NULL
;
}
static
HRESULT
WINAPI
GifFrameDecode_Block_GetCount
(
IWICMetadataBlockReader
*
iface
,
UINT
*
count
)
{
GifFrameDecode
*
This
=
frame_from_IWICMetadataBlockReader
(
iface
);
TRACE
(
"%p,%p
\n
"
,
iface
,
count
);
if
(
!
count
)
return
E_INVALIDARG
;
*
count
=
1
;
if
(
get_GCE_data
(
This
))
*
count
+=
1
;
return
S_OK
;
}
...
...
@@ -705,16 +721,64 @@ static HRESULT create_IMD_metadata_reader(GifFrameDecode *This, IWICMetadataRead
return
S_OK
;
}
static
HRESULT
create_GCE_metadata_reader
(
const
void
*
GCE_data
,
IWICMetadataReader
**
reader
)
{
HRESULT
hr
;
IWICMetadataReader
*
metadata_reader
;
IWICPersistStream
*
persist
;
IStream
*
stream
;
/* FIXME: Use IWICComponentFactory_CreateMetadataReader once it's implemented */
hr
=
CoCreateInstance
(
&
CLSID_WICGCEMetadataReader
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICMetadataReader
,
(
void
**
)
&
metadata_reader
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IWICMetadataReader_QueryInterface
(
metadata_reader
,
&
IID_IWICPersistStream
,
(
void
**
)
&
persist
);
if
(
FAILED
(
hr
))
{
IWICMetadataReader_Release
(
metadata_reader
);
return
hr
;
}
stream
=
create_stream
(
GCE_data
,
4
);
IWICPersistStream_LoadEx
(
persist
,
stream
,
NULL
,
WICPersistOptionsDefault
);
IStream_Release
(
stream
);
IWICPersistStream_Release
(
persist
);
*
reader
=
metadata_reader
;
return
S_OK
;
}
static
HRESULT
WINAPI
GifFrameDecode_Block_GetReaderByIndex
(
IWICMetadataBlockReader
*
iface
,
UINT
index
,
IWICMetadataReader
**
reader
)
{
GifFrameDecode
*
This
=
frame_from_IWICMetadataBlockReader
(
iface
);
UINT
block_count
=
1
;
const
void
*
GCE_data
;
TRACE
(
"(%p,%u,%p)
\n
"
,
iface
,
index
,
reader
);
if
(
!
reader
||
index
!=
0
)
return
E_INVALIDARG
;
return
create_IMD_metadata_reader
(
This
,
reader
);
GCE_data
=
get_GCE_data
(
This
);
if
(
GCE_data
)
block_count
++
;
/* FIXME: add support for Application Extension metadata block
APE_data = get_APE_data(This);
if (APE_data) block_count++;
*/
if
(
!
reader
||
index
>=
block_count
)
return
E_INVALIDARG
;
if
(
index
==
0
)
return
create_IMD_metadata_reader
(
This
,
reader
);
if
(
index
==
1
&&
GCE_data
)
return
create_GCE_metadata_reader
(
GCE_data
,
reader
);
/* FIXME: add support for Application Extension metadata block
if (APE_data)
return create_APE_metadata_reader(APE_data, reader);
*/
return
E_INVALIDARG
;
}
static
HRESULT
WINAPI
GifFrameDecode_Block_GetEnumerator
(
IWICMetadataBlockReader
*
iface
,
...
...
dlls/windowscodecs/tests/metadata.c
View file @
664f1c47
...
...
@@ -1206,7 +1206,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
==
2
,
"expected 2, got %u
\n
"
,
count
);
hr
=
IWICMetadataBlockReader_GetReaderByIndex
(
blockreader
,
0
,
&
reader
);
...
...
@@ -1228,7 +1227,6 @@ todo_wine
}
hr
=
IWICMetadataBlockReader_GetReaderByIndex
(
blockreader
,
1
,
&
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