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
48552496
Commit
48552496
authored
Nov 19, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Add some tests for streaming events on the AVI decoder.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cd3b23c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
115 additions
and
1 deletion
+115
-1
avidec.c
dlls/quartz/tests/avidec.c
+115
-1
No files found.
dlls/quartz/tests/avidec.c
View file @
48552496
...
@@ -116,6 +116,7 @@ static LRESULT CALLBACK vfw_driver_proc(DWORD_PTR id, HDRVR driver, UINT msg,
...
@@ -116,6 +116,7 @@ static LRESULT CALLBACK vfw_driver_proc(DWORD_PTR id, HDRVR driver, UINT msg,
BITMAPINFOHEADER
*
out
=
(
BITMAPINFOHEADER
*
)
lparam2
;
BITMAPINFOHEADER
*
out
=
(
BITMAPINFOHEADER
*
)
lparam2
;
BITMAPINFOHEADER
*
in
=
(
BITMAPINFOHEADER
*
)
lparam1
;
BITMAPINFOHEADER
*
in
=
(
BITMAPINFOHEADER
*
)
lparam1
;
todo_wine_if
(
in
->
biSizeImage
!=
sink_bitmap_info
.
biSizeImage
)
ok
(
!
memcmp
(
in
,
&
sink_bitmap_info
,
sizeof
(
BITMAPINFOHEADER
)),
ok
(
!
memcmp
(
in
,
&
sink_bitmap_info
,
sizeof
(
BITMAPINFOHEADER
)),
"Input types didn't match.
\n
"
);
"Input types didn't match.
\n
"
);
todo_wine
ok
(
!
memcmp
(
out
,
&
source_bitmap_info
,
sizeof
(
BITMAPINFOHEADER
)),
todo_wine
ok
(
!
memcmp
(
out
,
&
source_bitmap_info
,
sizeof
(
BITMAPINFOHEADER
)),
...
@@ -796,7 +797,7 @@ struct testfilter
...
@@ -796,7 +797,7 @@ struct testfilter
struct
strmbase_source
source
;
struct
strmbase_source
source
;
struct
strmbase_sink
sink
;
struct
strmbase_sink
sink
;
const
AM_MEDIA_TYPE
*
mt
;
const
AM_MEDIA_TYPE
*
mt
;
unsigned
int
got_sample
;
unsigned
int
got_sample
,
got_new_segment
,
got_eos
,
got_begin_flush
,
got_end_flush
;
};
};
static
inline
struct
testfilter
*
impl_from_strmbase_filter
(
struct
strmbase_filter
*
iface
)
static
inline
struct
testfilter
*
impl_from_strmbase_filter
(
struct
strmbase_filter
*
iface
)
...
@@ -922,12 +923,48 @@ static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample
...
@@ -922,12 +923,48 @@ static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
testsink_new_segment
(
struct
strmbase_sink
*
iface
,
REFERENCE_TIME
start
,
REFERENCE_TIME
stop
,
double
rate
)
{
struct
testfilter
*
filter
=
impl_from_strmbase_filter
(
iface
->
pin
.
filter
);
++
filter
->
got_new_segment
;
ok
(
start
==
10000
,
"Got start %s.
\n
"
,
wine_dbgstr_longlong
(
start
));
ok
(
stop
==
20000
,
"Got stop %s.
\n
"
,
wine_dbgstr_longlong
(
stop
));
ok
(
rate
==
1
.
0
,
"Got rate %.16e.
\n
"
,
rate
);
return
S_OK
;
}
static
HRESULT
testsink_eos
(
struct
strmbase_sink
*
iface
)
{
struct
testfilter
*
filter
=
impl_from_strmbase_filter
(
iface
->
pin
.
filter
);
++
filter
->
got_eos
;
return
S_OK
;
}
static
HRESULT
testsink_begin_flush
(
struct
strmbase_sink
*
iface
)
{
struct
testfilter
*
filter
=
impl_from_strmbase_filter
(
iface
->
pin
.
filter
);
++
filter
->
got_begin_flush
;
return
S_OK
;
}
static
HRESULT
testsink_end_flush
(
struct
strmbase_sink
*
iface
)
{
struct
testfilter
*
filter
=
impl_from_strmbase_filter
(
iface
->
pin
.
filter
);
++
filter
->
got_end_flush
;
return
S_OK
;
}
static
const
struct
strmbase_sink_ops
testsink_ops
=
static
const
struct
strmbase_sink_ops
testsink_ops
=
{
{
.
base
.
pin_query_interface
=
testsink_query_interface
,
.
base
.
pin_query_interface
=
testsink_query_interface
,
.
base
.
pin_query_accept
=
testsink_query_accept
,
.
base
.
pin_query_accept
=
testsink_query_accept
,
.
base
.
pin_get_media_type
=
testsink_get_media_type
,
.
base
.
pin_get_media_type
=
testsink_get_media_type
,
.
pfnReceive
=
testsink_Receive
,
.
pfnReceive
=
testsink_Receive
,
.
sink_new_segment
=
testsink_new_segment
,
.
sink_eos
=
testsink_eos
,
.
sink_begin_flush
=
testsink_begin_flush
,
.
sink_end_flush
=
testsink_end_flush
,
};
};
static
void
testfilter_init
(
struct
testfilter
*
filter
)
static
void
testfilter_init
(
struct
testfilter
*
filter
)
...
@@ -1102,6 +1139,82 @@ static void test_sample_processing(IMediaControl *control, IMemInputPin *input,
...
@@ -1102,6 +1139,82 @@ static void test_sample_processing(IMediaControl *control, IMemInputPin *input,
IMemAllocator_Release
(
allocator
);
IMemAllocator_Release
(
allocator
);
}
}
static
void
test_streaming_events
(
IMediaControl
*
control
,
IPin
*
sink
,
IMemInputPin
*
input
,
struct
testfilter
*
testsink
)
{
IMemAllocator
*
allocator
;
IMediaSample
*
sample
;
HRESULT
hr
;
BYTE
*
data
;
LONG
i
;
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMemInputPin_GetAllocator
(
input
,
&
allocator
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMemAllocator_Commit
(
allocator
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMemAllocator_GetBuffer
(
allocator
,
&
sample
,
NULL
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSample_GetPointer
(
sample
,
&
data
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
200
;
++
i
)
data
[
i
]
=
i
;
hr
=
IMediaSample_SetActualDataLength
(
sample
,
200
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSample_SetSyncPoint
(
sample
,
TRUE
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
testsink
->
got_new_segment
,
"Got %u calls to IPin::NewSegment().
\n
"
,
testsink
->
got_new_segment
);
hr
=
IPin_NewSegment
(
sink
,
10000
,
20000
,
1
.
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
testsink
->
got_new_segment
==
1
,
"Got %u calls to IPin::NewSegment().
\n
"
,
testsink
->
got_new_segment
);
ok
(
!
testsink
->
got_eos
,
"Got %u calls to IPin::EndOfStream().
\n
"
,
testsink
->
got_eos
);
hr
=
IPin_EndOfStream
(
sink
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
!
testsink
->
got_sample
,
"Got %u calls to Receive().
\n
"
,
testsink
->
got_sample
);
ok
(
testsink
->
got_eos
==
1
,
"Got %u calls to IPin::EndOfStream().
\n
"
,
testsink
->
got_eos
);
testsink
->
got_eos
=
0
;
hr
=
IPin_EndOfStream
(
sink
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
testsink
->
got_eos
==
1
,
"Got %u calls to IPin::EndOfStream().
\n
"
,
testsink
->
got_eos
);
testmode
=
0
;
hr
=
IMemInputPin_Receive
(
input
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
testsink
->
got_sample
==
1
,
"Got %u calls to Receive().
\n
"
,
testsink
->
got_sample
);
testsink
->
got_sample
=
0
;
ok
(
!
testsink
->
got_begin_flush
,
"Got %u calls to IPin::BeginFlush().
\n
"
,
testsink
->
got_begin_flush
);
hr
=
IPin_BeginFlush
(
sink
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
testsink
->
got_begin_flush
==
1
,
"Got %u calls to IPin::BeginFlush().
\n
"
,
testsink
->
got_begin_flush
);
hr
=
IMemInputPin_Receive
(
input
,
sample
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IPin_EndOfStream
(
sink
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
testsink
->
got_end_flush
,
"Got %u calls to IPin::EndFlush().
\n
"
,
testsink
->
got_end_flush
);
hr
=
IPin_EndFlush
(
sink
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
testsink
->
got_end_flush
==
1
,
"Got %u calls to IPin::EndFlush().
\n
"
,
testsink
->
got_end_flush
);
hr
=
IMemInputPin_Receive
(
input
,
sample
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
testsink
->
got_sample
==
1
,
"Got %u calls to Receive().
\n
"
,
testsink
->
got_sample
);
testsink
->
got_sample
=
0
;
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
IMediaSample_Release
(
sample
);
IMemAllocator_Release
(
allocator
);
}
static
void
test_connect_pin
(
void
)
static
void
test_connect_pin
(
void
)
{
{
VIDEOINFOHEADER
req_format
=
VIDEOINFOHEADER
req_format
=
...
@@ -1312,6 +1425,7 @@ static void test_connect_pin(void)
...
@@ -1312,6 +1425,7 @@ static void test_connect_pin(void)
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
test_sample_processing
(
control
,
meminput
,
&
testsink
);
test_sample_processing
(
control
,
meminput
,
&
testsink
);
test_streaming_events
(
control
,
sink
,
meminput
,
&
testsink
);
hr
=
IFilterGraph2_Disconnect
(
graph
,
source
);
hr
=
IFilterGraph2_Disconnect
(
graph
,
source
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
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