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
fd159a35
Commit
fd159a35
authored
May 11, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
May 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Add some tests for windowless video size.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
34648344
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
132 additions
and
0 deletions
+132
-0
vmr9.c
dlls/quartz/tests/vmr9.c
+132
-0
No files found.
dlls/quartz/tests/vmr9.c
View file @
fd159a35
...
...
@@ -3746,6 +3746,137 @@ out:
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_windowless_size
(
void
)
{
ALLOCATOR_PROPERTIES
req_props
=
{
1
,
32
*
16
*
4
,
1
,
0
},
ret_props
;
VIDEOINFOHEADER
vih
=
{
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
),
.
bmiHeader
.
biWidth
=
32
,
.
bmiHeader
.
biHeight
=
16
,
.
bmiHeader
.
biBitCount
=
32
,
.
bmiHeader
.
biPlanes
=
1
,
};
AM_MEDIA_TYPE
mt
=
{
.
majortype
=
MEDIATYPE_Video
,
.
subtype
=
MEDIASUBTYPE_RGB32
,
.
formattype
=
FORMAT_VideoInfo
,
.
cbFormat
=
sizeof
(
vih
),
.
pbFormat
=
(
BYTE
*
)
&
vih
,
};
IBaseFilter
*
filter
=
create_vmr9
(
VMR9Mode_Windowless
);
LONG
width
,
height
,
aspect_width
,
aspect_height
;
IVMRWindowlessControl9
*
windowless_control
;
IFilterGraph2
*
graph
=
create_graph
();
struct
testfilter
source
;
IMemAllocator
*
allocator
;
RECT
src
,
dst
,
expect
;
IMemInputPin
*
input
;
HWND
window
;
HRESULT
hr
;
ULONG
ref
;
IPin
*
pin
;
IBaseFilter_QueryInterface
(
filter
,
&
IID_IVMRWindowlessControl9
,
(
void
**
)
&
windowless_control
);
IBaseFilter_FindPin
(
filter
,
L"VMR Input0"
,
&
pin
);
IPin_QueryInterface
(
pin
,
&
IID_IMemInputPin
,
(
void
**
)
&
input
);
testfilter_init
(
&
source
);
IFilterGraph2_AddFilter
(
graph
,
&
source
.
filter
.
IBaseFilter_iface
,
L"source"
);
IFilterGraph2_AddFilter
(
graph
,
filter
,
L"vmr9"
);
window
=
CreateWindowA
(
"static"
,
"quartz_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
ok
(
!!
window
,
"Failed to create a window.
\n
"
);
hr
=
IVMRWindowlessControl9_SetVideoClippingWindow
(
windowless_control
,
window
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
&
source
.
source
.
pin
.
IPin_iface
,
pin
,
&
mt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMemInputPin_GetAllocator
(
input
,
&
allocator
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
hr
=
IMemAllocator_SetProperties
(
allocator
,
&
req_props
,
&
ret_props
);
IMemAllocator_Release
(
allocator
);
if
(
hr
==
E_FAIL
)
{
skip
(
"Got E_FAIL when setting allocator properties.
\n
"
);
goto
out
;
}
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
memcmp
(
&
ret_props
,
&
req_props
,
sizeof
(
req_props
)),
"Properties did not match.
\n
"
);
}
hr
=
IVMRWindowlessControl9_GetNativeVideoSize
(
windowless_control
,
NULL
,
&
height
,
&
aspect_width
,
&
aspect_height
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IVMRWindowlessControl9_GetNativeVideoSize
(
windowless_control
,
&
width
,
NULL
,
&
aspect_width
,
&
aspect_height
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
width
=
height
=
0xdeadbeef
;
hr
=
IVMRWindowlessControl9_GetNativeVideoSize
(
windowless_control
,
&
width
,
&
height
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
width
==
32
,
"Got width %d.
\n
"
,
width
);
todo_wine
ok
(
height
==
16
,
"Got height %d.
\n
"
,
height
);
aspect_width
=
aspect_height
=
0xdeadbeef
;
hr
=
IVMRWindowlessControl9_GetNativeVideoSize
(
windowless_control
,
&
width
,
&
height
,
&
aspect_width
,
&
aspect_height
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
aspect_width
==
32
,
"Got width %d.
\n
"
,
aspect_width
);
ok
(
aspect_height
==
16
,
"Got height %d.
\n
"
,
aspect_height
);
memset
(
&
src
,
0xcc
,
sizeof
(
src
));
hr
=
IVMRWindowlessControl9_GetVideoPosition
(
windowless_control
,
&
src
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
SetRect
(
&
expect
,
0
,
0
,
32
,
16
);
ok
(
EqualRect
(
&
src
,
&
expect
),
"Got source rect %s.
\n
"
,
wine_dbgstr_rect
(
&
src
));
memset
(
&
dst
,
0xcc
,
sizeof
(
dst
));
hr
=
IVMRWindowlessControl9_GetVideoPosition
(
windowless_control
,
NULL
,
&
dst
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
SetRect
(
&
expect
,
0
,
0
,
0
,
0
);
todo_wine
ok
(
EqualRect
(
&
dst
,
&
expect
),
"Got dest rect %s.
\n
"
,
wine_dbgstr_rect
(
&
dst
));
SetRect
(
&
src
,
4
,
6
,
16
,
12
);
hr
=
IVMRWindowlessControl9_SetVideoPosition
(
windowless_control
,
&
src
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
memset
(
&
src
,
0xcc
,
sizeof
(
src
));
memset
(
&
dst
,
0xcc
,
sizeof
(
dst
));
hr
=
IVMRWindowlessControl9_GetVideoPosition
(
windowless_control
,
&
src
,
&
dst
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
SetRect
(
&
expect
,
4
,
6
,
16
,
12
);
ok
(
EqualRect
(
&
src
,
&
expect
),
"Got source rect %s.
\n
"
,
wine_dbgstr_rect
(
&
src
));
SetRect
(
&
expect
,
0
,
0
,
0
,
0
);
todo_wine
ok
(
EqualRect
(
&
dst
,
&
expect
),
"Got dest rect %s.
\n
"
,
wine_dbgstr_rect
(
&
dst
));
SetRect
(
&
dst
,
40
,
60
,
120
,
160
);
hr
=
IVMRWindowlessControl9_SetVideoPosition
(
windowless_control
,
NULL
,
&
dst
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
memset
(
&
src
,
0xcc
,
sizeof
(
src
));
memset
(
&
dst
,
0xcc
,
sizeof
(
dst
));
hr
=
IVMRWindowlessControl9_GetVideoPosition
(
windowless_control
,
&
src
,
&
dst
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
SetRect
(
&
expect
,
4
,
6
,
16
,
12
);
ok
(
EqualRect
(
&
src
,
&
expect
),
"Got source rect %s.
\n
"
,
wine_dbgstr_rect
(
&
src
));
SetRect
(
&
expect
,
40
,
60
,
120
,
160
);
todo_wine
ok
(
EqualRect
(
&
dst
,
&
expect
),
"Got dest rect %s.
\n
"
,
wine_dbgstr_rect
(
&
dst
));
GetWindowRect
(
window
,
&
src
);
SetRect
(
&
expect
,
0
,
0
,
640
,
480
);
ok
(
EqualRect
(
&
src
,
&
expect
),
"Got window rect %s.
\n
"
,
wine_dbgstr_rect
(
&
src
));
out:
ref
=
IFilterGraph2_Release
(
graph
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
IMemInputPin_Release
(
input
);
IPin_Release
(
pin
);
IVMRWindowlessControl9_Release
(
windowless_control
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
DestroyWindow
(
window
);
}
START_TEST
(
vmr9
)
{
IBaseFilter
*
filter
;
...
...
@@ -3779,6 +3910,7 @@ START_TEST(vmr9)
test_clipping_window
();
test_surface_allocator_notify_refcount
();
test_basic_video
();
test_windowless_size
();
CoUninitialize
();
}
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