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
9cb50770
Commit
9cb50770
authored
Oct 06, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/mixer: Keep per-stream zorder configuration.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0b8b0021
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
158 additions
and
6 deletions
+158
-6
mixer.c
dlls/evr/mixer.c
+53
-6
evr.c
dlls/evr/tests/evr.c
+105
-0
No files found.
dlls/evr/mixer.c
View file @
9cb50770
...
...
@@ -42,6 +42,7 @@ struct input_stream
IMFAttributes
*
attributes
;
IMFVideoMediaType
*
media_type
;
MFVideoNormalizedRect
rect
;
unsigned
int
zorder
;
};
struct
output_stream
...
...
@@ -510,6 +511,8 @@ static HRESULT WINAPI video_mixer_transform_AddInputStreams(IMFTransform *iface,
if
(
SUCCEEDED
(
hr
))
{
unsigned
int
zorder
=
mixer
->
input_count
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
((
input
=
bsearch
(
&
ids
[
i
],
inputs
,
len
,
sizeof
(
*
inputs
),
video_mixer_compare_input_id
)))
...
...
@@ -518,6 +521,13 @@ static HRESULT WINAPI video_mixer_transform_AddInputStreams(IMFTransform *iface,
memcpy
(
&
mixer
->
input_ids
[
mixer
->
input_count
],
ids
,
count
*
sizeof
(
*
ids
));
memcpy
(
mixer
->
inputs
,
inputs
,
len
*
sizeof
(
*
inputs
));
mixer
->
input_count
+=
count
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
SUCCEEDED
(
video_mixer_get_input
(
mixer
,
ids
[
i
],
&
input
)))
input
->
zorder
=
zorder
;
zorder
++
;
}
}
}
LeaveCriticalSection
(
&
mixer
->
cs
);
...
...
@@ -1016,18 +1026,55 @@ static ULONG WINAPI video_mixer_control_Release(IMFVideoMixerControl2 *iface)
return
IMFTransform_Release
(
&
mixer
->
IMFTransform_iface
);
}
static
HRESULT
WINAPI
video_mixer_control_SetStreamZOrder
(
IMFVideoMixerControl2
*
iface
,
DWORD
stream_
id
,
DWORD
zorder
)
static
HRESULT
WINAPI
video_mixer_control_SetStreamZOrder
(
IMFVideoMixerControl2
*
iface
,
DWORD
id
,
DWORD
zorder
)
{
FIXME
(
"%p, %u, %u.
\n
"
,
iface
,
stream_id
,
zorder
);
struct
video_mixer
*
mixer
=
impl_from_IMFVideoMixerControl2
(
iface
);
struct
input_stream
*
stream
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %u, %u.
\n
"
,
iface
,
id
,
zorder
);
/* Can't change reference stream. */
if
(
!
id
&&
zorder
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
mixer
->
cs
);
if
(
zorder
>=
mixer
->
input_count
)
hr
=
E_INVALIDARG
;
else
if
(
SUCCEEDED
(
hr
=
video_mixer_get_input
(
mixer
,
id
,
&
stream
)))
{
/* Lowest zorder only applies to reference stream. */
if
(
id
&&
!
zorder
)
hr
=
MF_E_INVALIDREQUEST
;
else
stream
->
zorder
=
zorder
;
}
LeaveCriticalSection
(
&
mixer
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
video_mixer_control_GetStreamZOrder
(
IMFVideoMixerControl2
*
iface
,
DWORD
stream_
id
,
DWORD
*
zorder
)
static
HRESULT
WINAPI
video_mixer_control_GetStreamZOrder
(
IMFVideoMixerControl2
*
iface
,
DWORD
id
,
DWORD
*
zorder
)
{
FIXME
(
"%p, %u, %p.
\n
"
,
iface
,
stream_id
,
zorder
);
struct
video_mixer
*
mixer
=
impl_from_IMFVideoMixerControl2
(
iface
);
struct
input_stream
*
stream
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %u, %p.
\n
"
,
iface
,
id
,
zorder
);
if
(
!
zorder
)
return
E_POINTER
;
EnterCriticalSection
(
&
mixer
->
cs
);
if
(
SUCCEEDED
(
hr
=
video_mixer_get_input
(
mixer
,
id
,
&
stream
)))
*
zorder
=
stream
->
zorder
;
LeaveCriticalSection
(
&
mixer
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
video_mixer_control_SetStreamOutputRect
(
IMFVideoMixerControl2
*
iface
,
DWORD
id
,
...
...
dlls/evr/tests/evr.c
View file @
9cb50770
...
...
@@ -1669,6 +1669,110 @@ static void test_mixer_output_rectangle(void)
IMFTransform_Release
(
mixer
);
}
static
void
test_mixer_zorder
(
void
)
{
IMFVideoMixerControl
*
mixer_control
;
IMFTransform
*
mixer
;
DWORD
ids
[
2
];
DWORD
value
;
HRESULT
hr
;
hr
=
MFCreateVideoMixer
(
NULL
,
&
IID_IDirect3DDevice9
,
&
IID_IMFTransform
,
(
void
**
)
&
mixer
);
ok
(
hr
==
S_OK
,
"Failed to create a mixer, hr %#x.
\n
"
,
hr
);
hr
=
IMFTransform_QueryInterface
(
mixer
,
&
IID_IMFVideoMixerControl
,
(
void
**
)
&
mixer_control
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoMixerControl_GetStreamZOrder
(
mixer_control
,
0
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoMixerControl_GetStreamZOrder
(
mixer_control
,
1
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
value
=
1
;
hr
=
IMFVideoMixerControl_GetStreamZOrder
(
mixer_control
,
0
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
value
,
"Unexpected value %u.
\n
"
,
value
);
value
=
1
;
hr
=
IMFVideoMixerControl_GetStreamZOrder
(
mixer_control
,
1
,
&
value
);
ok
(
hr
==
MF_E_INVALIDSTREAMNUMBER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoMixerControl_SetStreamZOrder
(
mixer_control
,
0
,
1
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoMixerControl_SetStreamZOrder
(
mixer_control
,
1
,
1
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* Exceeds maximum stream number. */
hr
=
IMFVideoMixerControl_SetStreamZOrder
(
mixer_control
,
0
,
20
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
value
=
1
;
hr
=
IMFTransform_AddInputStreams
(
mixer
,
1
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
value
=
0
;
hr
=
IMFVideoMixerControl_GetStreamZOrder
(
mixer_control
,
1
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
value
==
1
,
"Unexpected zorder %u.
\n
"
,
value
);
hr
=
IMFVideoMixerControl_SetStreamZOrder
(
mixer_control
,
1
,
0
);
ok
(
hr
==
MF_E_INVALIDREQUEST
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoMixerControl_SetStreamZOrder
(
mixer_control
,
1
,
2
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoMixerControl_SetStreamZOrder
(
mixer_control
,
0
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
value
=
2
;
hr
=
IMFTransform_AddInputStreams
(
mixer
,
1
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
value
=
0
;
hr
=
IMFVideoMixerControl_GetStreamZOrder
(
mixer_control
,
2
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
value
==
2
,
"Unexpected zorder %u.
\n
"
,
value
);
hr
=
IMFVideoMixerControl_SetStreamZOrder
(
mixer_control
,
2
,
1
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
value
=
3
;
hr
=
IMFTransform_AddInputStreams
(
mixer
,
1
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
value
=
0
;
hr
=
IMFVideoMixerControl_GetStreamZOrder
(
mixer_control
,
3
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
value
==
3
,
"Unexpected zorder %u.
\n
"
,
value
);
hr
=
IMFTransform_DeleteInputStream
(
mixer
,
1
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFTransform_DeleteInputStream
(
mixer
,
2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFTransform_DeleteInputStream
(
mixer
,
3
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ids
[
0
]
=
2
;
ids
[
1
]
=
1
;
hr
=
IMFTransform_AddInputStreams
(
mixer
,
2
,
ids
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
value
=
0
;
hr
=
IMFVideoMixerControl_GetStreamZOrder
(
mixer_control
,
1
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
value
==
2
,
"Unexpected zorder %u.
\n
"
,
value
);
value
=
0
;
hr
=
IMFVideoMixerControl_GetStreamZOrder
(
mixer_control
,
2
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
value
==
1
,
"Unexpected zorder %u.
\n
"
,
value
);
IMFVideoMixerControl_Release
(
mixer_control
);
IMFTransform_Release
(
mixer
);
}
START_TEST
(
evr
)
{
CoInitialize
(
NULL
);
...
...
@@ -1689,6 +1793,7 @@ START_TEST(evr)
test_presenter_video_position
();
test_presenter_native_video_size
();
test_mixer_output_rectangle
();
test_mixer_zorder
();
CoUninitialize
();
}
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