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
dce5f731
Commit
dce5f731
authored
Oct 04, 2022
by
Anton Baskanov
Committed by
Alexandre Julliard
Dec 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Add tests for MPEG layer-3 decoder sample timestamps.
Signed-off-by:
Anton Baskanov
<
baskanov@gmail.com
>
parent
54a59330
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
mpeglayer3.c
dlls/quartz/tests/mpeglayer3.c
+75
-0
No files found.
dlls/quartz/tests/mpeglayer3.c
View file @
dce5f731
...
...
@@ -784,6 +784,8 @@ struct testfilter
unsigned
int
got_sample
;
LONG
sample_size
;
LONG
sample_actual
;
REFERENCE_TIME
sample_start_time
;
REFERENCE_TIME
sample_stop_time
;
};
static
inline
struct
testfilter
*
impl_from_strmbase_filter
(
struct
strmbase_filter
*
iface
)
...
...
@@ -860,6 +862,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
;
++
filter
->
got_sample
;
...
...
@@ -869,6 +873,16 @@ static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample
filter
->
sample_actual
=
IMediaSample_GetActualDataLength
(
sample
);
}
start
=
0xdeadbeef
;
stop
=
0xdeadbeef
;
hr
=
IMediaSample_GetTime
(
sample
,
&
start
,
&
stop
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
if
(
filter
->
got_sample
==
1
)
{
filter
->
sample_start_time
=
start
;
filter
->
sample_stop_time
=
stop
;
}
return
S_OK
;
}
...
...
@@ -1019,6 +1033,7 @@ static void test_source_allocator(IFilterGraph2 *graph, IMediaControl *control,
static
void
test_sample_processing
(
IMediaControl
*
control
,
IMemInputPin
*
meminput
,
struct
testfilter
*
testsink
)
{
REFERENCE_TIME
start
,
stop
;
IMemAllocator
*
allocator
;
IMediaSample
*
sample
;
HRESULT
hr
;
...
...
@@ -1054,6 +1069,62 @@ static void test_sample_processing(IMediaControl *control,
hr
=
IMediaSample_SetActualDataLength
(
sample
,
144
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMediaSample_SetTime
(
sample
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
meminput
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
meminput
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
meminput
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
testsink
->
got_sample
>=
1
,
"Got %u calls to Receive().
\n
"
,
testsink
->
got_sample
);
ok
(
testsink
->
sample_size
==
2304
||
testsink
->
sample_size
==
9216
,
"Got size %lu.
\n
"
,
testsink
->
sample_size
);
ok
(
testsink
->
sample_actual
==
2304
||
testsink
->
sample_actual
==
4608
,
"Got valid size %lu.
\n
"
,
testsink
->
sample_actual
);
ok
(
testsink
->
sample_start_time
==
0
,
"Got start time %s.
\n
"
,
wine_dbgstr_longlong
(
testsink
->
sample_start_time
));
ok
(
testsink
->
sample_stop_time
==
(
testsink
->
sample_actual
==
2304
?
360000
:
720000
),
"Got stop time %s.
\n
"
,
wine_dbgstr_longlong
(
testsink
->
sample_stop_time
));
testsink
->
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
);
hr
=
IMemInputPin_Receive
(
meminput
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
meminput
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
meminput
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
testsink
->
got_sample
>=
1
,
"Got %u calls to Receive().
\n
"
,
testsink
->
got_sample
);
ok
(
testsink
->
sample_size
==
2304
||
testsink
->
sample_size
==
9216
,
"Got size %lu.
\n
"
,
testsink
->
sample_size
);
ok
(
testsink
->
sample_actual
==
2304
||
testsink
->
sample_actual
==
4608
,
"Got valid size %lu.
\n
"
,
testsink
->
sample_actual
);
ok
(
testsink
->
sample_start_time
==
22222
,
"Got start time %s.
\n
"
,
wine_dbgstr_longlong
(
testsink
->
sample_start_time
));
ok
(
testsink
->
sample_stop_time
==
(
testsink
->
sample_actual
==
2304
?
382222
:
742222
),
"Got stop time %s.
\n
"
,
wine_dbgstr_longlong
(
testsink
->
sample_stop_time
));
testsink
->
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
);
hr
=
IMemInputPin_Receive
(
meminput
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IMemInputPin_Receive
(
meminput
,
sample
);
...
...
@@ -1065,6 +1136,10 @@ static void test_sample_processing(IMediaControl *control,
"Got size %lu.
\n
"
,
testsink
->
sample_size
);
ok
(
testsink
->
sample_actual
==
2304
||
testsink
->
sample_actual
==
4608
,
"Got valid size %lu.
\n
"
,
testsink
->
sample_actual
);
ok
(
testsink
->
sample_start_time
==
22222
,
"Got start time %s.
\n
"
,
wine_dbgstr_longlong
(
testsink
->
sample_start_time
));
ok
(
testsink
->
sample_stop_time
==
(
testsink
->
sample_actual
==
2304
?
382222
:
742222
),
"Got stop time %s.
\n
"
,
wine_dbgstr_longlong
(
testsink
->
sample_stop_time
));
testsink
->
got_sample
=
0
;
hr
=
IMediaControl_Stop
(
control
);
...
...
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