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
b474b913
Commit
b474b913
authored
Feb 25, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Add support for source and output collections.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5dcb3296
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
161 additions
and
4 deletions
+161
-4
mf.c
dlls/mf/tests/mf.c
+110
-0
topology.c
dlls/mf/topology.c
+51
-4
No files found.
dlls/mf/tests/mf.c
View file @
b474b913
...
...
@@ -35,8 +35,10 @@
static
void
test_topology
(
void
)
{
IMFCollection
*
collection
,
*
collection2
;
IMFTopologyNode
*
node
,
*
node2
,
*
node3
;
IMFTopology
*
topology
;
DWORD
size
;
WORD
count
;
HRESULT
hr
;
TOPOID
id
;
...
...
@@ -192,6 +194,114 @@ static void test_topology(void)
IMFTopologyNode_Release
(
node
);
IMFTopologyNode_Release
(
node2
);
/* Source/output collections. */
hr
=
IMFTopology_Clear
(
topology
);
ok
(
hr
==
S_OK
,
"Failed to clear topology, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_GetSourceNodeCollection
(
topology
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_GetSourceNodeCollection
(
topology
,
&
collection
);
ok
(
hr
==
S_OK
,
"Failed to get source node collection, hr %#x.
\n
"
,
hr
);
ok
(
!!
collection
,
"Unexpected object pointer.
\n
"
);
hr
=
IMFTopology_GetSourceNodeCollection
(
topology
,
&
collection2
);
ok
(
hr
==
S_OK
,
"Failed to get source node collection, hr %#x.
\n
"
,
hr
);
ok
(
!!
collection2
,
"Unexpected object pointer.
\n
"
);
ok
(
collection2
!=
collection
,
"Expected cloned collection.
\n
"
);
hr
=
IMFCollection_GetElementCount
(
collection
,
&
size
);
ok
(
hr
==
S_OK
,
"Failed to get item count, hr %#x.
\n
"
,
hr
);
ok
(
!
size
,
"Unexpected item count.
\n
"
);
hr
=
IMFCollection_AddElement
(
collection
,
(
IUnknown
*
)
collection
);
ok
(
hr
==
S_OK
,
"Failed to add element, hr %#x.
\n
"
,
hr
);
hr
=
IMFCollection_GetElementCount
(
collection
,
&
size
);
ok
(
hr
==
S_OK
,
"Failed to get item count, hr %#x.
\n
"
,
hr
);
ok
(
size
==
1
,
"Unexpected item count.
\n
"
);
hr
=
IMFCollection_GetElementCount
(
collection2
,
&
size
);
ok
(
hr
==
S_OK
,
"Failed to get item count, hr %#x.
\n
"
,
hr
);
ok
(
!
size
,
"Unexpected item count.
\n
"
);
IMFCollection_Release
(
collection2
);
IMFCollection_Release
(
collection
);
/* Add some nodes. */
hr
=
IMFTopology_GetSourceNodeCollection
(
topology
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_GetOutputNodeCollection
(
topology
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_SOURCESTREAM_NODE
,
&
node
);
ok
(
hr
==
S_OK
,
"Failed to create a node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_AddNode
(
topology
,
node
);
ok
(
hr
==
S_OK
,
"Failed to add a node, hr %#x.
\n
"
,
hr
);
IMFTopologyNode_Release
(
node
);
hr
=
IMFTopology_GetSourceNodeCollection
(
topology
,
&
collection
);
ok
(
hr
==
S_OK
,
"Failed to get source node collection, hr %#x.
\n
"
,
hr
);
ok
(
!!
collection
,
"Unexpected object pointer.
\n
"
);
hr
=
IMFCollection_GetElementCount
(
collection
,
&
size
);
ok
(
hr
==
S_OK
,
"Failed to get item count, hr %#x.
\n
"
,
hr
);
ok
(
size
==
1
,
"Unexpected item count.
\n
"
);
IMFCollection_Release
(
collection
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_TEE_NODE
,
&
node
);
ok
(
hr
==
S_OK
,
"Failed to create a node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_AddNode
(
topology
,
node
);
ok
(
hr
==
S_OK
,
"Failed to add a node, hr %#x.
\n
"
,
hr
);
IMFTopologyNode_Release
(
node
);
hr
=
IMFTopology_GetSourceNodeCollection
(
topology
,
&
collection
);
ok
(
hr
==
S_OK
,
"Failed to get source node collection, hr %#x.
\n
"
,
hr
);
ok
(
!!
collection
,
"Unexpected object pointer.
\n
"
);
hr
=
IMFCollection_GetElementCount
(
collection
,
&
size
);
ok
(
hr
==
S_OK
,
"Failed to get item count, hr %#x.
\n
"
,
hr
);
ok
(
size
==
1
,
"Unexpected item count.
\n
"
);
IMFCollection_Release
(
collection
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_TRANSFORM_NODE
,
&
node
);
ok
(
hr
==
S_OK
,
"Failed to create a node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_AddNode
(
topology
,
node
);
ok
(
hr
==
S_OK
,
"Failed to add a node, hr %#x.
\n
"
,
hr
);
IMFTopologyNode_Release
(
node
);
hr
=
IMFTopology_GetSourceNodeCollection
(
topology
,
&
collection
);
ok
(
hr
==
S_OK
,
"Failed to get source node collection, hr %#x.
\n
"
,
hr
);
ok
(
!!
collection
,
"Unexpected object pointer.
\n
"
);
hr
=
IMFCollection_GetElementCount
(
collection
,
&
size
);
ok
(
hr
==
S_OK
,
"Failed to get item count, hr %#x.
\n
"
,
hr
);
ok
(
size
==
1
,
"Unexpected item count.
\n
"
);
IMFCollection_Release
(
collection
);
hr
=
IMFTopology_GetOutputNodeCollection
(
topology
,
&
collection
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_FAIL
)
/* before Win8 */
,
"Failed to get source node collection, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
!!
collection
,
"Unexpected object pointer.
\n
"
);
hr
=
IMFCollection_GetElementCount
(
collection
,
&
size
);
ok
(
hr
==
S_OK
,
"Failed to get item count, hr %#x.
\n
"
,
hr
);
ok
(
!
size
,
"Unexpected item count.
\n
"
);
IMFCollection_Release
(
collection
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_OUTPUT_NODE
,
&
node
);
ok
(
hr
==
S_OK
,
"Failed to create a node, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_AddNode
(
topology
,
node
);
ok
(
hr
==
S_OK
,
"Failed to add a node, hr %#x.
\n
"
,
hr
);
IMFTopologyNode_Release
(
node
);
hr
=
IMFTopology_GetOutputNodeCollection
(
topology
,
&
collection
);
ok
(
hr
==
S_OK
,
"Failed to get source node collection, hr %#x.
\n
"
,
hr
);
ok
(
!!
collection
,
"Unexpected object pointer.
\n
"
);
hr
=
IMFCollection_GetElementCount
(
collection
,
&
size
);
ok
(
hr
==
S_OK
,
"Failed to get item count, hr %#x.
\n
"
,
hr
);
ok
(
size
==
1
,
"Unexpected item count.
\n
"
);
IMFCollection_Release
(
collection
);
}
IMFTopology_Release
(
topology
);
}
...
...
dlls/mf/topology.c
View file @
b474b913
...
...
@@ -535,18 +535,65 @@ static HRESULT WINAPI topology_GetNodeByID(IMFTopology *iface, TOPOID id, IMFTop
return
topology_get_node_by_id
(
topology
,
id
,
node
);
}
static
HRESULT
topology_add_node_of_type
(
const
struct
topology
*
topology
,
IMFTopologyNode
*
node
,
MF_TOPOLOGY_TYPE
filter
,
IMFCollection
*
collection
)
{
MF_TOPOLOGY_TYPE
node_type
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
IMFTopologyNode_GetNodeType
(
node
,
&
node_type
)))
return
hr
;
if
(
node_type
!=
filter
)
return
S_OK
;
return
IMFCollection_AddElement
(
collection
,
(
IUnknown
*
)
node
);
}
static
HRESULT
topology_get_node_collection
(
const
struct
topology
*
topology
,
MF_TOPOLOGY_TYPE
node_type
,
IMFCollection
**
collection
)
{
IMFTopologyNode
*
node
;
unsigned
int
i
=
0
;
HRESULT
hr
;
if
(
!
collection
)
return
E_POINTER
;
if
(
FAILED
(
hr
=
MFCreateCollection
(
collection
)))
return
hr
;
while
(
IMFCollection_GetElement
(
topology
->
nodes
,
i
++
,
(
IUnknown
**
)
&
node
)
==
S_OK
)
{
hr
=
topology_add_node_of_type
(
topology
,
node
,
node_type
,
*
collection
);
IMFTopologyNode_Release
(
node
);
if
(
FAILED
(
hr
))
{
IMFCollection_Release
(
*
collection
);
*
collection
=
NULL
;
break
;
}
}
return
hr
;
}
static
HRESULT
WINAPI
topology_GetSourceNodeCollection
(
IMFTopology
*
iface
,
IMFCollection
**
collection
)
{
FIXME
(
"(%p)->(%p)
\n
"
,
iface
,
collection
);
struct
topology
*
topology
=
impl_from_IMFTopology
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
collection
);
return
topology_get_node_collection
(
topology
,
MF_TOPOLOGY_SOURCESTREAM_NODE
,
collection
);
}
static
HRESULT
WINAPI
topology_GetOutputNodeCollection
(
IMFTopology
*
iface
,
IMFCollection
**
collection
)
{
FIXME
(
"(%p)->(%p)
\n
"
,
iface
,
collection
);
struct
topology
*
topology
=
impl_from_IMFTopology
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
collection
);
return
topology_get_node_collection
(
topology
,
MF_TOPOLOGY_OUTPUT_NODE
,
collection
);
}
static
const
IMFTopologyVtbl
topologyvtbl
=
...
...
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