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
c1c77f22
Commit
c1c77f22
authored
Oct 08, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Copy preferred types when cloning nodes.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
34c52b94
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
0 deletions
+91
-0
mf.c
dlls/mf/tests/mf.c
+65
-0
topology.c
dlls/mf/topology.c
+26
-0
No files found.
dlls/mf/tests/mf.c
View file @
c1c77f22
...
...
@@ -656,6 +656,71 @@ static void test_topology(void)
IMFTopologyNode_Release
(
node
);
IMFTopologyNode_Release
(
node2
);
/* Cloning nodes of different types. */
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_SOURCESTREAM_NODE
,
&
node
);
ok
(
hr
==
S_OK
,
"Failed to create topology node, hr %#x.
\n
"
,
hr
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_OUTPUT_NODE
,
&
node2
);
ok
(
hr
==
S_OK
,
"Failed to create topology node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyNode_CloneFrom
(
node
,
node2
);
ok
(
hr
==
MF_E_INVALIDREQUEST
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFTopologyNode_Release
(
node2
);
/* Cloning preferred types. */
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_SOURCESTREAM_NODE
,
&
node2
);
ok
(
hr
==
S_OK
,
"Failed to create topology node, hr %#x.
\n
"
,
hr
);
hr
=
MFCreateMediaType
(
&
mediatype
);
ok
(
hr
==
S_OK
,
"Failed to create media type, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyNode_SetOutputPrefType
(
node2
,
0
,
mediatype
);
ok
(
hr
==
S_OK
,
"Failed to set preferred type, hr %#x.
\n
"
,
hr
);
/* Vista checks for additional attributes. */
hr
=
IMFTopologyNode_CloneFrom
(
node
,
node2
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
MF_E_ATTRIBUTENOTFOUND
)
/* Vista */
,
"Failed to clone a node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyNode_GetOutputPrefType
(
node
,
0
,
&
mediatype2
);
ok
(
hr
==
S_OK
,
"Failed to get preferred type, hr %#x.
\n
"
,
hr
);
ok
(
mediatype
==
mediatype2
,
"Unexpected media type.
\n
"
);
IMFMediaType_Release
(
mediatype2
);
IMFMediaType_Release
(
mediatype
);
IMFTopologyNode_Release
(
node2
);
/* Existing preferred types are not cleared. */
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_SOURCESTREAM_NODE
,
&
node2
);
ok
(
hr
==
S_OK
,
"Failed to create topology node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyNode_GetOutputCount
(
node
,
&
count
);
ok
(
hr
==
S_OK
,
"Failed to get output count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Unexpected output count.
\n
"
);
hr
=
IMFTopologyNode_CloneFrom
(
node
,
node2
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
MF_E_ATTRIBUTENOTFOUND
)
/* Vista */
,
"Failed to clone a node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyNode_GetOutputCount
(
node
,
&
count
);
ok
(
hr
==
S_OK
,
"Failed to get output count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Unexpected output count.
\n
"
);
hr
=
IMFTopologyNode_GetOutputPrefType
(
node
,
0
,
&
mediatype2
);
ok
(
hr
==
S_OK
,
"Failed to get preferred type, hr %#x.
\n
"
,
hr
);
ok
(
!!
mediatype2
,
"Unexpected media type.
\n
"
);
IMFMediaType_Release
(
mediatype2
);
hr
=
IMFTopologyNode_CloneFrom
(
node2
,
node
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
MF_E_ATTRIBUTENOTFOUND
)
/* Vista */
,
"Failed to clone a node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyNode_GetOutputCount
(
node2
,
&
count
);
ok
(
hr
==
S_OK
,
"Failed to get output count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Unexpected output count.
\n
"
);
IMFTopologyNode_Release
(
node2
);
IMFTopologyNode_Release
(
node
);
IMFTopology_Release
(
topology
);
}
...
...
dlls/mf/topology.c
View file @
c1c77f22
...
...
@@ -1628,7 +1628,9 @@ static HRESULT WINAPI topology_node_CloneFrom(IMFTopologyNode *iface, IMFTopolog
{
struct
topology_node
*
node
=
impl_from_IMFTopologyNode
(
iface
);
MF_TOPOLOGY_TYPE
node_type
;
IMFMediaType
*
mediatype
;
IUnknown
*
object
;
DWORD
count
,
i
;
TOPOID
topoid
;
HRESULT
hr
;
...
...
@@ -1656,6 +1658,30 @@ static HRESULT WINAPI topology_node_CloneFrom(IMFTopologyNode *iface, IMFTopolog
if
(
SUCCEEDED
(
hr
))
node
->
id
=
topoid
;
if
(
SUCCEEDED
(
IMFTopologyNode_GetInputCount
(
src_node
,
&
count
)))
{
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
SUCCEEDED
(
IMFTopologyNode_GetInputPrefType
(
src_node
,
i
,
&
mediatype
)))
{
IMFTopologyNode_SetInputPrefType
(
iface
,
i
,
mediatype
);
IMFMediaType_Release
(
mediatype
);
}
}
}
if
(
SUCCEEDED
(
IMFTopologyNode_GetOutputCount
(
src_node
,
&
count
)))
{
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
SUCCEEDED
(
IMFTopologyNode_GetOutputPrefType
(
src_node
,
i
,
&
mediatype
)))
{
IMFTopologyNode_SetOutputPrefType
(
iface
,
i
,
mediatype
);
IMFMediaType_Release
(
mediatype
);
}
}
}
LeaveCriticalSection
(
&
node
->
cs
);
if
(
object
)
...
...
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