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
d9957dd2
Commit
d9957dd2
authored
Nov 05, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxva2: Handle specified background color in VideoProcessBlt().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e0b30bc5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
+27
-2
main.c
dlls/dxva2/main.c
+27
-2
No files found.
dlls/dxva2/main.c
View file @
d9957dd2
...
@@ -258,6 +258,26 @@ static BOOL intersect_rect(RECT *dest, const RECT *src1, const RECT *src2)
...
@@ -258,6 +258,26 @@ static BOOL intersect_rect(RECT *dest, const RECT *src1, const RECT *src2)
return
TRUE
;
return
TRUE
;
}
}
static
D3DCOLOR
video_processor_get_background_color
(
const
DXVA2_AYUVSample16
*
ayuv
)
{
float
y
,
cb
,
cr
;
BYTE
r
,
g
,
b
;
y
=
(
ayuv
->
Y
>>
8
)
-
16
;
cb
=
(
ayuv
->
Cb
>>
8
)
-
128
;
cr
=
(
ayuv
->
Cr
>>
8
)
-
128
;
y
=
255
.
0
f
*
y
/
219
.
0
f
;
cb
=
255
.
0
f
*
cb
/
224
.
0
f
;
cr
=
255
.
0
f
*
cr
/
224
.
0
f
;
r
=
y
+
1
.
402
*
cr
;
g
=
y
-
0
.
344
*
cb
-
0
.
714
*
cr
;
b
=
y
+
1
.
772
*
cb
;
return
D3DCOLOR_XRGB
(
r
,
g
,
b
);
}
static
HRESULT
WINAPI
video_processor_VideoProcessBlt
(
IDirectXVideoProcessor
*
iface
,
IDirect3DSurface9
*
rt
,
static
HRESULT
WINAPI
video_processor_VideoProcessBlt
(
IDirectXVideoProcessor
*
iface
,
IDirect3DSurface9
*
rt
,
const
DXVA2_VideoProcessBltParams
*
params
,
const
DXVA2_VideoSample
*
samples
,
UINT
sample_count
,
const
DXVA2_VideoProcessBltParams
*
params
,
const
DXVA2_VideoSample
*
samples
,
UINT
sample_count
,
HANDLE
*
complete_handle
)
HANDLE
*
complete_handle
)
...
@@ -269,14 +289,19 @@ static HRESULT WINAPI video_processor_VideoProcessBlt(IDirectXVideoProcessor *if
...
@@ -269,14 +289,19 @@ static HRESULT WINAPI video_processor_VideoProcessBlt(IDirectXVideoProcessor *if
TRACE
(
"%p, %p, %p, %p, %u, %p.
\n
"
,
iface
,
rt
,
params
,
samples
,
sample_count
,
complete_handle
);
TRACE
(
"%p, %p, %p, %p, %u, %p.
\n
"
,
iface
,
rt
,
params
,
samples
,
sample_count
,
complete_handle
);
if
(
params
->
BackgroundColor
.
Alpha
!=
0xffff
)
{
WARN
(
"Unexpected background alpha %#x.
\n
"
,
params
->
BackgroundColor
.
Alpha
);
return
E_INVALIDARG
;
}
if
(
FAILED
(
hr
=
IDirect3DSurface9_GetDevice
(
rt
,
&
device
)))
if
(
FAILED
(
hr
=
IDirect3DSurface9_GetDevice
(
rt
,
&
device
)))
{
{
WARN
(
"Failed to get surface device, hr %#x.
\n
"
,
hr
);
WARN
(
"Failed to get surface device, hr %#x.
\n
"
,
hr
);
return
hr
;
return
hr
;
}
}
/* FIXME: use specified color */
IDirect3DDevice9_ColorFill
(
device
,
rt
,
&
params
->
TargetRect
,
video_processor_get_background_color
(
&
params
->
BackgroundColor
));
IDirect3DDevice9_ColorFill
(
device
,
rt
,
NULL
,
0
);
for
(
i
=
0
;
i
<
sample_count
;
++
i
)
for
(
i
=
0
;
i
<
sample_count
;
++
i
)
{
{
...
...
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