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
aad6c572
Commit
aad6c572
authored
Nov 04, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/mixer: Pass valid background color parameter to VideoProcessBlt().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1722615b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
4 deletions
+31
-4
mixer.c
dlls/evr/mixer.c
+31
-4
No files found.
dlls/evr/mixer.c
View file @
aad6c572
...
...
@@ -95,7 +95,11 @@ struct video_mixer
IMFAttributes
*
internal_attributes
;
unsigned
int
mixing_flags
;
unsigned
int
is_streaming
;
COLORREF
bkgnd_color
;
struct
{
COLORREF
rgba
;
DXVA2_AYUVSample16
ayuv
;
}
bkgnd_color
;
LONGLONG
lower_bound
;
LONGLONG
upper_bound
;
CRITICAL_SECTION
cs
;
...
...
@@ -1277,7 +1281,6 @@ static void video_mixer_render(struct video_mixer *mixer, IDirect3DSurface9 *rt)
zoom_rect
.
right
=
zoom_rect
.
bottom
=
1
.
0
f
;
}
SetRect
(
&
params
.
TargetRect
,
0
,
0
,
rt_desc
.
Width
,
rt_desc
.
Height
);
video_mixer_scale_rect
(
&
dst
,
rt_desc
.
Width
,
rt_desc
.
Height
,
&
zoom_rect
);
for
(
i
=
0
;
i
<
mixer
->
input_count
;
++
i
)
...
...
@@ -1329,6 +1332,9 @@ static void video_mixer_render(struct video_mixer *mixer, IDirect3DSurface9 *rt)
if
(
SUCCEEDED
(
hr
))
{
SetRect
(
&
params
.
TargetRect
,
0
,
0
,
rt_desc
.
Width
,
rt_desc
.
Height
);
params
.
BackgroundColor
=
mixer
->
bkgnd_color
.
ayuv
;
if
(
FAILED
(
hr
=
IDirectXVideoProcessor_VideoProcessBlt
(
mixer
->
processor
,
rt
,
&
params
,
samples
,
sample_count
,
NULL
)))
{
...
...
@@ -1983,12 +1989,28 @@ static HRESULT WINAPI video_mixer_processor_GetBackgroundColor(IMFVideoProcessor
return
E_POINTER
;
EnterCriticalSection
(
&
mixer
->
cs
);
*
color
=
mixer
->
bkgnd_color
;
*
color
=
mixer
->
bkgnd_color
.
rgba
;
LeaveCriticalSection
(
&
mixer
->
cs
);
return
S_OK
;
}
static
void
video_mixer_rgb_to_ycbcr
(
COLORREF
rgb
,
DXVA2_AYUVSample16
*
ayuv
)
{
int
y
,
cb
,
cr
,
r
,
g
,
b
;
r
=
GetRValue
(
rgb
);
g
=
GetGValue
(
rgb
);
b
=
GetBValue
(
rgb
);
/* Coefficients according to SDTV ITU-R BT.601 */
y
=
(
77
*
r
+
150
*
g
+
29
*
b
+
128
)
/
256
+
16
;
cb
=
(
-
44
*
r
-
87
*
g
+
131
*
b
+
128
)
/
256
+
128
;
cr
=
(
131
*
r
-
110
*
g
-
21
*
b
+
128
)
/
256
+
128
;
ayuv
->
Y
=
y
*
0x100
;
ayuv
->
Cb
=
cb
*
0x100
;
ayuv
->
Cr
=
cr
*
0x100
;
ayuv
->
Alpha
=
0xffff
;
}
static
HRESULT
WINAPI
video_mixer_processor_SetBackgroundColor
(
IMFVideoProcessor
*
iface
,
COLORREF
color
)
{
struct
video_mixer
*
mixer
=
impl_from_IMFVideoProcessor
(
iface
);
...
...
@@ -1996,7 +2018,11 @@ static HRESULT WINAPI video_mixer_processor_SetBackgroundColor(IMFVideoProcessor
TRACE
(
"%p, %#x.
\n
"
,
iface
,
color
);
EnterCriticalSection
(
&
mixer
->
cs
);
mixer
->
bkgnd_color
=
color
;
if
(
mixer
->
bkgnd_color
.
rgba
!=
color
)
{
video_mixer_rgb_to_ycbcr
(
color
,
&
mixer
->
bkgnd_color
.
ayuv
);
mixer
->
bkgnd_color
.
rgba
=
color
;
}
LeaveCriticalSection
(
&
mixer
->
cs
);
return
S_OK
;
...
...
@@ -2528,6 +2554,7 @@ HRESULT evr_mixer_create(IUnknown *outer, void **out)
object
->
upper_bound
=
MFT_OUTPUT_BOUND_UPPER_UNBOUNDED
;
video_mixer_init_input
(
&
object
->
inputs
[
0
]);
video_mixer_update_zorder_map
(
object
);
video_mixer_rgb_to_ycbcr
(
object
->
bkgnd_color
.
rgba
,
&
object
->
bkgnd_color
.
ayuv
);
InitializeCriticalSection
(
&
object
->
cs
);
if
(
FAILED
(
hr
=
MFCreateAttributes
(
&
object
->
attributes
,
0
)))
{
...
...
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