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
5db4b0cf
Commit
5db4b0cf
authored
May 08, 2022
by
Anton Baskanov
Committed by
Alexandre Julliard
May 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Add tests for MPEG audio decoder sample timestamps.
Signed-off-by:
Anton Baskanov
<
baskanov@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
faf6f267
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
mpegaudio.c
dlls/quartz/tests/mpegaudio.c
+61
-0
No files found.
dlls/quartz/tests/mpegaudio.c
View file @
5db4b0cf
...
...
@@ -796,6 +796,8 @@ struct testfilter
struct
strmbase_sink
sink
;
const
AM_MEDIA_TYPE
*
mt
;
unsigned
int
got_sample
;
REFERENCE_TIME
expected_start_time
;
REFERENCE_TIME
expected_stop_time
;
};
static
inline
struct
testfilter
*
impl_from_strmbase_filter
(
struct
strmbase_filter
*
iface
)
...
...
@@ -872,6 +874,8 @@ static HRESULT testsink_connect(struct strmbase_sink *iface, IPin *peer, const A
static
HRESULT
WINAPI
testsink_Receive
(
struct
strmbase_sink
*
iface
,
IMediaSample
*
sample
)
{
struct
testfilter
*
filter
=
impl_from_strmbase_filter
(
iface
->
pin
.
filter
);
REFERENCE_TIME
start
,
stop
;
HRESULT
hr
;
LONG
size
;
++
filter
->
got_sample
;
...
...
@@ -881,6 +885,16 @@ static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample
size
=
IMediaSample_GetActualDataLength
(
sample
);
ok
(
size
==
768
,
"Got valid size %lu.
\n
"
,
size
);
start
=
0xdeadbeef
;
stop
=
0xdeadbeef
;
hr
=
IMediaSample_GetTime
(
sample
,
&
start
,
&
stop
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
if
(
filter
->
got_sample
==
1
)
{
todo_wine
ok
(
start
==
filter
->
expected_start_time
,
"Got start time %s.
\n
"
,
wine_dbgstr_longlong
(
start
));
todo_wine
ok
(
stop
==
filter
->
expected_stop_time
,
"Got stop time %s.
\n
"
,
wine_dbgstr_longlong
(
stop
));
}
return
S_OK
;
}
...
...
@@ -1060,6 +1074,7 @@ static void test_source_allocator(IFilterGraph2 *graph, IMediaControl *control,
static
void
test_sample_processing
(
IMediaControl
*
control
,
IMemInputPin
*
input
,
struct
testfilter
*
sink
)
{
REFERENCE_TIME
start
,
stop
;
IMemAllocator
*
allocator
;
IMediaSample
*
sample
;
HRESULT
hr
;
...
...
@@ -1095,6 +1110,52 @@ static void test_sample_processing(IMediaControl *control, IMemInputPin *input,
hr
=
IMediaSample_SetActualDataLength
(
sample
,
48
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMediaSample_SetTime
(
sample
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
sink
->
expected_start_time
=
0
;
sink
->
expected_stop_time
=
120000
;
hr
=
IMemInputPin_Receive
(
input
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
input
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
input
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
sink
->
got_sample
>=
1
,
"Got %u calls to Receive().
\n
"
,
sink
->
got_sample
);
sink
->
got_sample
=
0
;
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
start
=
22222
;
hr
=
IMediaSample_SetTime
(
sample
,
&
start
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
sink
->
expected_start_time
=
22222
;
sink
->
expected_stop_time
=
142222
;
hr
=
IMemInputPin_Receive
(
input
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
input
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
input
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
sink
->
got_sample
>=
1
,
"Got %u calls to Receive().
\n
"
,
sink
->
got_sample
);
sink
->
got_sample
=
0
;
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
start
=
22222
;
stop
=
33333
;
hr
=
IMediaSample_SetTime
(
sample
,
&
start
,
&
stop
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
sink
->
expected_start_time
=
22222
;
sink
->
expected_stop_time
=
142222
;
hr
=
IMemInputPin_Receive
(
input
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
input
,
sample
);
...
...
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