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
c94f86da
Commit
c94f86da
authored
Oct 28, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/presenter: Handle shutdown state in more methods.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43993feb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
15 deletions
+59
-15
presenter.c
dlls/evr/presenter.c
+59
-9
evr.c
dlls/evr/tests/evr.c
+0
-6
No files found.
dlls/evr/presenter.c
View file @
c94f86da
...
...
@@ -31,9 +31,16 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
evr
);
/*
Initial state represents just created object, presenter never returns to this state.
Shutdown state is entered on ReleaseServicePointers(), terminal state.
Started/stopped/paused states are controlled by clock state changes.
*/
enum
presenter_state
{
PRESENTER_STATE_SHUT_DOWN
=
0
,
PRESENTER_STATE_INITIAL
=
0
,
PRESENTER_STATE_SHUT_DOWN
,
PRESENTER_STATE_STARTED
,
PRESENTER_STATE_STOPPED
,
PRESENTER_STATE_PAUSED
,
...
...
@@ -603,6 +610,9 @@ static HRESULT video_presenter_process_input(struct video_presenter *presenter)
IMFSample
*
sample
;
DWORD
status
;
if
(
presenter
->
state
==
PRESENTER_STATE_SHUT_DOWN
)
return
MF_E_SHUTDOWN
;
if
(
!
presenter
->
media_type
)
return
S_OK
;
...
...
@@ -708,6 +718,9 @@ static HRESULT video_presenter_start_streaming(struct video_presenter *presenter
{
HRESULT
hr
;
if
(
presenter
->
state
==
PRESENTER_STATE_SHUT_DOWN
)
return
MF_E_SHUTDOWN
;
if
(
presenter
->
thread
.
hthread
)
return
S_OK
;
...
...
@@ -968,7 +981,12 @@ static HRESULT WINAPI video_presenter_ProcessMessage(IMFVideoPresenter *iface, M
switch
(
message
)
{
case
MFVP_MESSAGE_INVALIDATEMEDIATYPE
:
hr
=
presenter
->
mixer
?
video_presenter_invalidate_media_type
(
presenter
)
:
MF_E_INVALIDREQUEST
;
if
(
presenter
->
state
==
PRESENTER_STATE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
if
(
!
presenter
->
mixer
)
hr
=
MF_E_INVALIDREQUEST
;
else
hr
=
video_presenter_invalidate_media_type
(
presenter
);
break
;
case
MFVP_MESSAGE_BEGINSTREAMING
:
hr
=
video_presenter_start_streaming
(
presenter
);
...
...
@@ -1238,6 +1256,7 @@ static HRESULT WINAPI video_presenter_control_GetNativeVideoSize(IMFVideoDisplay
SIZE
*
aspect_ratio
)
{
struct
video_presenter
*
presenter
=
impl_from_IMFVideoDisplayControl
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"%p, %p, %p.
\n
"
,
iface
,
video_size
,
aspect_ratio
);
...
...
@@ -1245,21 +1264,40 @@ static HRESULT WINAPI video_presenter_control_GetNativeVideoSize(IMFVideoDisplay
return
E_POINTER
;
EnterCriticalSection
(
&
presenter
->
cs
);
if
(
video_size
)
*
video_size
=
presenter
->
native_size
;
if
(
aspect_ratio
)
*
aspect_ratio
=
presenter
->
native_ratio
;
if
(
presenter
->
state
==
PRESENTER_STATE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
{
if
(
video_size
)
*
video_size
=
presenter
->
native_size
;
if
(
aspect_ratio
)
*
aspect_ratio
=
presenter
->
native_ratio
;
}
LeaveCriticalSection
(
&
presenter
->
cs
);
return
S_OK
;
return
hr
;
}
static
HRESULT
WINAPI
video_presenter_control_GetIdealVideoSize
(
IMFVideoDisplayControl
*
iface
,
SIZE
*
min_size
,
SIZE
*
max_size
)
{
struct
video_presenter
*
presenter
=
impl_from_IMFVideoDisplayControl
(
iface
);
HRESULT
hr
;
FIXME
(
"%p, %p, %p.
\n
"
,
iface
,
min_size
,
max_size
);
return
E_NOTIMPL
;
EnterCriticalSection
(
&
presenter
->
cs
);
if
(
presenter
->
state
==
PRESENTER_STATE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
hr
=
E_NOTIMPL
;
LeaveCriticalSection
(
&
presenter
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
video_presenter_control_SetVideoPosition
(
IMFVideoDisplayControl
*
iface
,
...
...
@@ -1425,9 +1463,21 @@ static HRESULT WINAPI video_presenter_control_GetVideoWindow(IMFVideoDisplayCont
static
HRESULT
WINAPI
video_presenter_control_RepaintVideo
(
IMFVideoDisplayControl
*
iface
)
{
struct
video_presenter
*
presenter
=
impl_from_IMFVideoDisplayControl
(
iface
);
HRESULT
hr
;
FIXME
(
"%p.
\n
"
,
iface
);
return
E_NOTIMPL
;
EnterCriticalSection
(
&
presenter
->
cs
);
if
(
presenter
->
state
==
PRESENTER_STATE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
hr
=
E_NOTIMPL
;
LeaveCriticalSection
(
&
presenter
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
video_presenter_control_GetCurrentImage
(
IMFVideoDisplayControl
*
iface
,
BITMAPINFOHEADER
*
header
,
...
...
dlls/evr/tests/evr.c
View file @
c94f86da
...
...
@@ -2353,18 +2353,15 @@ static void test_presenter_shutdown(void)
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoPresenter_ProcessMessage
(
presenter
,
MFVP_MESSAGE_INVALIDATEMEDIATYPE
,
0
);
todo_wine
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoPresenter_ProcessMessage
(
presenter
,
MFVP_MESSAGE_BEGINSTREAMING
,
0
);
todo_wine
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoPresenter_ProcessMessage
(
presenter
,
MFVP_MESSAGE_ENDSTREAMING
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoPresenter_ProcessMessage
(
presenter
,
MFVP_MESSAGE_PROCESSINPUTNOTIFY
,
0
);
todo_wine
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoPresenter_GetCurrentMediaType
(
presenter
,
&
media_type
);
...
...
@@ -2374,11 +2371,9 @@ todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoDisplayControl_GetNativeVideoSize
(
display_control
,
&
size
,
&
size
);
todo_wine
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoDisplayControl_GetIdealVideoSize
(
display_control
,
&
size
,
&
size
);
todo_wine
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
SetRect
(
&
rect
,
0
,
0
,
10
,
10
);
...
...
@@ -2404,7 +2399,6 @@ todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoDisplayControl_RepaintVideo
(
display_control
);
todo_wine
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFTopologyServiceLookupClient_ReleaseServicePointers
(
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