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
5c43f517
Commit
5c43f517
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: Assign topology identifiers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
202e9592
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
4 deletions
+49
-4
mf.c
dlls/mf/tests/mf.c
+21
-2
topology.c
dlls/mf/topology.c
+28
-2
No files found.
dlls/mf/tests/mf.c
View file @
5c43f517
...
...
@@ -37,7 +37,7 @@ static void test_topology(void)
{
IMFCollection
*
collection
,
*
collection2
;
IMFTopologyNode
*
node
,
*
node2
,
*
node3
;
IMFTopology
*
topology
;
IMFTopology
*
topology
,
*
topology2
;
DWORD
size
;
WORD
count
;
HRESULT
hr
;
...
...
@@ -47,7 +47,26 @@ static void test_topology(void)
ok
(
hr
==
E_POINTER
,
"got %#x
\n
"
,
hr
);
hr
=
MFCreateTopology
(
&
topology
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create topology, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_GetTopologyID
(
topology
,
&
id
);
ok
(
hr
==
S_OK
,
"Failed to get id, hr %#x.
\n
"
,
hr
);
ok
(
id
==
1
,
"Unexpected id.
\n
"
);
hr
=
MFCreateTopology
(
&
topology2
);
ok
(
hr
==
S_OK
,
"Failed to create topology, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_GetTopologyID
(
topology2
,
&
id
);
ok
(
hr
==
S_OK
,
"Failed to get id, hr %#x.
\n
"
,
hr
);
ok
(
id
==
2
,
"Unexpected id.
\n
"
);
IMFTopology_Release
(
topology
);
hr
=
MFCreateTopology
(
&
topology
);
ok
(
hr
==
S_OK
,
"Failed to create topology, hr %#x.
\n
"
,
hr
);
hr
=
IMFTopology_GetTopologyID
(
topology
,
&
id
);
ok
(
hr
==
S_OK
,
"Failed to get id, hr %#x.
\n
"
,
hr
);
ok
(
id
==
3
,
"Unexpected id.
\n
"
);
IMFTopology_Release
(
topology2
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_OUTPUT_NODE
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
dlls/mf/topology.c
View file @
5c43f517
...
...
@@ -15,7 +15,9 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
...
...
@@ -34,6 +36,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
static
LONG
next_node_id
;
static
TOPOID
next_topology_id
;
struct
topology
{
...
...
@@ -41,6 +44,7 @@ struct topology
LONG
refcount
;
IMFAttributes
*
attributes
;
IMFCollection
*
nodes
;
TOPOID
id
;
};
struct
topology_node
...
...
@@ -412,9 +416,16 @@ static HRESULT WINAPI topology_CopyAllItems(IMFTopology *iface, IMFAttributes *d
static
HRESULT
WINAPI
topology_GetTopologyID
(
IMFTopology
*
iface
,
TOPOID
*
id
)
{
FIXME
(
"(%p)->(%p)
\n
"
,
iface
,
id
);
struct
topology
*
topology
=
impl_from_IMFTopology
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
id
);
if
(
!
id
)
return
E_POINTER
;
*
id
=
topology
->
id
;
return
S_OK
;
}
static
HRESULT
topology_get_node_by_id
(
const
struct
topology
*
topology
,
TOPOID
id
,
IMFTopologyNode
**
node
)
...
...
@@ -654,6 +665,19 @@ static const IMFTopologyVtbl topologyvtbl =
topology_GetOutputNodeCollection
,
};
static
TOPOID
topology_generate_id
(
void
)
{
TOPOID
old
;
do
{
old
=
next_topology_id
;
}
while
(
interlocked_cmpxchg64
((
LONG64
*
)
&
next_topology_id
,
old
+
1
,
old
)
!=
old
);
return
next_topology_id
;
}
/***********************************************************************
* MFCreateTopology (mf.@)
*/
...
...
@@ -684,6 +708,8 @@ HRESULT WINAPI MFCreateTopology(IMFTopology **topology)
return
hr
;
}
object
->
id
=
topology_generate_id
();
*
topology
=
&
object
->
IMFTopology_iface
;
return
S_OK
;
...
...
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