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
e428afe4
Commit
e428afe4
authored
Dec 08, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Implement SetVideoClippingWindow() and PresentImage() in the VMR7 presenter.
parent
69f81188
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
4 deletions
+55
-4
vmr7_presenter.c
dlls/quartz/vmr7_presenter.c
+55
-4
No files found.
dlls/quartz/vmr7_presenter.c
View file @
e428afe4
...
...
@@ -33,6 +33,8 @@ struct vmr7_presenter
IDirectDraw7
*
ddraw
;
IDirectDrawSurface7
*
frontbuffer
;
IDirectDrawSurface7
*
primary
;
HWND
window
;
};
static
struct
vmr7_presenter
*
impl_from_IVMRImagePresenter
(
IVMRImagePresenter
*
iface
)
...
...
@@ -82,6 +84,7 @@ static ULONG WINAPI image_presenter_Release(IVMRImagePresenter *iface)
{
if
(
presenter
->
frontbuffer
)
IDirectDrawSurface7_Release
(
presenter
->
frontbuffer
);
IDirectDrawSurface7_Release
(
presenter
->
primary
);
IDirectDraw7_Release
(
presenter
->
ddraw
);
free
(
presenter
);
}
...
...
@@ -103,8 +106,31 @@ static HRESULT WINAPI image_presenter_StopPresenting(IVMRImagePresenter *iface,
static
HRESULT
WINAPI
image_presenter_PresentImage
(
IVMRImagePresenter
*
iface
,
DWORD_PTR
cookie
,
VMRPRESENTATIONINFO
*
info
)
{
FIXME
(
"iface %p, cookie %#Ix, info %p, stub!
\n
"
,
iface
,
cookie
,
info
);
return
E_NOTIMPL
;
struct
vmr7_presenter
*
presenter
=
impl_from_IVMRImagePresenter
(
iface
);
POINT
point
;
HRESULT
hr
;
RECT
rect
;
TRACE
(
"iface %p, cookie %#Ix, info %p.
\n
"
,
iface
,
cookie
,
info
);
TRACE
(
"flags %#lx, surface %p, start %s, end %s, aspect ratio %ldx%ld,
\n
"
,
info
->
dwFlags
,
info
->
lpSurf
,
debugstr_time
(
info
->
rtStart
),
debugstr_time
(
info
->
rtEnd
),
info
->
szAspectRatio
.
cx
,
info
->
szAspectRatio
.
cy
);
TRACE
(
"src %s, dst %s, type-specific flags %#lx, interlace flags %#lx.
\n
"
,
wine_dbgstr_rect
(
&
info
->
rcSrc
),
wine_dbgstr_rect
(
&
info
->
rcDst
),
info
->
dwTypeSpecificFlags
,
info
->
dwInterlaceFlags
);
if
(
info
->
dwFlags
&
VMRSample_SrcDstRectsValid
)
FIXME
(
"Ignoring src/dst rects.
\n
"
);
GetClientRect
(
presenter
->
window
,
&
rect
);
point
.
x
=
point
.
y
=
0
;
ClientToScreen
(
presenter
->
window
,
&
point
);
OffsetRect
(
&
rect
,
point
.
x
,
point
.
y
);
if
(
FAILED
(
hr
=
IDirectDrawSurface7_Blt
(
presenter
->
primary
,
&
rect
,
info
->
lpSurf
,
NULL
,
DDBLT_WAIT
,
NULL
)))
ERR
(
"Failed to blit, hr %#lx.
\n
"
,
hr
);
return
S_OK
;
}
static
const
IVMRImagePresenterVtbl
image_presenter_vtbl
=
...
...
@@ -310,8 +336,23 @@ static HRESULT WINAPI windowless_control_SetAspectRatioMode(
static
HRESULT
WINAPI
windowless_control_SetVideoClippingWindow
(
IVMRWindowlessControl
*
iface
,
HWND
window
)
{
FIXME
(
"iface %p, window %p, stub!.
\n
"
,
iface
,
window
);
return
E_NOTIMPL
;
struct
vmr7_presenter
*
presenter
=
impl_from_IVMRWindowlessControl
(
iface
);
IDirectDrawClipper
*
clipper
;
HRESULT
hr
;
TRACE
(
"iface %p, window %p.
\n
"
,
iface
,
window
);
if
(
FAILED
(
hr
=
IDirectDraw7_CreateClipper
(
presenter
->
ddraw
,
0
,
&
clipper
,
NULL
)))
ERR
(
"Failed to create clipper, hr %#lx.
\n
"
,
hr
);
if
(
FAILED
(
hr
=
IDirectDrawClipper_SetHWnd
(
clipper
,
0
,
window
)))
ERR
(
"Failed to set clip window, hr %#lx.
\n
"
,
hr
);
if
(
FAILED
(
hr
=
IDirectDrawSurface7_SetClipper
(
presenter
->
primary
,
clipper
)))
ERR
(
"Failed to set clipper, hr %#lx.
\n
"
,
hr
);
IDirectDrawClipper_Release
(
clipper
);
presenter
->
window
=
window
;
return
S_OK
;
}
static
HRESULT
WINAPI
windowless_control_RepaintVideo
(
...
...
@@ -384,6 +425,13 @@ HRESULT vmr7_presenter_create(IUnknown *outer, IUnknown **out)
struct
vmr7_presenter
*
object
;
HRESULT
hr
;
DDSURFACEDESC2
primary_desc
=
{
.
dwSize
=
sizeof
(
DDSURFACEDESC2
),
.
dwFlags
=
DDSD_CAPS
,
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
,
};
TRACE
(
"outer %p, out %p.
\n
"
,
outer
,
out
);
if
(
outer
)
...
...
@@ -406,6 +454,9 @@ HRESULT vmr7_presenter_create(IUnknown *outer, IUnknown **out)
if
(
FAILED
(
hr
=
IDirectDraw7_SetCooperativeLevel
(
object
->
ddraw
,
NULL
,
DDSCL_NORMAL
)))
ERR
(
"Failed to set cooperative level, hr %#lx.
\n
"
,
hr
);
if
(
FAILED
(
hr
=
IDirectDraw7_CreateSurface
(
object
->
ddraw
,
&
primary_desc
,
&
object
->
primary
,
NULL
)))
ERR
(
"Failed to create primary surface, hr %#lx.
\n
"
,
hr
);
TRACE
(
"Created VMR7 default presenter %p.
\n
"
,
object
);
*
out
=
(
IUnknown
*
)
&
object
->
IVMRSurfaceAllocator_iface
;
return
S_OK
;
...
...
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