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
2ff55d97
Commit
2ff55d97
authored
Oct 01, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/presenter: Create device manager for the presenter.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b21d2b7c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
4 deletions
+56
-4
Makefile.in
dlls/evr/Makefile.in
+1
-1
presenter.c
dlls/evr/presenter.c
+20
-1
evr.c
dlls/evr/tests/evr.c
+35
-2
No files found.
dlls/evr/Makefile.in
View file @
2ff55d97
MODULE
=
evr.dll
IMPORTLIB
=
evr
IMPORTS
=
mfuuid strmiids strmbase uuid dxguid ole32 oleaut32
IMPORTS
=
mfuuid strmiids strmbase uuid dxguid ole32 oleaut32
dxva2
DELAYIMPORTS
=
mfplat
EXTRADLLFLAGS
=
-mno-cygwin
...
...
dlls/evr/presenter.c
View file @
2ff55d97
...
...
@@ -22,6 +22,7 @@
#include "d3d9.h"
#include "mfapi.h"
#include "mferror.h"
#include "dxva2api.h"
#include "evr_classes.h"
#include "evr_private.h"
...
...
@@ -55,6 +56,8 @@ struct video_presenter
IMFClock
*
clock
;
IMediaEventSink
*
event_sink
;
IDirect3DDeviceManager9
*
device_manager
;
UINT
reset_token
;
unsigned
int
state
;
CRITICAL_SECTION
cs
;
};
...
...
@@ -174,6 +177,8 @@ static ULONG WINAPI video_presenter_inner_Release(IUnknown *iface)
{
video_presenter_clear_container
(
presenter
);
DeleteCriticalSection
(
&
presenter
->
cs
);
if
(
presenter
->
device_manager
)
IDirect3DDeviceManager9_Release
(
presenter
->
device_manager
);
heap_free
(
presenter
);
}
...
...
@@ -606,7 +611,14 @@ static ULONG WINAPI video_presenter_getservice_Release(IMFGetService *iface)
static
HRESULT
WINAPI
video_presenter_getservice_GetService
(
IMFGetService
*
iface
,
REFGUID
service
,
REFIID
riid
,
void
**
obj
)
{
FIXME
(
"%p, %s, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
service
),
debugstr_guid
(
riid
),
obj
);
struct
video_presenter
*
presenter
=
impl_from_IMFGetService
(
iface
);
TRACE
(
"%p, %s, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
service
),
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualGUID
(
&
MR_VIDEO_ACCELERATION_SERVICE
,
service
))
return
IDirect3DDeviceManager9_QueryInterface
(
presenter
->
device_manager
,
riid
,
obj
);
FIXME
(
"Unimplemented service %s.
\n
"
,
debugstr_guid
(
service
));
return
E_NOTIMPL
;
}
...
...
@@ -634,6 +646,7 @@ HRESULT WINAPI MFCreateVideoPresenter(IUnknown *owner, REFIID riid_device, REFII
HRESULT
evr_presenter_create
(
IUnknown
*
outer
,
void
**
out
)
{
struct
video_presenter
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
...
...
@@ -649,6 +662,12 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
object
->
refcount
=
1
;
InitializeCriticalSection
(
&
object
->
cs
);
if
(
FAILED
(
hr
=
DXVA2CreateDirect3DDeviceManager9
(
&
object
->
reset_token
,
&
object
->
device_manager
)))
{
IUnknown_Release
(
&
object
->
IUnknown_inner
);
return
hr
;
}
*
out
=
&
object
->
IUnknown_inner
;
return
S_OK
;
...
...
dlls/evr/tests/evr.c
View file @
2ff55d97
...
...
@@ -966,9 +966,14 @@ done:
static
void
test_default_presenter
(
void
)
{
D3DDEVICE_CREATION_PARAMETERS
device_params
=
{
0
};
IMFVideoPresenter
*
presenter
;
IMFRateSupport
*
rate_support
;
IDirect3DDevice9
*
d3d_device
;
IDirect3DDeviceManager9
*
dm
;
IMFVideoDeviceID
*
deviceid
;
IMFGetService
*
gs
;
HANDLE
handle
;
IUnknown
*
unk
;
float
rate
;
HRESULT
hr
;
...
...
@@ -1002,9 +1007,37 @@ static void test_default_presenter(void)
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
hr
=
IMFVideoPresenter_QueryInterface
(
presenter
,
&
IID_IMFGetService
,
(
void
**
)
&
unk
);
hr
=
IMFVideoPresenter_QueryInterface
(
presenter
,
&
IID_IMFGetService
,
(
void
**
)
&
gs
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
hr
=
IMFGetService_GetService
(
gs
,
&
MR_VIDEO_ACCELERATION_SERVICE
,
&
IID_IDirect3DDeviceManager9
,
(
void
**
)
&
dm
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDeviceManager9_OpenDeviceHandle
(
dm
,
&
handle
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDeviceManager9_LockDevice
(
dm
,
handle
,
&
d3d_device
,
FALSE
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DDevice9_GetCreationParameters
(
d3d_device
,
&
device_params
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
device_params
.
hFocusWindow
==
GetDesktopWindow
(),
"Unexpected window %p.
\n
"
,
device_params
.
hFocusWindow
);
IDirect3DDevice9_Release
(
d3d_device
);
hr
=
IDirect3DDeviceManager9_UnlockDevice
(
dm
,
handle
,
FALSE
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDeviceManager9_CloseDeviceHandle
(
dm
,
handle
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
}
IDirect3DDeviceManager9_Release
(
dm
);
IMFGetService_Release
(
gs
);
/* Rate support. */
hr
=
IMFVideoPresenter_QueryInterface
(
presenter
,
&
IID_IMFRateSupport
,
(
void
**
)
&
rate_support
);
...
...
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