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
1e16595c
Commit
1e16595c
authored
Jun 14, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/tests: Add some tests for filter state on the video capture filter.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bcb261b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
videocapture.c
dlls/qcap/tests/videocapture.c
+57
-0
No files found.
dlls/qcap/tests/videocapture.c
View file @
1e16595c
...
...
@@ -360,12 +360,65 @@ static void testfilter_init(struct testfilter *filter)
strmbase_sink_init
(
&
filter
->
sink
,
&
filter
->
filter
,
L"sink"
,
&
testsink_ops
,
NULL
);
}
static
void
test_filter_state
(
IMediaControl
*
control
)
{
OAFilterState
state
;
HRESULT
hr
;
hr
=
IMediaControl_GetState
(
control
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Stopped
,
"Got state %u.
\n
"
,
state
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_GetState
(
control
,
0
,
&
state
);
ok
(
hr
==
VFW_S_CANT_CUE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Paused
,
"Got state %u.
\n
"
,
state
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_GetState
(
control
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Running
,
"Got state %u.
\n
"
,
state
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_GetState
(
control
,
0
,
&
state
);
ok
(
hr
==
VFW_S_CANT_CUE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Paused
,
"Got state %u.
\n
"
,
state
);
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_GetState
(
control
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Stopped
,
"Got state %u.
\n
"
,
state
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_GetState
(
control
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Running
,
"Got state %u.
\n
"
,
state
);
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_GetState
(
control
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Stopped
,
"Got state %u.
\n
"
,
state
);
}
static
void
test_connect_pin
(
IBaseFilter
*
filter
,
IPin
*
source
)
{
AM_MEDIA_TYPE
req_mt
,
default_mt
,
mt
,
*
mts
[
2
];
IAMStreamConfig
*
stream_config
;
struct
testfilter
testsink
;
IEnumMediaTypes
*
enummt
;
IMediaControl
*
control
;
IFilterGraph2
*
graph
;
ULONG
count
,
ref
;
HRESULT
hr
;
...
...
@@ -373,6 +426,7 @@ static void test_connect_pin(IBaseFilter *filter, IPin *source)
CoCreateInstance
(
&
CLSID_FilterGraph
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFilterGraph2
,
(
void
**
)
&
graph
);
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
testfilter_init
(
&
testsink
);
IFilterGraph2_AddFilter
(
graph
,
&
testsink
.
filter
.
IBaseFilter_iface
,
L"sink"
);
IFilterGraph2_AddFilter
(
graph
,
filter
,
L"source"
);
...
...
@@ -406,6 +460,8 @@ static void test_connect_pin(IBaseFilter *filter, IPin *source)
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
source
,
&
testsink
.
sink
.
pin
.
IPin_iface
,
&
req_mt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
test_filter_state
(
control
);
hr
=
IPin_ConnectedTo
(
source
,
&
peer
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
peer
==
&
testsink
.
sink
.
pin
.
IPin_iface
,
"Got peer %p.
\n
"
,
peer
);
...
...
@@ -445,6 +501,7 @@ static void test_connect_pin(IBaseFilter *filter, IPin *source)
FreeMediaType
(
&
req_mt
);
FreeMediaType
(
&
default_mt
);
IAMStreamConfig_Release
(
stream_config
);
IMediaControl_Release
(
control
);
ref
=
IFilterGraph2_Release
(
graph
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IBaseFilter_Release
(
&
testsink
.
filter
.
IBaseFilter_iface
);
...
...
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