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
309f0a0d
Commit
309f0a0d
authored
Feb 10, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Add some tests for IBasicVideo::GetCurrentImage().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ca2ad6ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
275 additions
and
0 deletions
+275
-0
videorenderer.c
dlls/quartz/tests/videorenderer.c
+76
-0
vmr7.c
dlls/quartz/tests/vmr7.c
+101
-0
vmr9.c
dlls/quartz/tests/vmr9.c
+98
-0
No files found.
dlls/quartz/tests/videorenderer.c
View file @
309f0a0d
...
...
@@ -1071,6 +1071,81 @@ static void test_eos(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
IMediaControl_Release
(
control
);
}
static
void
test_current_image
(
IBaseFilter
*
filter
,
IMemInputPin
*
input
,
IFilterGraph2
*
graph
,
const
BITMAPINFOHEADER
*
expect_bih
)
{
LONG
buffer
[(
sizeof
(
BITMAPINFOHEADER
)
+
32
*
16
*
2
)
/
4
];
const
BITMAPINFOHEADER
*
bih
=
(
BITMAPINFOHEADER
*
)
buffer
;
IMediaControl
*
control
;
OAFilterState
state
;
IBasicVideo
*
video
;
unsigned
int
i
;
HANDLE
thread
;
HRESULT
hr
;
LONG
size
;
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
IBaseFilter_QueryInterface
(
filter
,
&
IID_IBasicVideo
,
(
void
**
)
&
video
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
NULL
,
buffer
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
size
=
0xdeadbeef
;
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
sizeof
(
BITMAPINFOHEADER
)
+
32
*
16
*
2
,
"Got size %d.
\n
"
,
size
);
size
=
0xdeadbeef
;
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
ok
(
hr
==
VFW_E_NOT_PAUSED
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
0xdeadbeef
,
"Got size %d.
\n
"
,
size
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
size
=
0xdeadbeef
;
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
ok
(
hr
==
E_UNEXPECTED
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
0xdeadbeef
,
"Got size %d.
\n
"
,
size
);
thread
=
send_frame
(
input
);
hr
=
IMediaControl_GetState
(
control
,
1000
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
size
=
sizeof
(
BITMAPINFOHEADER
)
+
32
*
16
*
2
-
1
;
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
todo_wine
ok
(
hr
==
E_OUTOFMEMORY
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
sizeof
(
BITMAPINFOHEADER
)
+
32
*
16
*
2
-
1
,
"Got size %d.
\n
"
,
size
);
size
=
sizeof
(
BITMAPINFOHEADER
)
+
32
*
16
*
2
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
));
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
BITMAPINFOHEADER
)
+
32
*
16
*
2
,
"Got size %d.
\n
"
,
size
);
ok
(
!
memcmp
(
bih
,
expect_bih
,
sizeof
(
BITMAPINFOHEADER
)),
"Bitmap headers didn't match.
\n
"
);
for
(
i
=
0
;
i
<
32
*
16
*
2
;
++
i
)
{
const
unsigned
char
*
data
=
(
unsigned
char
*
)
buffer
+
sizeof
(
BITMAPINFOHEADER
);
ok
(
data
[
i
]
==
0x55
,
"Got unexpected byte %02x at %u.
\n
"
,
data
[
i
],
i
);
}
hr
=
IMediaControl_Run
(
control
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
join_thread
(
thread
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
ok
(
hr
==
VFW_E_NOT_PAUSED
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
IBasicVideo_Release
(
video
);
IMediaControl_Release
(
control
);
}
static
void
test_connect_pin
(
void
)
{
VIDEOINFOHEADER
vih
=
...
...
@@ -1178,6 +1253,7 @@ static void test_connect_pin(void)
test_flushing
(
pin
,
input
,
graph
);
test_sample_time
(
pin
,
input
,
graph
);
test_eos
(
pin
,
input
,
graph
);
test_current_image
(
filter
,
input
,
graph
,
&
vih
.
bmiHeader
);
hr
=
IFilterGraph2_Disconnect
(
graph
,
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
dlls/quartz/tests/vmr7.c
View file @
309f0a0d
...
...
@@ -1223,6 +1223,106 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
IMediaControl_Release
(
control
);
}
static
void
test_current_image
(
IBaseFilter
*
filter
,
IMemInputPin
*
input
,
IFilterGraph2
*
graph
,
const
BITMAPINFOHEADER
*
req_bih
)
{
LONG
buffer
[(
sizeof
(
BITMAPINFOHEADER
)
+
32
*
16
*
4
)
/
4
];
const
BITMAPINFOHEADER
*
bih
=
(
BITMAPINFOHEADER
*
)
buffer
;
const
DWORD
*
data
=
(
DWORD
*
)((
char
*
)
buffer
+
sizeof
(
BITMAPINFOHEADER
));
BITMAPINFOHEADER
expect_bih
=
*
req_bih
;
IMemAllocator
*
allocator
;
IMediaControl
*
control
;
OAFilterState
state
;
IBasicVideo
*
video
;
unsigned
int
i
;
HANDLE
thread
;
HRESULT
hr
;
LONG
size
;
/* Note that the bitmap returned by GetCurrentImage() has a bit depth of
* 32 regardless of the format used for pin connection. */
expect_bih
.
biBitCount
=
32
;
expect_bih
.
biSizeImage
=
32
*
16
*
4
;
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
IBaseFilter_QueryInterface
(
filter
,
&
IID_IBasicVideo
,
(
void
**
)
&
video
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
NULL
,
buffer
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
size
=
0xdeadbeef
;
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
sizeof
(
BITMAPINFOHEADER
)
+
32
*
16
*
4
,
"Got size %d.
\n
"
,
size
);
size
=
sizeof
(
buffer
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
buffer
),
"Got size %d.
\n
"
,
size
);
todo_wine
ok
(
!
memcmp
(
bih
,
&
expect_bih
,
sizeof
(
BITMAPINFOHEADER
)),
"Bitmap headers didn't match.
\n
"
);
/* The contents seem to reflect the last frame rendered. */
hr
=
IMemInputPin_GetAllocator
(
input
,
&
allocator
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMemAllocator_Commit
(
allocator
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
IMemAllocator_Release
(
allocator
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
size
=
sizeof
(
buffer
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
buffer
),
"Got size %d.
\n
"
,
size
);
todo_wine
ok
(
!
memcmp
(
bih
,
&
expect_bih
,
sizeof
(
BITMAPINFOHEADER
)),
"Bitmap headers didn't match.
\n
"
);
/* The contents seem to reflect the last frame rendered. */
thread
=
send_frame
(
input
);
hr
=
IMediaControl_GetState
(
control
,
1000
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
size
=
1
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
));
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
1
,
"Got size %d.
\n
"
,
size
);
size
=
sizeof
(
buffer
);
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
));
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
buffer
),
"Got size %d.
\n
"
,
size
);
todo_wine
ok
(
!
memcmp
(
bih
,
&
expect_bih
,
sizeof
(
BITMAPINFOHEADER
)),
"Bitmap headers didn't match.
\n
"
);
for
(
i
=
0
;
i
<
32
*
16
;
++
i
)
ok
((
data
[
i
]
&
0xffffff
)
==
0x555555
,
"Got unexpected color %08x at %u.
\n
"
,
data
[
i
],
i
);
hr
=
IMediaControl_Run
(
control
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
join_thread
(
thread
);
size
=
sizeof
(
buffer
);
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
));
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
buffer
),
"Got size %d.
\n
"
,
size
);
if
(
hr
==
S_OK
)
{
ok
(
!
memcmp
(
bih
,
&
expect_bih
,
sizeof
(
BITMAPINFOHEADER
)),
"Bitmap headers didn't match.
\n
"
);
for
(
i
=
0
;
i
<
32
*
16
;
++
i
)
ok
((
data
[
i
]
&
0xffffff
)
==
0x555555
,
"Got unexpected color %08x at %u.
\n
"
,
data
[
i
],
i
);
}
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
IBasicVideo_Release
(
video
);
IMediaControl_Release
(
control
);
}
static
void
test_connect_pin
(
void
)
{
VIDEOINFOHEADER
vih
=
...
...
@@ -1361,6 +1461,7 @@ static void test_connect_pin(void)
test_filter_state
(
input
,
graph
);
test_flushing
(
pin
,
input
,
graph
);
test_current_image
(
filter
,
input
,
graph
,
&
vih
.
bmiHeader
);
hr
=
IFilterGraph2_Disconnect
(
graph
,
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
dlls/quartz/tests/vmr9.c
View file @
309f0a0d
...
...
@@ -1227,6 +1227,103 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
IMediaControl_Release
(
control
);
}
static
void
test_current_image
(
IBaseFilter
*
filter
,
IMemInputPin
*
input
,
IFilterGraph2
*
graph
,
const
BITMAPINFOHEADER
*
req_bih
)
{
LONG
buffer
[(
sizeof
(
BITMAPINFOHEADER
)
+
32
*
16
*
4
)
/
4
];
const
BITMAPINFOHEADER
*
bih
=
(
BITMAPINFOHEADER
*
)
buffer
;
const
DWORD
*
data
=
(
DWORD
*
)((
char
*
)
buffer
+
sizeof
(
BITMAPINFOHEADER
));
BITMAPINFOHEADER
expect_bih
=
*
req_bih
;
IMemAllocator
*
allocator
;
IMediaControl
*
control
;
OAFilterState
state
;
IBasicVideo
*
video
;
unsigned
int
i
;
HANDLE
thread
;
HRESULT
hr
;
LONG
size
;
expect_bih
.
biSizeImage
=
32
*
16
*
4
;
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
IBaseFilter_QueryInterface
(
filter
,
&
IID_IBasicVideo
,
(
void
**
)
&
video
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
NULL
,
buffer
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
size
=
0xdeadbeef
;
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
sizeof
(
BITMAPINFOHEADER
)
+
32
*
16
*
4
,
"Got size %d.
\n
"
,
size
);
size
=
sizeof
(
buffer
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
buffer
),
"Got size %d.
\n
"
,
size
);
todo_wine
ok
(
!
memcmp
(
bih
,
&
expect_bih
,
sizeof
(
BITMAPINFOHEADER
)),
"Bitmap headers didn't match.
\n
"
);
/* The contents seem to reflect the last frame rendered. */
hr
=
IMemInputPin_GetAllocator
(
input
,
&
allocator
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMemAllocator_Commit
(
allocator
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
IMemAllocator_Release
(
allocator
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
size
=
sizeof
(
buffer
);
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
buffer
),
"Got size %d.
\n
"
,
size
);
todo_wine
ok
(
!
memcmp
(
bih
,
&
expect_bih
,
sizeof
(
BITMAPINFOHEADER
)),
"Bitmap headers didn't match.
\n
"
);
/* The contents seem to reflect the last frame rendered. */
thread
=
send_frame
(
input
);
hr
=
IMediaControl_GetState
(
control
,
1000
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
size
=
1
;
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
));
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
1
,
"Got size %d.
\n
"
,
size
);
size
=
sizeof
(
buffer
);
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
));
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
buffer
),
"Got size %d.
\n
"
,
size
);
todo_wine
ok
(
!
memcmp
(
bih
,
&
expect_bih
,
sizeof
(
BITMAPINFOHEADER
)),
"Bitmap headers didn't match.
\n
"
);
for
(
i
=
0
;
i
<
32
*
16
;
++
i
)
ok
((
data
[
i
]
&
0xffffff
)
==
0x555555
,
"Got unexpected color %08x at %u.
\n
"
,
data
[
i
],
i
);
hr
=
IMediaControl_Run
(
control
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
join_thread
(
thread
);
size
=
sizeof
(
buffer
);
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
));
hr
=
IBasicVideo_GetCurrentImage
(
video
,
&
size
,
buffer
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
buffer
),
"Got size %d.
\n
"
,
size
);
if
(
hr
==
S_OK
)
{
ok
(
!
memcmp
(
bih
,
&
expect_bih
,
sizeof
(
BITMAPINFOHEADER
)),
"Bitmap headers didn't match.
\n
"
);
for
(
i
=
0
;
i
<
32
*
16
;
++
i
)
ok
((
data
[
i
]
&
0xffffff
)
==
0x555555
,
"Got unexpected color %08x at %u.
\n
"
,
data
[
i
],
i
);
}
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
IBasicVideo_Release
(
video
);
IMediaControl_Release
(
control
);
}
static
void
test_connect_pin
(
void
)
{
VIDEOINFOHEADER
vih
=
...
...
@@ -1364,6 +1461,7 @@ static void test_connect_pin(void)
test_filter_state
(
input
,
graph
);
test_flushing
(
pin
,
input
,
graph
);
test_current_image
(
filter
,
input
,
graph
,
&
vih
.
bmiHeader
);
hr
=
IFilterGraph2_Disconnect
(
graph
,
pin
);
ok
(
hr
==
S_OK
,
"Got 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