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
16d44b61
Commit
16d44b61
authored
Jul 15, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/topoloader: Clone source nodes as a first layer of resulting topology.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8e343024
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
4 deletions
+57
-4
topology.c
dlls/mf/topology.c
+57
-4
No files found.
dlls/mf/topology.c
View file @
16d44b61
...
@@ -1933,9 +1933,40 @@ static ULONG WINAPI topology_loader_Release(IMFTopoLoader *iface)
...
@@ -1933,9 +1933,40 @@ static ULONG WINAPI topology_loader_Release(IMFTopoLoader *iface)
return
refcount
;
return
refcount
;
}
}
struct
topoloader_context
{
IMFTopology
*
output_topology
;
GUID
key
;
};
static
HRESULT
topology_loader_clone_node
(
struct
topoloader_context
*
context
,
IMFTopologyNode
*
node
,
unsigned
int
marker
)
{
IMFTopologyNode
*
cloned_node
;
MF_TOPOLOGY_TYPE
node_type
;
HRESULT
hr
;
IMFTopologyNode_GetNodeType
(
node
,
&
node_type
);
if
(
FAILED
(
hr
=
MFCreateTopologyNode
(
node_type
,
&
cloned_node
)))
return
hr
;
if
(
SUCCEEDED
(
hr
=
IMFTopologyNode_CloneFrom
(
cloned_node
,
node
)))
hr
=
IMFTopologyNode_SetUINT32
(
cloned_node
,
&
context
->
key
,
marker
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMFTopology_AddNode
(
context
->
output_topology
,
cloned_node
);
IMFTopologyNode_Release
(
cloned_node
);
return
hr
;
}
static
HRESULT
WINAPI
topology_loader_Load
(
IMFTopoLoader
*
iface
,
IMFTopology
*
input_topology
,
static
HRESULT
WINAPI
topology_loader_Load
(
IMFTopoLoader
*
iface
,
IMFTopology
*
input_topology
,
IMFTopology
**
outpu
t_topology
,
IMFTopology
*
current_topology
)
IMFTopology
**
re
t_topology
,
IMFTopology
*
current_topology
)
{
{
struct
topoloader_context
context
=
{
0
};
IMFTopology
*
output_topology
;
MF_TOPOLOGY_TYPE
node_type
;
MF_TOPOLOGY_TYPE
node_type
;
IMFTopologyNode
*
node
;
IMFTopologyNode
*
node
;
unsigned
short
i
=
0
;
unsigned
short
i
=
0
;
...
@@ -1943,7 +1974,7 @@ static HRESULT WINAPI topology_loader_Load(IMFTopoLoader *iface, IMFTopology *in
...
@@ -1943,7 +1974,7 @@ static HRESULT WINAPI topology_loader_Load(IMFTopoLoader *iface, IMFTopology *in
IUnknown
*
object
;
IUnknown
*
object
;
HRESULT
hr
=
E_FAIL
;
HRESULT
hr
=
E_FAIL
;
FIXME
(
"%p, %p, %p, %p.
\n
"
,
iface
,
input_topology
,
outpu
t_topology
,
current_topology
);
FIXME
(
"%p, %p, %p, %p.
\n
"
,
iface
,
input_topology
,
re
t_topology
,
current_topology
);
if
(
current_topology
)
if
(
current_topology
)
FIXME
(
"Current topology instance is ignored.
\n
"
);
FIXME
(
"Current topology instance is ignored.
\n
"
);
...
@@ -1982,10 +2013,32 @@ static HRESULT WINAPI topology_loader_Load(IMFTopoLoader *iface, IMFTopology *in
...
@@ -1982,10 +2013,32 @@ static HRESULT WINAPI topology_loader_Load(IMFTopoLoader *iface, IMFTopology *in
return
hr
;
return
hr
;
}
}
if
(
FAILED
(
hr
=
MFCreateTopology
(
output_topology
)))
if
(
FAILED
(
hr
=
MFCreateTopology
(
&
output_topology
)))
return
hr
;
return
hr
;
return
IMFTopology_CloneFrom
(
*
output_topology
,
input_topology
);
context
.
output_topology
=
output_topology
;
memset
(
&
context
.
key
,
0xff
,
sizeof
(
context
.
key
));
/* Clone source nodes, use initial marker value. */
i
=
0
;
while
(
SUCCEEDED
(
IMFTopology_GetNode
(
input_topology
,
i
++
,
&
node
)))
{
IMFTopologyNode_GetNodeType
(
node
,
&
node_type
);
if
(
node_type
==
MF_TOPOLOGY_SOURCESTREAM_NODE
)
{
if
(
FAILED
(
hr
=
topology_loader_clone_node
(
&
context
,
node
,
0
)))
WARN
(
"Failed to clone source node, hr %#x.
\n
"
,
hr
);
}
IMFTopologyNode_Release
(
node
);
}
/* For now return original topology. */
*
ret_topology
=
output_topology
;
return
IMFTopology_CloneFrom
(
output_topology
,
input_topology
);
}
}
static
const
IMFTopoLoaderVtbl
topologyloadervtbl
=
static
const
IMFTopoLoaderVtbl
topologyloadervtbl
=
...
...
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