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
267b365f
Commit
267b365f
authored
Oct 23, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Implement GetVideoService() for the device manager.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b0ab5255
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
4 deletions
+55
-4
main.c
dlls/mfplat/main.c
+24
-4
mfplat.c
dlls/mfplat/tests/mfplat.c
+31
-0
No files found.
dlls/mfplat/main.c
View file @
267b365f
...
...
@@ -8689,12 +8689,32 @@ static HRESULT WINAPI dxgi_device_manager_CloseDeviceHandle(IMFDXGIDeviceManager
return
hr
;
}
static
HRESULT
WINAPI
dxgi_device_manager_GetVideoService
(
IMFDXGIDeviceManager
*
iface
,
HANDLE
device
,
REFIID
riid
,
void
**
service
)
static
HRESULT
WINAPI
dxgi_device_manager_GetVideoService
(
IMFDXGIDeviceManager
*
iface
,
HANDLE
h
device
,
REFIID
riid
,
void
**
service
)
{
FIXME
(
"(%p, %p, %s, %p): stub.
\n
"
,
iface
,
device
,
debugstr_guid
(
riid
),
service
);
struct
dxgi_device_manager
*
manager
=
impl_from_IMFDXGIDeviceManager
(
iface
);
HRESULT
hr
;
size_t
idx
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %s, %p.
\n
"
,
iface
,
hdevice
,
debugstr_guid
(
riid
),
service
);
EnterCriticalSection
(
&
manager
->
cs
);
if
(
!
manager
->
device
)
hr
=
MF_E_DXGI_DEVICE_NOT_INITIALIZED
;
else
if
(
SUCCEEDED
(
hr
=
dxgi_device_manager_get_handle_index
(
manager
,
hdevice
,
&
idx
)))
{
if
(
manager
->
handles
[
idx
]
&
DXGI_DEVICE_HANDLE_FLAG_INVALID
)
hr
=
MF_E_DXGI_NEW_VIDEO_DEVICE
;
else
if
(
manager
->
handles
[
idx
]
&
DXGI_DEVICE_HANDLE_FLAG_OPEN
)
hr
=
IDXGIDevice_QueryInterface
(
manager
->
device
,
riid
,
service
);
else
hr
=
E_HANDLE
;
}
LeaveCriticalSection
(
&
manager
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
dxgi_device_manager_LockDevice
(
IMFDXGIDeviceManager
*
iface
,
HANDLE
hdevice
,
...
...
dlls/mfplat/tests/mfplat.c
View file @
267b365f
...
...
@@ -4530,6 +4530,7 @@ static void test_dxgi_device_manager(void)
struct
test_thread_param
param
;
HANDLE
handle1
,
handle
,
thread
;
UINT
token
,
token2
;
IUnknown
*
unk
;
HRESULT
hr
;
if
(
!
pMFCreateDXGIDeviceManager
)
...
...
@@ -4560,6 +4561,9 @@ static void test_dxgi_device_manager(void)
ok
(
manager
!=
manager2
,
"got wrong pointer: %p.
\n
"
,
manager2
);
EXPECT_REF
(
manager
,
1
);
hr
=
IMFDXGIDeviceManager_GetVideoService
(
manager
,
NULL
,
&
IID_ID3D11Device
,
(
void
**
)
&
unk
);
ok
(
hr
==
MF_E_DXGI_DEVICE_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFDXGIDeviceManager_OpenDeviceHandle
(
manager
,
&
handle
);
ok
(
hr
==
MF_E_DXGI_DEVICE_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -4593,6 +4597,12 @@ static void test_dxgi_device_manager(void)
EXPECT_REF
(
manager
,
1
);
EXPECT_REF
(
d3d11_dev
,
2
);
/* GetVideoService() on device change. */
handle
=
NULL
;
hr
=
IMFDXGIDeviceManager_OpenDeviceHandle
(
manager
,
&
handle
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!!
handle
,
"Unexpected handle value %p.
\n
"
,
handle
);
hr
=
pD3D11CreateDevice
(
NULL
,
D3D_DRIVER_TYPE_HARDWARE
,
NULL
,
0
,
NULL
,
0
,
D3D11_SDK_VERSION
,
&
d3d11_dev2
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"D3D11CreateDevice failed: %#x.
\n
"
,
hr
);
...
...
@@ -4603,11 +4613,32 @@ static void test_dxgi_device_manager(void)
EXPECT_REF
(
d3d11_dev2
,
2
);
EXPECT_REF
(
d3d11_dev
,
1
);
hr
=
IMFDXGIDeviceManager_GetVideoService
(
manager
,
handle
,
&
IID_ID3D11Device
,
(
void
**
)
&
unk
);
ok
(
hr
==
MF_E_DXGI_NEW_VIDEO_DEVICE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFDXGIDeviceManager_CloseDeviceHandle
(
manager
,
handle
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
handle
=
NULL
;
hr
=
IMFDXGIDeviceManager_OpenDeviceHandle
(
manager
,
&
handle
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!!
handle
,
"Unexpected handle value %p.
\n
"
,
handle
);
hr
=
IMFDXGIDeviceManager_GetVideoService
(
manager
,
NULL
,
&
IID_ID3D11Device
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_HANDLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFDXGIDeviceManager_GetVideoService
(
manager
,
handle
,
&
IID_ID3D11Device
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
hr
=
IMFDXGIDeviceManager_GetVideoService
(
manager
,
handle
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
hr
=
IMFDXGIDeviceManager_GetVideoService
(
manager
,
handle
,
&
IID_IDXGIDevice
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
handle1
=
NULL
;
hr
=
IMFDXGIDeviceManager_OpenDeviceHandle
(
manager
,
&
handle1
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
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