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
08088da4
Commit
08088da4
authored
Feb 01, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Implement NotifyTopology() for the standard quality manager.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
144dcc1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
2 deletions
+76
-2
session.c
dlls/mf/session.c
+27
-2
mf.c
dlls/mf/tests/mf.c
+49
-0
No files found.
dlls/mf/session.c
View file @
08088da4
...
@@ -331,6 +331,7 @@ struct quality_manager
...
@@ -331,6 +331,7 @@ struct quality_manager
IMFClockStateSink
IMFClockStateSink_iface
;
IMFClockStateSink
IMFClockStateSink_iface
;
LONG
refcount
;
LONG
refcount
;
IMFTopology
*
topology
;
IMFPresentationClock
*
clock
;
IMFPresentationClock
*
clock
;
unsigned
int
state
;
unsigned
int
state
;
CRITICAL_SECTION
cs
;
CRITICAL_SECTION
cs
;
...
@@ -4802,6 +4803,8 @@ static ULONG WINAPI standard_quality_manager_Release(IMFQualityManager *iface)
...
@@ -4802,6 +4803,8 @@ static ULONG WINAPI standard_quality_manager_Release(IMFQualityManager *iface)
{
{
if
(
manager
->
clock
)
if
(
manager
->
clock
)
IMFPresentationClock_Release
(
manager
->
clock
);
IMFPresentationClock_Release
(
manager
->
clock
);
if
(
manager
->
topology
)
IMFTopology_Release
(
manager
->
topology
);
DeleteCriticalSection
(
&
manager
->
cs
);
DeleteCriticalSection
(
&
manager
->
cs
);
heap_free
(
manager
);
heap_free
(
manager
);
}
}
...
@@ -4809,11 +4812,32 @@ static ULONG WINAPI standard_quality_manager_Release(IMFQualityManager *iface)
...
@@ -4809,11 +4812,32 @@ static ULONG WINAPI standard_quality_manager_Release(IMFQualityManager *iface)
return
refcount
;
return
refcount
;
}
}
static
void
standard_quality_manager_set_topology
(
struct
quality_manager
*
manager
,
IMFTopology
*
topology
)
{
if
(
manager
->
topology
)
IMFTopology_Release
(
manager
->
topology
);
manager
->
topology
=
topology
;
if
(
manager
->
topology
)
IMFTopology_AddRef
(
manager
->
topology
);
}
static
HRESULT
WINAPI
standard_quality_manager_NotifyTopology
(
IMFQualityManager
*
iface
,
IMFTopology
*
topology
)
static
HRESULT
WINAPI
standard_quality_manager_NotifyTopology
(
IMFQualityManager
*
iface
,
IMFTopology
*
topology
)
{
{
FIXME
(
"%p, %p stub.
\n
"
,
iface
,
topology
);
struct
quality_manager
*
manager
=
impl_from_IMFQualityManager
(
iface
);
HRESULT
hr
=
S_OK
;
return
S_OK
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
topology
);
EnterCriticalSection
(
&
manager
->
cs
);
if
(
manager
->
state
==
QUALITY_MANAGER_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
{
standard_quality_manager_set_topology
(
manager
,
topology
);
}
LeaveCriticalSection
(
&
manager
->
cs
);
return
hr
;
}
}
static
void
standard_quality_manager_release_clock
(
struct
quality_manager
*
manager
)
static
void
standard_quality_manager_release_clock
(
struct
quality_manager
*
manager
)
...
@@ -4886,6 +4910,7 @@ static HRESULT WINAPI standard_quality_manager_Shutdown(IMFQualityManager *iface
...
@@ -4886,6 +4910,7 @@ static HRESULT WINAPI standard_quality_manager_Shutdown(IMFQualityManager *iface
if
(
manager
->
state
!=
QUALITY_MANAGER_SHUT_DOWN
)
if
(
manager
->
state
!=
QUALITY_MANAGER_SHUT_DOWN
)
{
{
standard_quality_manager_release_clock
(
manager
);
standard_quality_manager_release_clock
(
manager
);
standard_quality_manager_set_topology
(
manager
,
NULL
);
manager
->
state
=
QUALITY_MANAGER_SHUT_DOWN
;
manager
->
state
=
QUALITY_MANAGER_SHUT_DOWN
;
}
}
LeaveCriticalSection
(
&
manager
->
cs
);
LeaveCriticalSection
(
&
manager
->
cs
);
...
...
dlls/mf/tests/mf.c
View file @
08088da4
...
@@ -3649,6 +3649,7 @@ static void test_quality_manager(void)
...
@@ -3649,6 +3649,7 @@ static void test_quality_manager(void)
{
{
IMFPresentationClock
*
clock
;
IMFPresentationClock
*
clock
;
IMFQualityManager
*
manager
;
IMFQualityManager
*
manager
;
IMFTopology
*
topology
;
HRESULT
hr
;
HRESULT
hr
;
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
...
@@ -3666,6 +3667,9 @@ static void test_quality_manager(void)
...
@@ -3666,6 +3667,9 @@ static void test_quality_manager(void)
hr
=
IMFQualityManager_NotifyPresentationClock
(
manager
,
NULL
);
hr
=
IMFQualityManager_NotifyPresentationClock
(
manager
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFQualityManager_NotifyTopology
(
manager
,
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* Set clock, then shutdown. */
/* Set clock, then shutdown. */
EXPECT_REF
(
clock
,
1
);
EXPECT_REF
(
clock
,
1
);
EXPECT_REF
(
manager
,
1
);
EXPECT_REF
(
manager
,
1
);
...
@@ -3681,6 +3685,9 @@ static void test_quality_manager(void)
...
@@ -3681,6 +3685,9 @@ static void test_quality_manager(void)
hr
=
IMFQualityManager_NotifyPresentationClock
(
manager
,
clock
);
hr
=
IMFQualityManager_NotifyPresentationClock
(
manager
,
clock
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFQualityManager_NotifyTopology
(
manager
,
NULL
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFQualityManager_NotifyPresentationClock
(
manager
,
NULL
);
hr
=
IMFQualityManager_NotifyPresentationClock
(
manager
,
NULL
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
@@ -3703,6 +3710,48 @@ static void test_quality_manager(void)
...
@@ -3703,6 +3710,48 @@ static void test_quality_manager(void)
IMFPresentationClock_Release
(
clock
);
IMFPresentationClock_Release
(
clock
);
/* Set topology. */
hr
=
MFCreateStandardQualityManager
(
&
manager
);
ok
(
hr
==
S_OK
,
"Failed to create quality manager, hr %#x.
\n
"
,
hr
);
hr
=
MFCreateTopology
(
&
topology
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
EXPECT_REF
(
topology
,
1
);
hr
=
IMFQualityManager_NotifyTopology
(
manager
,
topology
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
EXPECT_REF
(
topology
,
2
);
hr
=
IMFQualityManager_NotifyTopology
(
manager
,
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
EXPECT_REF
(
topology
,
1
);
hr
=
IMFQualityManager_NotifyTopology
(
manager
,
topology
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
EXPECT_REF
(
topology
,
2
);
hr
=
IMFQualityManager_Shutdown
(
manager
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
EXPECT_REF
(
topology
,
1
);
hr
=
IMFQualityManager_NotifyTopology
(
manager
,
topology
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFQualityManager_Release
(
manager
);
hr
=
MFCreateStandardQualityManager
(
&
manager
);
ok
(
hr
==
S_OK
,
"Failed to create quality manager, hr %#x.
\n
"
,
hr
);
EXPECT_REF
(
topology
,
1
);
hr
=
IMFQualityManager_NotifyTopology
(
manager
,
topology
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
EXPECT_REF
(
topology
,
2
);
IMFQualityManager_Release
(
manager
);
EXPECT_REF
(
topology
,
1
);
IMFTopology_Release
(
topology
);
hr
=
MFShutdown
();
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Shutdown failure, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Shutdown failure, hr %#x.
\n
"
,
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