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
e0b5edf8
Commit
e0b5edf8
authored
Jun 23, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxva2: Implement DXVA2CreateVideoService().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cb43efe9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
13 deletions
+69
-13
main.c
dlls/dxva2/main.c
+26
-12
dxva2.c
dlls/dxva2/tests/dxva2.c
+43
-1
No files found.
dlls/dxva2/main.c
View file @
e0b5edf8
...
@@ -101,6 +101,7 @@ static HRESULT WINAPI device_manager_processor_service_QueryInterface(IDirectXVi
...
@@ -101,6 +101,7 @@ static HRESULT WINAPI device_manager_processor_service_QueryInterface(IDirectXVi
REFIID
riid
,
void
**
obj
)
REFIID
riid
,
void
**
obj
)
{
{
if
(
IsEqualIID
(
riid
,
&
IID_IDirectXVideoProcessorService
)
||
if
(
IsEqualIID
(
riid
,
&
IID_IDirectXVideoProcessorService
)
||
IsEqualIID
(
riid
,
&
IID_IDirectXVideoAccelerationService
)
||
IsEqualIID
(
riid
,
&
IID_IUnknown
))
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
{
*
obj
=
iface
;
*
obj
=
iface
;
...
@@ -401,16 +402,9 @@ static HRESULT WINAPI device_manager_GetVideoService(IDirect3DDeviceManager9 *if
...
@@ -401,16 +402,9 @@ static HRESULT WINAPI device_manager_GetVideoService(IDirect3DDeviceManager9 *if
hr
=
DXVA2_E_NEW_VIDEO_DEVICE
;
hr
=
DXVA2_E_NEW_VIDEO_DEVICE
;
else
if
(
!
(
flags
&
HANDLE_FLAG_OPEN
))
else
if
(
!
(
flags
&
HANDLE_FLAG_OPEN
))
hr
=
E_HANDLE
;
hr
=
E_HANDLE
;
else
if
(
IsEqualIID
(
riid
,
&
IID_IDirectXVideoProcessorService
))
{
*
obj
=
&
manager
->
IDirectXVideoProcessorService_iface
;
IUnknown_AddRef
((
IUnknown
*
)
*
obj
);
}
else
else
{
hr
=
IDirectXVideoProcessorService_QueryInterface
(
&
manager
->
IDirectXVideoProcessorService_iface
,
WARN
(
"Unsupported service %s.
\n
"
,
debugstr_guid
(
riid
));
riid
,
obj
);
hr
=
E_UNEXPECTED
;
}
}
}
LeaveCriticalSection
(
&
manager
->
cs
);
LeaveCriticalSection
(
&
manager
->
cs
);
...
@@ -462,11 +456,31 @@ HRESULT WINAPI DXVA2CreateDirect3DDeviceManager9(UINT *token, IDirect3DDeviceMan
...
@@ -462,11 +456,31 @@ HRESULT WINAPI DXVA2CreateDirect3DDeviceManager9(UINT *token, IDirect3DDeviceMan
return
S_OK
;
return
S_OK
;
}
}
HRESULT
WINAPI
DXVA2CreateVideoService
(
IDirect3DDevice9
*
device
,
REFIID
riid
,
void
**
ppv
)
HRESULT
WINAPI
DXVA2CreateVideoService
(
IDirect3DDevice9
*
device
,
REFIID
riid
,
void
**
obj
)
{
{
FIXME
(
"(%p, %s, %p): stub
\n
"
,
device
,
debugstr_guid
(
riid
),
ppv
);
IDirect3DDeviceManager9
*
manager
;
HANDLE
handle
;
HRESULT
hr
;
UINT
token
;
return
E_NOTIMPL
;
TRACE
(
"%p, %s, %p.
\n
"
,
device
,
debugstr_guid
(
riid
),
obj
);
if
(
FAILED
(
hr
=
DXVA2CreateDirect3DDeviceManager9
(
&
token
,
&
manager
)))
return
hr
;
if
(
FAILED
(
hr
=
IDirect3DDeviceManager9_ResetDevice
(
manager
,
device
,
token
)))
goto
done
;
if
(
FAILED
(
hr
=
IDirect3DDeviceManager9_OpenDeviceHandle
(
manager
,
&
handle
)))
goto
done
;
hr
=
IDirect3DDeviceManager9_GetVideoService
(
manager
,
handle
,
riid
,
obj
);
IDirect3DDeviceManager9_CloseDeviceHandle
(
manager
,
handle
);
done:
IDirect3DDeviceManager9_Release
(
manager
);
return
hr
;
}
}
BOOL
WINAPI
DegaussMonitor
(
HMONITOR
monitor
)
BOOL
WINAPI
DegaussMonitor
(
HMONITOR
monitor
)
...
...
dlls/dxva2/tests/dxva2.c
View file @
e0b5edf8
...
@@ -62,8 +62,10 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window)
...
@@ -62,8 +62,10 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window)
static
void
test_device_manager
(
void
)
static
void
test_device_manager
(
void
)
{
{
IDirectXVideoProcessorService
*
processor_service
;
IDirectXVideoProcessorService
*
processor_service
;
IDirect3DDevice9
*
device
,
*
device2
;
IDirectXVideoAccelerationService
*
accel_service
;
IDirect3DDevice9
*
device
,
*
device2
,
*
device3
;
IDirect3DDeviceManager9
*
manager
;
IDirect3DDeviceManager9
*
manager
;
IDirect3DSurface9
*
surface
;
int
refcount
,
refcount2
;
int
refcount
,
refcount2
;
HANDLE
handle
,
handle1
;
HANDLE
handle
,
handle1
;
IDirect3D9
*
d3d
;
IDirect3D9
*
d3d
;
...
@@ -148,6 +150,46 @@ static void test_device_manager(void)
...
@@ -148,6 +150,46 @@ static void test_device_manager(void)
hr
=
IDirect3DDeviceManager9_TestDevice
(
manager
,
handle
);
hr
=
IDirect3DDeviceManager9_TestDevice
(
manager
,
handle
);
ok
(
hr
==
DXVA2_E_NEW_VIDEO_DEVICE
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
DXVA2_E_NEW_VIDEO_DEVICE
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* Acceleration service. */
hr
=
DXVA2CreateVideoService
(
device
,
&
IID_IDirectXVideoAccelerationService
,
(
void
**
)
&
accel_service
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectXVideoAccelerationService_CreateSurface
(
accel_service
,
64
,
64
,
1
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
0
,
DXVA2_VideoProcessorRenderTarget
,
&
surface
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to create a surface, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IDirect3DSurface9_Release
(
surface
);
IDirectXVideoAccelerationService_Release
(
accel_service
);
hr
=
IDirect3DDeviceManager9_OpenDeviceHandle
(
manager
,
&
handle
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDeviceManager9_GetVideoService
(
manager
,
handle
,
&
IID_IDirectXVideoAccelerationService
,
(
void
**
)
&
accel_service
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDeviceManager9_CloseDeviceHandle
(
manager
,
handle
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectXVideoAccelerationService_CreateSurface
(
accel_service
,
64
,
64
,
1
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
0
,
DXVA2_VideoProcessorRenderTarget
,
&
surface
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to create a surface, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DSurface9_GetDevice
(
surface
,
&
device3
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
device2
==
device3
,
"Unexpected device.
\n
"
);
IDirect3DDevice9_Release
(
device3
);
IDirect3DSurface9_Release
(
surface
);
}
IDirectXVideoAccelerationService_Release
(
accel_service
);
IDirect3DDevice9_Release
(
device
);
IDirect3DDevice9_Release
(
device
);
IDirect3DDevice9_Release
(
device2
);
IDirect3DDevice9_Release
(
device2
);
...
...
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