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
e16c9a86
Commit
e16c9a86
authored
Nov 03, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/presenter: Add presented frames counter.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
460ae3d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
+52
-2
presenter.c
dlls/evr/presenter.c
+27
-2
evr.c
dlls/evr/tests/evr.c
+25
-0
No files found.
dlls/evr/presenter.c
View file @
e16c9a86
...
...
@@ -116,6 +116,12 @@ struct video_presenter
unsigned
int
ar_mode
;
unsigned
int
state
;
unsigned
int
flags
;
struct
{
int
presented
;
}
frame_stats
;
CRITICAL_SECTION
cs
;
};
...
...
@@ -532,6 +538,7 @@ static void video_presenter_sample_present(struct video_presenter *presenter, IM
}
IDirect3DSwapChain9_Present
(
presenter
->
swapchain
,
&
src
,
&
dst
,
NULL
,
NULL
,
0
);
presenter
->
frame_stats
.
presented
++
;
IDirect3DDevice9_Release
(
device
);
IDirect3DSurface9_Release
(
backbuffer
);
...
...
@@ -934,6 +941,7 @@ static HRESULT WINAPI video_presenter_OnClockStop(IMFVideoPresenter *iface, MFTI
EnterCriticalSection
(
&
presenter
->
cs
);
presenter
->
state
=
PRESENTER_STATE_STOPPED
;
presenter
->
frame_stats
.
presented
=
0
;
LeaveCriticalSection
(
&
presenter
->
cs
);
return
S_OK
;
...
...
@@ -1766,9 +1774,26 @@ static HRESULT WINAPI video_presenter_qualprop_get_FramesDroppedInRenderer(IQual
static
HRESULT
WINAPI
video_presenter_qualprop_get_FramesDrawn
(
IQualProp
*
iface
,
int
*
frames
)
{
FIXME
(
"%p, %p stub.
\n
"
,
iface
,
frames
);
struct
video_presenter
*
presenter
=
impl_from_IQualProp
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
frames
);
EnterCriticalSection
(
&
presenter
->
cs
);
switch
(
presenter
->
state
)
{
case
PRESENTER_STATE_STARTED
:
case
PRESENTER_STATE_PAUSED
:
if
(
frames
)
*
frames
=
presenter
->
frame_stats
.
presented
;
else
hr
=
E_POINTER
;
default:
hr
=
E_NOTIMPL
;
}
LeaveCriticalSection
(
&
presenter
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
video_presenter_qualprop_get_AvgFrameRate
(
IQualProp
*
iface
,
int
*
avg_frame_rate
)
...
...
dlls/evr/tests/evr.c
View file @
e16c9a86
...
...
@@ -2240,6 +2240,8 @@ static void test_presenter_quality_control(void)
MF_QUALITY_DROP_MODE
mode
;
IMFQualityAdvise
*
advise
;
MF_QUALITY_LEVEL
level
;
IQualProp
*
qual_prop
;
int
frame_count
;
HRESULT
hr
;
hr
=
MFCreateVideoPresenter
(
NULL
,
&
IID_IDirect3DDevice9
,
&
IID_IMFVideoPresenter
,
(
void
**
)
&
presenter
);
...
...
@@ -2293,6 +2295,17 @@ todo_wine {
IMFQualityAdvise_Release
(
advise
);
hr
=
IMFVideoPresenter_QueryInterface
(
presenter
,
&
IID_IQualProp
,
(
void
**
)
&
qual_prop
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IQualProp_get_FramesDrawn
(
qual_prop
,
NULL
);
ok
(
hr
==
E_NOTIMPL
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IQualProp_get_FramesDrawn
(
qual_prop
,
&
frame_count
);
ok
(
hr
==
E_NOTIMPL
,
"Unexpected hr %#x.
\n
"
,
hr
);
IQualProp_Release
(
qual_prop
);
IMFVideoPresenter_Release
(
presenter
);
}
...
...
@@ -2432,6 +2445,8 @@ static void test_presenter_shutdown(void)
IMFVideoPresenter
*
presenter
;
IMFVideoDeviceID
*
deviceid
;
HWND
window
,
window2
;
IQualProp
*
qual_prop
;
int
frame_count
;
HRESULT
hr
;
DWORD
mode
;
RECT
rect
;
...
...
@@ -2453,6 +2468,9 @@ static void test_presenter_shutdown(void)
hr
=
IMFVideoPresenter_QueryInterface
(
presenter
,
&
IID_IMFVideoDisplayControl
,
(
void
**
)
&
display_control
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoPresenter_QueryInterface
(
presenter
,
&
IID_IQualProp
,
(
void
**
)
&
qual_prop
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyServiceLookupClient_ReleaseServicePointers
(
lookup_client
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -2505,9 +2523,16 @@ static void test_presenter_shutdown(void)
hr
=
IMFVideoDisplayControl_RepaintVideo
(
display_control
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IQualProp_get_FramesDrawn
(
qual_prop
,
NULL
);
ok
(
hr
==
E_NOTIMPL
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IQualProp_get_FramesDrawn
(
qual_prop
,
&
frame_count
);
ok
(
hr
==
E_NOTIMPL
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyServiceLookupClient_ReleaseServicePointers
(
lookup_client
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IQualProp_Release
(
qual_prop
);
IMFVideoDeviceID_Release
(
deviceid
);
IMFVideoDisplayControl_Release
(
display_control
);
IMFTopologyServiceLookupClient_Release
(
lookup_client
);
...
...
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