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
3981be41
Commit
3981be41
authored
Oct 02, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/presenter: Maintain video position rectangles.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
77e04e22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
7 deletions
+102
-7
presenter.c
dlls/evr/presenter.c
+36
-7
evr.c
dlls/evr/tests/evr.c
+66
-0
No files found.
dlls/evr/presenter.c
View file @
3981be41
...
...
@@ -59,6 +59,8 @@ struct video_presenter
IDirect3DDeviceManager9
*
device_manager
;
UINT
reset_token
;
HWND
video_window
;
MFVideoNormalizedRect
src_rect
;
RECT
dst_rect
;
unsigned
int
state
;
CRITICAL_SECTION
cs
;
};
...
...
@@ -467,19 +469,45 @@ static HRESULT WINAPI video_presenter_control_GetIdealVideoSize(IMFVideoDisplayC
}
static
HRESULT
WINAPI
video_presenter_control_SetVideoPosition
(
IMFVideoDisplayControl
*
iface
,
const
MFVideoNormalizedRect
*
s
ource
,
const
RECT
*
des
t
)
const
MFVideoNormalizedRect
*
s
rc_rect
,
const
RECT
*
dst_rec
t
)
{
FIXME
(
"%p, %p, %p.
\n
"
,
iface
,
source
,
dest
);
struct
video_presenter
*
presenter
=
impl_from_IMFVideoDisplayControl
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %s.
\n
"
,
iface
,
src_rect
,
wine_dbgstr_rect
(
dst_rect
));
if
(
!
src_rect
&&
!
dst_rect
)
return
E_POINTER
;
if
(
src_rect
&&
(
src_rect
->
left
<
0
.
0
f
||
src_rect
->
top
<
0
.
0
f
||
src_rect
->
right
>
1
.
0
f
||
src_rect
->
bottom
>
1
.
0
f
))
return
E_INVALIDARG
;
EnterCriticalSection
(
&
presenter
->
cs
);
if
(
src_rect
)
presenter
->
src_rect
=
*
src_rect
;
if
(
dst_rect
)
presenter
->
dst_rect
=
*
dst_rect
;
LeaveCriticalSection
(
&
presenter
->
cs
);
return
S_OK
;
}
static
HRESULT
WINAPI
video_presenter_control_GetVideoPosition
(
IMFVideoDisplayControl
*
iface
,
MFVideoNormalizedRect
*
s
ource
,
RECT
*
d
es
t
)
static
HRESULT
WINAPI
video_presenter_control_GetVideoPosition
(
IMFVideoDisplayControl
*
iface
,
MFVideoNormalizedRect
*
s
rc_rect
,
RECT
*
d
st_rec
t
)
{
FIXME
(
"%p, %p, %p.
\n
"
,
iface
,
source
,
dest
);
struct
video_presenter
*
presenter
=
impl_from_IMFVideoDisplayControl
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %p.
\n
"
,
iface
,
src_rect
,
dst_rect
);
if
(
!
src_rect
||
!
dst_rect
)
return
E_POINTER
;
EnterCriticalSection
(
&
presenter
->
cs
);
*
src_rect
=
presenter
->
src_rect
;
*
dst_rect
=
presenter
->
dst_rect
;
LeaveCriticalSection
(
&
presenter
->
cs
);
return
S_OK
;
}
static
HRESULT
WINAPI
video_presenter_control_SetAspectRatioMode
(
IMFVideoDisplayControl
*
iface
,
DWORD
mode
)
...
...
@@ -718,6 +746,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
object
->
IUnknown_inner
.
lpVtbl
=
&
video_presenter_inner_vtbl
;
object
->
outer_unk
=
outer
?
outer
:
&
object
->
IUnknown_inner
;
object
->
refcount
=
1
;
object
->
src_rect
.
right
=
object
->
src_rect
.
bottom
=
1
.
0
f
;
InitializeCriticalSection
(
&
object
->
cs
);
if
(
FAILED
(
hr
=
DXVA2CreateDirect3DDeviceManager9
(
&
object
->
reset_token
,
&
object
->
device_manager
)))
...
...
dlls/evr/tests/evr.c
View file @
3981be41
...
...
@@ -970,6 +970,7 @@ static void test_default_presenter(void)
D3DPRESENT_PARAMETERS
present_params
=
{
0
};
IMFVideoDisplayControl
*
display_control
;
IDirect3DSwapChain9
*
swapchain
;
MFVideoNormalizedRect
src_rect
;
IMFVideoPresenter
*
presenter
;
IMFRateSupport
*
rate_support
;
IDirect3DDevice9
*
d3d_device
;
...
...
@@ -977,6 +978,7 @@ static void test_default_presenter(void)
IMFVideoDeviceID
*
deviceid
;
IMFGetService
*
gs
;
HWND
hwnd
,
hwnd2
;
RECT
dst_rect
;
HANDLE
handle
;
IUnknown
*
unk
;
float
rate
;
...
...
@@ -1051,6 +1053,7 @@ static void test_default_presenter(void)
hr
=
IDirect3DDeviceManager9_UnlockDevice
(
dm
,
handle
,
FALSE
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* Video window */
hwnd
=
create_window
();
ok
(
!!
hwnd
,
"Failed to create a test window.
\n
"
);
...
...
@@ -1067,6 +1070,69 @@ static void test_default_presenter(void)
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hwnd2
==
hwnd
,
"Unexpected window %p.
\n
"
,
hwnd2
);
/* Video position */
hr
=
IMFVideoDisplayControl_GetVideoPosition
(
display_control
,
NULL
,
&
dst_rect
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoDisplayControl_GetVideoPosition
(
display_control
,
&
src_rect
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
SetRect
(
&
dst_rect
,
1
,
2
,
3
,
4
);
hr
=
IMFVideoDisplayControl_GetVideoPosition
(
display_control
,
&
src_rect
,
&
dst_rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
src_rect
.
left
==
0
.
0
f
&&
src_rect
.
top
==
0
.
0
f
&&
src_rect
.
right
==
1
.
0
f
&&
src_rect
.
bottom
==
1
.
0
f
,
"Unexpected source rectangle.
\n
"
);
ok
(
dst_rect
.
left
==
0
&&
dst_rect
.
right
==
0
&&
dst_rect
.
top
==
0
&&
dst_rect
.
bottom
==
0
,
"Unexpected destination rectangle %s.
\n
"
,
wine_dbgstr_rect
(
&
dst_rect
));
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
SetRect
(
&
dst_rect
,
0
,
0
,
10
,
10
);
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
NULL
,
&
dst_rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
SetRect
(
&
dst_rect
,
1
,
2
,
3
,
4
);
hr
=
IMFVideoDisplayControl_GetVideoPosition
(
display_control
,
&
src_rect
,
&
dst_rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
dst_rect
.
left
==
0
&&
dst_rect
.
right
==
10
&&
dst_rect
.
top
==
0
&&
dst_rect
.
bottom
==
10
,
"Unexpected destination rectangle %s.
\n
"
,
wine_dbgstr_rect
(
&
dst_rect
));
src_rect
.
left
=
src_rect
.
top
=
0
.
0
f
;
src_rect
.
right
=
2
.
0
f
;
src_rect
.
bottom
=
1
.
0
f
;
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
&
src_rect
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
src_rect
.
left
=
-
0
.
1
f
;
src_rect
.
top
=
0
.
0
f
;
src_rect
.
right
=
0
.
9
f
;
src_rect
.
bottom
=
1
.
0
f
;
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
&
src_rect
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
src_rect
.
left
=
0
.
1
f
;
src_rect
.
top
=
0
.
2
f
;
src_rect
.
right
=
0
.
8
f
;
src_rect
.
bottom
=
0
.
9
f
;
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
&
src_rect
,
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoDisplayControl_GetVideoPosition
(
display_control
,
&
src_rect
,
&
dst_rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
src_rect
.
left
==
0
.
1
f
&&
src_rect
.
top
==
0
.
2
f
&&
src_rect
.
right
==
0
.
8
f
&&
src_rect
.
bottom
==
0
.
9
f
,
"Unexpected source rectangle.
\n
"
);
SetRect
(
&
dst_rect
,
1
,
2
,
999
,
1000
);
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
NULL
,
&
dst_rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
SetRect
(
&
dst_rect
,
0
,
1
,
3
,
4
);
hr
=
IMFVideoDisplayControl_GetVideoPosition
(
display_control
,
&
src_rect
,
&
dst_rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
dst_rect
.
left
==
1
&&
dst_rect
.
right
==
999
&&
dst_rect
.
top
==
2
&&
dst_rect
.
bottom
==
1000
,
"Unexpected destination rectangle %s.
\n
"
,
wine_dbgstr_rect
(
&
dst_rect
));
hr
=
IDirect3DDeviceManager9_CloseDeviceHandle
(
dm
,
handle
);
ok
(
hr
==
S_OK
,
"Unexpected 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