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
7aad298f
Commit
7aad298f
authored
Oct 29, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/tests: Add sample allocator test with surface-backed buffers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
99c1f2a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
27 deletions
+89
-27
evr.c
dlls/evr/tests/evr.c
+89
-27
No files found.
dlls/evr/tests/evr.c
View file @
7aad298f
...
...
@@ -1302,13 +1302,19 @@ static void test_MFCreateVideoSampleAllocator(void)
IMFVideoSampleAllocatorCallback
*
allocator_cb
;
IMFMediaType
*
media_type
,
*
video_type
;
IMFVideoSampleAllocator
*
allocator
;
IDirect3DDeviceManager9
*
manager
;
IMFSample
*
sample
,
*
sample2
;
IDirect3DSurface9
*
surface
;
IDirect3DDevice9
*
device
;
IMFMediaBuffer
*
buffer
;
unsigned
int
token
;
IMFGetService
*
gs
;
IDirect3D9
*
d3d
;
IUnknown
*
unk
;
HWND
window
;
HRESULT
hr
;
LONG
count
;
BYTE
*
data
;
hr
=
MFCreateVideoSampleAllocator
(
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -1387,48 +1393,104 @@ todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
count
==
4
,
"Unexpected count %d.
\n
"
,
count
);
if
(
sample
)
{
hr
=
IMFSample_QueryInterface
(
sample
,
&
IID_IMFDesiredSample
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
hr
=
IMFSample_QueryInterface
(
sample
,
&
IID_IMFDesiredSample
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
hr
=
IMFSample_QueryInterface
(
sample
,
&
IID_IMFTrackedSample
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
hr
=
IMFSample_QueryInterface
(
sample
,
&
IID_IMFTrackedSample
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
hr
=
IMFSample_GetBufferByIndex
(
sample
,
0
,
&
buffer
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_GetBufferByIndex
(
sample
,
0
,
&
buffer
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMFGetService
,
(
void
**
)
&
gs
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_NOINTERFACE
)
/* Win7 */
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMFGetService
,
(
void
**
)
&
gs
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_NOINTERFACE
)
/* Win7 */
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* Device manager wasn't set, sample gets regular memory buffers. */
if
(
SUCCEEDED
(
hr
))
{
hr
=
IMFGetService_GetService
(
gs
,
&
MR_BUFFER_SERVICE
,
&
IID_IDirect3DSurface9
,
(
void
**
)
&
surface
);
ok
(
hr
==
E_NOTIMPL
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFGetService_Release
(
gs
);
}
/* Device manager wasn't set, sample gets regular memory buffers. */
if
(
SUCCEEDED
(
hr
))
{
hr
=
IMFGetService_GetService
(
gs
,
&
MR_BUFFER_SERVICE
,
&
IID_IDirect3DSurface9
,
(
void
**
)
&
surface
);
ok
(
hr
==
E_NOTIMPL
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFGetService_Release
(
gs
);
}
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMF2DBuffer
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMF2DBuffer
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
IMFMediaBuffer_Release
(
buffer
);
IMFMediaBuffer_Release
(
buffer
);
IMFSample_Release
(
sample
);
}
IMFSample_Release
(
sample
);
IMFVideoSampleAllocatorCallback_Release
(
allocator_cb
);
IMFMediaType_Release
(
media_type
);
IMFVideoSampleAllocator_Release
(
allocator
);
hr
=
MFCreateVideoSampleAllocator
(
&
IID_IMFVideoSampleAllocatorCallback
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
/* Using device manager */
window
=
create_window
();
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
hr
=
DXVA2CreateDirect3DDeviceManager9
(
&
token
,
&
manager
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDeviceManager9_ResetDevice
(
manager
,
device
,
token
);
ok
(
hr
==
S_OK
,
"Failed to set a device, hr %#x.
\n
"
,
hr
);
hr
=
MFCreateVideoSampleAllocator
(
&
IID_IMFVideoSampleAllocator
,
(
void
**
)
&
allocator
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoSampleAllocator_SetDirectXManager
(
allocator
,
(
IUnknown
*
)
manager
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaType_SetUINT64
(
video_type
,
&
MF_MT_FRAME_SIZE
,
(
UINT64
)
320
<<
32
|
240
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoSampleAllocator_InitializeSampleAllocator
(
allocator
,
0
,
video_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoSampleAllocator_AllocateSample
(
allocator
,
&
sample
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_GetBufferByIndex
(
sample
,
0
,
&
buffer
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
MFGetService
((
IUnknown
*
)
buffer
,
&
MR_BUFFER_SERVICE
,
&
IID_IDirect3DSurface9
,
(
void
**
)
&
surface
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IDirect3DSurface9_Release
(
surface
);
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMF2DBuffer
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
unk
);
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaBuffer_Unlock
(
buffer
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFSample_Release
(
sample
);
IMFVideoSampleAllocator_Release
(
allocator
);
IMFMediaType_Release
(
media_type
);
IDirect3DDeviceManager9_Release
(
manager
);
IDirect3DDevice9_Release
(
device
);
done:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
struct
test_host
...
...
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