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
74b59516
Commit
74b59516
authored
Oct 31, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Test receiving EC_COMPLETE when not connected.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8ef3c68f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
305 additions
and
0 deletions
+305
-0
dsoundrender.c
dlls/quartz/tests/dsoundrender.c
+76
-0
videorenderer.c
dlls/quartz/tests/videorenderer.c
+67
-0
vmr7.c
dlls/quartz/tests/vmr7.c
+95
-0
vmr9.c
dlls/quartz/tests/vmr9.c
+67
-0
No files found.
dlls/quartz/tests/dsoundrender.c
View file @
74b59516
...
...
@@ -40,6 +40,15 @@ static IBaseFilter *create_dsound_render(void)
return
filter
;
}
static
IFilterGraph2
*
create_graph
(
void
)
{
IFilterGraph2
*
ret
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_FilterGraph
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFilterGraph2
,
(
void
**
)
&
ret
);
ok
(
hr
==
S_OK
,
"Failed to create FilterGraph: %#x
\n
"
,
hr
);
return
ret
;
}
static
inline
BOOL
compare_media_types
(
const
AM_MEDIA_TYPE
*
a
,
const
AM_MEDIA_TYPE
*
b
)
{
return
!
memcmp
(
a
,
b
,
offsetof
(
AM_MEDIA_TYPE
,
pbFormat
))
...
...
@@ -1314,6 +1323,72 @@ static void test_media_types(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_unconnected_eos
(
void
)
{
IBaseFilter
*
filter
=
create_dsound_render
();
IFilterGraph2
*
graph
=
create_graph
();
IMediaControl
*
control
;
IMediaEvent
*
eventsrc
;
unsigned
int
ret
;
HRESULT
hr
;
ULONG
ref
;
hr
=
IFilterGraph2_AddFilter
(
graph
,
filter
,
L"renderer"
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaEvent
,
(
void
**
)
&
eventsrc
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
IMediaControl_Release
(
control
);
IMediaEvent_Release
(
eventsrc
);
ref
=
IFilterGraph2_Release
(
graph
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
START_TEST
(
dsoundrender
)
{
IBaseFilter
*
filter
;
...
...
@@ -1343,6 +1418,7 @@ START_TEST(dsoundrender)
test_unconnected_filter_state
();
test_media_types
();
test_connect_pin
();
test_unconnected_eos
();
CoUninitialize
();
}
dlls/quartz/tests/videorenderer.c
View file @
74b59516
...
...
@@ -2865,6 +2865,72 @@ static void test_basic_video(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_unconnected_eos
(
void
)
{
IBaseFilter
*
filter
=
create_video_renderer
();
IFilterGraph2
*
graph
=
create_graph
();
IMediaControl
*
control
;
IMediaEvent
*
eventsrc
;
unsigned
int
ret
;
HRESULT
hr
;
ULONG
ref
;
hr
=
IFilterGraph2_AddFilter
(
graph
,
filter
,
L"renderer"
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaEvent
,
(
void
**
)
&
eventsrc
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
IMediaControl_Release
(
control
);
IMediaEvent_Release
(
eventsrc
);
ref
=
IFilterGraph2_Release
(
graph
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
START_TEST
(
videorenderer
)
{
CoInitialize
(
NULL
);
...
...
@@ -2881,6 +2947,7 @@ START_TEST(videorenderer)
test_overlay
();
test_video_window
();
test_basic_video
();
test_unconnected_eos
();
CoUninitialize
();
}
dlls/quartz/tests/vmr7.c
View file @
74b59516
...
...
@@ -1236,6 +1236,34 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IMediaControl *control
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
}
static
unsigned
int
check_event_code
(
IMediaEvent
*
eventsrc
,
DWORD
timeout
,
LONG
expected_code
,
LONG_PTR
expected1
,
LONG_PTR
expected2
)
{
LONG_PTR
param1
,
param2
;
unsigned
int
ret
=
0
;
HRESULT
hr
;
LONG
code
;
while
((
hr
=
IMediaEvent_GetEvent
(
eventsrc
,
&
code
,
&
param1
,
&
param2
,
timeout
))
==
S_OK
)
{
if
(
code
==
expected_code
)
{
ok
(
param1
==
expected1
,
"Got param1 %#lx.
\n
"
,
param1
);
ok
(
param2
==
expected2
,
"Got param2 %#lx.
\n
"
,
param2
);
ret
++
;
}
IMediaEvent_FreeEventParams
(
eventsrc
,
code
,
param1
,
param2
);
timeout
=
0
;
}
ok
(
hr
==
E_ABORT
,
"Got hr %#x.
\n
"
,
hr
);
return
ret
;
}
static
unsigned
int
check_ec_complete
(
IMediaEvent
*
eventsrc
,
DWORD
timeout
)
{
return
check_event_code
(
eventsrc
,
timeout
,
EC_COMPLETE
,
S_OK
,
0
);
}
static
void
test_current_image
(
IBaseFilter
*
filter
,
IMemInputPin
*
input
,
IMediaControl
*
control
,
const
BITMAPINFOHEADER
*
req_bih
)
{
...
...
@@ -3041,6 +3069,72 @@ out:
DestroyWindow
(
window
);
}
static
void
test_unconnected_eos
(
void
)
{
IFilterGraph2
*
graph
=
create_graph
();
IBaseFilter
*
filter
=
create_vmr7
(
0
);
IMediaControl
*
control
;
IMediaEvent
*
eventsrc
;
unsigned
int
ret
;
HRESULT
hr
;
ULONG
ref
;
hr
=
IFilterGraph2_AddFilter
(
graph
,
filter
,
L"renderer"
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaEvent
,
(
void
**
)
&
eventsrc
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
IMediaControl_Release
(
control
);
IMediaEvent_Release
(
eventsrc
);
ref
=
IFilterGraph2_Release
(
graph
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
START_TEST
(
vmr7
)
{
CoInitialize
(
NULL
);
...
...
@@ -3059,6 +3153,7 @@ START_TEST(vmr7)
test_video_window
();
test_basic_video
();
test_windowless_size
();
test_unconnected_eos
();
CoUninitialize
();
}
dlls/quartz/tests/vmr9.c
View file @
74b59516
...
...
@@ -4170,6 +4170,72 @@ static void test_mixing_prefs(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_unconnected_eos
(
void
)
{
IFilterGraph2
*
graph
=
create_graph
();
IBaseFilter
*
filter
=
create_vmr9
(
0
);
IMediaControl
*
control
;
IMediaEvent
*
eventsrc
;
unsigned
int
ret
;
HRESULT
hr
;
ULONG
ref
;
hr
=
IFilterGraph2_AddFilter
(
graph
,
filter
,
L"renderer"
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaEvent
,
(
void
**
)
&
eventsrc
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
IMediaControl_Release
(
control
);
IMediaEvent_Release
(
eventsrc
);
ref
=
IFilterGraph2_Release
(
graph
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
START_TEST
(
vmr9
)
{
IBaseFilter
*
filter
;
...
...
@@ -4205,6 +4271,7 @@ START_TEST(vmr9)
test_basic_video
();
test_windowless_size
();
test_mixing_prefs
();
test_unconnected_eos
();
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