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
6163b333
Commit
6163b333
authored
Oct 07, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/presenter: Initialize aspect ratio mode.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
59f3337a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
4 deletions
+65
-4
presenter.c
dlls/evr/presenter.c
+24
-4
evr.c
dlls/evr/tests/evr.c
+32
-0
evr.idl
include/evr.idl
+9
-0
No files found.
dlls/evr/presenter.c
View file @
6163b333
...
@@ -64,6 +64,7 @@ struct video_presenter
...
@@ -64,6 +64,7 @@ struct video_presenter
DWORD
rendering_prefs
;
DWORD
rendering_prefs
;
SIZE
native_size
;
SIZE
native_size
;
SIZE
native_ratio
;
SIZE
native_ratio
;
unsigned
int
ar_mode
;
unsigned
int
state
;
unsigned
int
state
;
CRITICAL_SECTION
cs
;
CRITICAL_SECTION
cs
;
};
};
...
@@ -669,16 +670,34 @@ static HRESULT WINAPI video_presenter_control_GetVideoPosition(IMFVideoDisplayCo
...
@@ -669,16 +670,34 @@ static HRESULT WINAPI video_presenter_control_GetVideoPosition(IMFVideoDisplayCo
static
HRESULT
WINAPI
video_presenter_control_SetAspectRatioMode
(
IMFVideoDisplayControl
*
iface
,
DWORD
mode
)
static
HRESULT
WINAPI
video_presenter_control_SetAspectRatioMode
(
IMFVideoDisplayControl
*
iface
,
DWORD
mode
)
{
{
FIXME
(
"%p, %d.
\n
"
,
iface
,
mod
e
);
struct
video_presenter
*
presenter
=
impl_from_IMFVideoDisplayControl
(
ifac
e
);
return
E_NOTIMPL
;
TRACE
(
"%p, %#x.
\n
"
,
iface
,
mode
);
if
(
mode
&
~
MFVideoARMode_Mask
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
presenter
->
cs
);
presenter
->
ar_mode
=
mode
;
LeaveCriticalSection
(
&
presenter
->
cs
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
video_presenter_control_GetAspectRatioMode
(
IMFVideoDisplayControl
*
iface
,
DWORD
*
mode
)
static
HRESULT
WINAPI
video_presenter_control_GetAspectRatioMode
(
IMFVideoDisplayControl
*
iface
,
DWORD
*
mode
)
{
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
mod
e
);
struct
video_presenter
*
presenter
=
impl_from_IMFVideoDisplayControl
(
ifac
e
);
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
mode
);
if
(
!
mode
)
return
E_POINTER
;
EnterCriticalSection
(
&
presenter
->
cs
);
*
mode
=
presenter
->
ar_mode
;
LeaveCriticalSection
(
&
presenter
->
cs
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
video_presenter_control_SetVideoWindow
(
IMFVideoDisplayControl
*
iface
,
HWND
window
)
static
HRESULT
WINAPI
video_presenter_control_SetVideoWindow
(
IMFVideoDisplayControl
*
iface
,
HWND
window
)
...
@@ -969,6 +988,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
...
@@ -969,6 +988,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
object
->
outer_unk
=
outer
?
outer
:
&
object
->
IUnknown_inner
;
object
->
outer_unk
=
outer
?
outer
:
&
object
->
IUnknown_inner
;
object
->
refcount
=
1
;
object
->
refcount
=
1
;
object
->
src_rect
.
right
=
object
->
src_rect
.
bottom
=
1
.
0
f
;
object
->
src_rect
.
right
=
object
->
src_rect
.
bottom
=
1
.
0
f
;
object
->
ar_mode
=
MFVideoARMode_PreservePicture
|
MFVideoARMode_PreservePixel
;
InitializeCriticalSection
(
&
object
->
cs
);
InitializeCriticalSection
(
&
object
->
cs
);
if
(
FAILED
(
hr
=
DXVA2CreateDirect3DDeviceManager9
(
&
object
->
reset_token
,
&
object
->
device_manager
)))
if
(
FAILED
(
hr
=
DXVA2CreateDirect3DDeviceManager9
(
&
object
->
reset_token
,
&
object
->
device_manager
)))
...
...
dlls/evr/tests/evr.c
View file @
6163b333
...
@@ -1654,6 +1654,37 @@ static void test_presenter_native_video_size(void)
...
@@ -1654,6 +1654,37 @@ static void test_presenter_native_video_size(void)
IMFTransform_Release
(
mixer
);
IMFTransform_Release
(
mixer
);
}
}
static
void
test_presenter_ar_mode
(
void
)
{
IMFVideoDisplayControl
*
display_control
;
HRESULT
hr
;
DWORD
mode
;
hr
=
MFCreateVideoPresenter
(
NULL
,
&
IID_IDirect3DDevice9
,
&
IID_IMFVideoDisplayControl
,
(
void
**
)
&
display_control
);
ok
(
hr
==
S_OK
,
"Failed to create default presenter, hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoDisplayControl_GetAspectRatioMode
(
display_control
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
mode
=
0
;
hr
=
IMFVideoDisplayControl_GetAspectRatioMode
(
display_control
,
&
mode
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
mode
==
(
MFVideoARMode_PreservePicture
|
MFVideoARMode_PreservePixel
),
"Unexpected mode %#x.
\n
"
,
mode
);
hr
=
IMFVideoDisplayControl_SetAspectRatioMode
(
display_control
,
0x100
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoDisplayControl_SetAspectRatioMode
(
display_control
,
MFVideoARMode_Mask
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
mode
=
0
;
hr
=
IMFVideoDisplayControl_GetAspectRatioMode
(
display_control
,
&
mode
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
mode
==
MFVideoARMode_Mask
,
"Unexpected mode %#x.
\n
"
,
mode
);
IMFVideoDisplayControl_Release
(
display_control
);
}
static
void
test_mixer_output_rectangle
(
void
)
static
void
test_mixer_output_rectangle
(
void
)
{
{
IMFVideoMixerControl
*
mixer_control
;
IMFVideoMixerControl
*
mixer_control
;
...
@@ -1836,6 +1867,7 @@ START_TEST(evr)
...
@@ -1836,6 +1867,7 @@ START_TEST(evr)
test_MFCreateVideoSampleAllocator
();
test_MFCreateVideoSampleAllocator
();
test_presenter_video_position
();
test_presenter_video_position
();
test_presenter_native_video_size
();
test_presenter_native_video_size
();
test_presenter_ar_mode
();
test_mixer_output_rectangle
();
test_mixer_output_rectangle
();
test_mixer_zorder
();
test_mixer_zorder
();
...
...
include/evr.idl
View file @
6163b333
...
@@ -228,6 +228,15 @@ interface IMFDesiredSample : IUnknown
...
@@ -228,6 +228,15 @@ interface IMFDesiredSample : IUnknown
void
Clear
()
;
void
Clear
()
;
}
}
typedef
enum
MFVideoAspectRatioMode
{
MFVideoARMode_None
=
0
x00000000
,
MFVideoARMode_PreservePicture
=
0
x00000001
,
MFVideoARMode_PreservePixel
=
0
x00000002
,
MFVideoARMode_NonLinearStretch
=
0
x00000004
,
MFVideoARMode_Mask
=
0
x00000007
,
}
MFVideoAspectRatioMode
;
[
[
object
,
object
,
uuid
(
a490b1e4
-
ab84
-
4
d31
-
a1b2
-
181
e03b1077a
),
uuid
(
a490b1e4
-
ab84
-
4
d31
-
a1b2
-
181
e03b1077a
),
...
...
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