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
409392df
Commit
409392df
authored
Nov 09, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/mixer: Add partial implementation of sample processing.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
292b54f3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
1 deletion
+62
-1
mixer.c
dlls/evr/mixer.c
+62
-1
No files found.
dlls/evr/mixer.c
View file @
409392df
...
...
@@ -1163,6 +1163,65 @@ static HRESULT video_mixer_get_d3d_device(struct video_mixer *mixer, IDirect3DDe
return
hr
;
}
static
void
video_mixer_scale_rect
(
RECT
*
rect
,
unsigned
int
width
,
unsigned
int
height
,
const
MFVideoNormalizedRect
*
scale
)
{
if
(
rect
->
left
==
0
.
0
f
&&
rect
->
top
==
0
.
0
f
&&
rect
->
right
==
1
.
0
f
&&
rect
->
bottom
==
1
.
0
f
)
{
SetRect
(
rect
,
0
,
0
,
width
,
height
);
}
else
{
rect
->
left
=
width
*
scale
->
left
;
rect
->
right
=
width
*
scale
->
right
;
rect
->
top
=
height
*
scale
->
top
;
rect
->
bottom
=
height
*
scale
->
bottom
;
}
}
static
void
video_mixer_render
(
struct
video_mixer
*
mixer
,
IDirect3DSurface9
*
rt
)
{
DXVA2_VideoSample
samples
[
1
]
=
{{
0
}};
DXVA2_VideoProcessBltParams
params
=
{
0
};
MFVideoNormalizedRect
zoom_rect
;
struct
input_stream
*
stream
;
IDirect3DSurface9
*
surface
;
D3DSURFACE_DESC
desc
;
HRESULT
hr
;
IDirect3DSurface9_GetDesc
(
rt
,
&
desc
);
if
(
FAILED
(
IMFAttributes_GetBlob
(
mixer
->
attributes
,
&
VIDEO_ZOOM_RECT
,
(
UINT8
*
)
&
zoom_rect
,
sizeof
(
zoom_rect
),
NULL
)))
{
zoom_rect
.
left
=
zoom_rect
.
top
=
0
.
0
f
;
zoom_rect
.
right
=
zoom_rect
.
bottom
=
1
.
0
f
;
}
video_mixer_scale_rect
(
&
params
.
TargetRect
,
desc
.
Width
,
desc
.
Height
,
&
zoom_rect
);
/* FIXME: for now only handle reference stream. */
video_mixer_get_input
(
mixer
,
0
,
&
stream
);
if
(
FAILED
(
hr
=
video_mixer_get_sample_surface
(
stream
->
sample
,
&
surface
)))
{
WARN
(
"Failed to get source surface, hr %#x.
\n
"
,
hr
);
return
;
}
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
samples
[
0
].
SrcSurface
=
surface
;
SetRect
(
&
samples
[
0
].
SrcRect
,
0
,
0
,
desc
.
Width
,
desc
.
Height
);
video_mixer_scale_rect
(
&
samples
[
0
].
DstRect
,
desc
.
Width
,
desc
.
Height
,
&
stream
->
rect
);
if
(
FAILED
(
hr
=
IDirectXVideoProcessor_VideoProcessBlt
(
mixer
->
processor
,
rt
,
&
params
,
samples
,
1
,
NULL
)))
WARN
(
"Failed to process samples, hr %#x.
\n
"
,
hr
);
IDirect3DSurface9_Release
(
surface
);
}
static
HRESULT
WINAPI
video_mixer_transform_ProcessOutput
(
IMFTransform
*
iface
,
DWORD
flags
,
DWORD
count
,
MFT_OUTPUT_DATA_BUFFER
*
buffers
,
DWORD
*
status
)
{
...
...
@@ -1197,12 +1256,14 @@ static HRESULT WINAPI video_mixer_transform_ProcessOutput(IMFTransform *iface, D
}
}
/* FIXME: for now discard input */
if
(
SUCCEEDED
(
hr
))
video_mixer_render
(
mixer
,
surface
);
if
(
SUCCEEDED
(
hr
))
{
for
(
i
=
0
;
i
<
mixer
->
input_count
;
++
i
)
{
if
(
mixer
->
inputs
[
i
].
sample
)
IMFSample_Release
(
mixer
->
inputs
[
i
].
sample
);
mixer
->
inputs
[
i
].
sample
=
NULL
;
video_mixer_request_sample
(
mixer
,
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