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
c768dbf9
Commit
c768dbf9
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 tests for allocator management by the video capture filter.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1e16595c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
2 deletions
+36
-2
videocapture.c
dlls/qcap/tests/videocapture.c
+36
-2
No files found.
dlls/qcap/tests/videocapture.c
View file @
c768dbf9
...
...
@@ -360,8 +360,9 @@ 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
)
static
void
test_filter_state
(
IMediaControl
*
control
,
IMemAllocator
*
allocator
)
{
IMediaSample
*
sample
;
OAFilterState
state
;
HRESULT
hr
;
...
...
@@ -369,6 +370,9 @@ static void test_filter_state(IMediaControl *control)
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Stopped
,
"Got state %u.
\n
"
,
state
);
hr
=
IMemAllocator_GetBuffer
(
allocator
,
&
sample
,
NULL
,
NULL
,
0
);
ok
(
hr
==
VFW_E_NOT_COMMITTED
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
@@ -376,6 +380,10 @@ static void test_filter_state(IMediaControl *control)
ok
(
hr
==
VFW_S_CANT_CUE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Paused
,
"Got state %u.
\n
"
,
state
);
hr
=
IMemAllocator_GetBuffer
(
allocator
,
&
sample
,
NULL
,
NULL
,
AM_GBF_NOWAIT
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
IMediaSample_Release
(
sample
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
@@ -397,6 +405,9 @@ static void test_filter_state(IMediaControl *control)
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Stopped
,
"Got state %u.
\n
"
,
state
);
hr
=
IMemAllocator_GetBuffer
(
allocator
,
&
sample
,
NULL
,
NULL
,
0
);
ok
(
hr
==
VFW_E_NOT_COMMITTED
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
@@ -404,12 +415,33 @@ static void test_filter_state(IMediaControl *control)
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Running
,
"Got state %u.
\n
"
,
state
);
hr
=
IMemAllocator_GetBuffer
(
allocator
,
&
sample
,
NULL
,
NULL
,
AM_GBF_NOWAIT
);
todo_wine
ok
(
hr
==
VFW_E_TIMEOUT
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IMediaSample_Release
(
sample
);
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
=
IMemAllocator_GetBuffer
(
allocator
,
&
sample
,
NULL
,
NULL
,
0
);
ok
(
hr
==
VFW_E_NOT_COMMITTED
,
"Got hr %#x.
\n
"
,
hr
);
/* Test committing the allocator before the capture filter does. */
hr
=
IMemAllocator_Commit
(
allocator
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_Pause
(
control
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMemAllocator_Decommit
(
allocator
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
}
static
void
test_connect_pin
(
IBaseFilter
*
filter
,
IPin
*
source
)
...
...
@@ -460,7 +492,9 @@ 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
);
ok
(
!!
testsink
.
sink
.
pAllocator
,
"Expected to be assigned an allocator.
\n
"
);
test_filter_state
(
control
,
testsink
.
sink
.
pAllocator
);
hr
=
IPin_ConnectedTo
(
source
,
&
peer
);
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