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
348205b0
Commit
348205b0
authored
May 04, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
May 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/tests: Test audio capture allocator properties.
parent
c808b30b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
0 deletions
+82
-0
audiorecord.c
dlls/qcap/tests/audiorecord.c
+82
-0
No files found.
dlls/qcap/tests/audiorecord.c
View file @
348205b0
...
...
@@ -547,6 +547,86 @@ static void testfilter_init(struct testfilter *filter)
strmbase_sink_init
(
&
filter
->
sink
,
&
filter
->
filter
,
L"sink"
,
&
testsink_ops
,
NULL
);
}
static
void
test_source_allocator
(
IFilterGraph2
*
graph
,
IMediaControl
*
control
,
IPin
*
source
,
struct
testfilter
*
testsink
)
{
ALLOCATOR_PROPERTIES
props
,
req_props
=
{
2
,
3200
,
32
,
0
};
IMemAllocator
*
allocator
;
IMediaSample
*
sample
;
WAVEFORMATEX
format
;
AM_MEDIA_TYPE
mt
;
HRESULT
hr
;
init_pcm_mt
(
&
mt
,
&
format
,
1
,
32000
,
16
);
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
source
,
&
testsink
->
sink
.
pin
.
IPin_iface
,
&
mt
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
!!
testsink
->
sink
.
pAllocator
,
"Expected an allocator.
\n
"
);
hr
=
IMemAllocator_GetProperties
(
testsink
->
sink
.
pAllocator
,
&
props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
props
.
cBuffers
==
4
,
"Got %ld buffers.
\n
"
,
props
.
cBuffers
);
ok
(
props
.
cbBuffer
==
32000
,
"Got size %ld.
\n
"
,
props
.
cbBuffer
);
ok
(
props
.
cbAlign
==
1
,
"Got alignment %ld.
\n
"
,
props
.
cbAlign
);
ok
(
!
props
.
cbPrefix
,
"Got prefix %ld.
\n
"
,
props
.
cbPrefix
);
hr
=
IMemAllocator_GetBuffer
(
testsink
->
sink
.
pAllocator
,
&
sample
,
NULL
,
NULL
,
0
);
ok
(
hr
==
VFW_E_NOT_COMMITTED
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemAllocator_GetBuffer
(
testsink
->
sink
.
pAllocator
,
&
sample
,
NULL
,
NULL
,
AM_GBF_NOWAIT
);
todo_wine
ok
(
hr
==
VFW_E_TIMEOUT
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemAllocator_GetBuffer
(
testsink
->
sink
.
pAllocator
,
&
sample
,
NULL
,
NULL
,
0
);
ok
(
hr
==
VFW_E_NOT_COMMITTED
,
"Got hr %#lx.
\n
"
,
hr
);
IFilterGraph2_Disconnect
(
graph
,
source
);
IFilterGraph2_Disconnect
(
graph
,
&
testsink
->
sink
.
pin
.
IPin_iface
);
init_pcm_mt
(
&
mt
,
&
format
,
1
,
32000
,
8
);
format
.
nAvgBytesPerSec
=
127
;
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
source
,
&
testsink
->
sink
.
pin
.
IPin_iface
,
&
mt
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
!!
testsink
->
sink
.
pAllocator
,
"Expected an allocator.
\n
"
);
hr
=
IMemAllocator_GetProperties
(
testsink
->
sink
.
pAllocator
,
&
props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
props
.
cBuffers
==
4
,
"Got %ld buffers.
\n
"
,
props
.
cBuffers
);
ok
(
props
.
cbBuffer
==
62
,
"Got size %ld.
\n
"
,
props
.
cbBuffer
);
ok
(
props
.
cbAlign
==
1
,
"Got alignment %ld.
\n
"
,
props
.
cbAlign
);
ok
(
!
props
.
cbPrefix
,
"Got prefix %ld.
\n
"
,
props
.
cbPrefix
);
IFilterGraph2_Disconnect
(
graph
,
source
);
IFilterGraph2_Disconnect
(
graph
,
&
testsink
->
sink
.
pin
.
IPin_iface
);
CoCreateInstance
(
&
CLSID_MemoryAllocator
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMemAllocator
,
(
void
**
)
&
allocator
);
testsink
->
sink
.
pAllocator
=
allocator
;
hr
=
IMemAllocator_SetProperties
(
allocator
,
&
req_props
,
&
props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
init_pcm_mt
(
&
mt
,
&
format
,
1
,
32000
,
16
);
hr
=
IFilterGraph2_ConnectDirect
(
graph
,
source
,
&
testsink
->
sink
.
pin
.
IPin_iface
,
&
mt
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
testsink
->
sink
.
pAllocator
&&
testsink
->
sink
.
pAllocator
!=
allocator
,
"Got unexpected allocator %p.
\n
"
,
testsink
->
sink
.
pAllocator
);
hr
=
IMemAllocator_GetProperties
(
testsink
->
sink
.
pAllocator
,
&
props
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
props
.
cBuffers
==
4
,
"Got %ld buffers.
\n
"
,
props
.
cBuffers
);
ok
(
props
.
cbBuffer
==
32000
,
"Got size %ld.
\n
"
,
props
.
cbBuffer
);
ok
(
props
.
cbAlign
==
1
,
"Got alignment %ld.
\n
"
,
props
.
cbAlign
);
ok
(
!
props
.
cbPrefix
,
"Got prefix %ld.
\n
"
,
props
.
cbPrefix
);
IFilterGraph2_Disconnect
(
graph
,
source
);
IFilterGraph2_Disconnect
(
graph
,
&
testsink
->
sink
.
pin
.
IPin_iface
);
}
static
void
test_connect_pin
(
IBaseFilter
*
filter
)
{
AM_MEDIA_TYPE
mt
,
req_mt
,
*
source_mt
;
...
...
@@ -567,6 +647,8 @@ static void test_connect_pin(IBaseFilter *filter)
IBaseFilter_FindPin
(
filter
,
L"Capture"
,
&
source
);
test_source_allocator
(
graph
,
control
,
source
,
&
testsink
);
peer
=
(
IPin
*
)
0xdeadbeef
;
hr
=
IPin_ConnectedTo
(
source
,
&
peer
);
ok
(
hr
==
VFW_E_NOT_CONNECTED
,
"Got hr %#lx.
\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