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
f8b6b55c
Commit
f8b6b55c
authored
Jun 27, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Add some tests for IEnumMediaTypes().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0e9b605d
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
829 additions
and
1 deletion
+829
-1
avidec.c
dlls/quartz/tests/avidec.c
+77
-1
avisplit.c
dlls/quartz/tests/avisplit.c
+119
-0
dsoundrender.c
dlls/quartz/tests/dsoundrender.c
+82
-0
filesource.c
dlls/quartz/tests/filesource.c
+107
-0
mpegsplit.c
dlls/quartz/tests/mpegsplit.c
+188
-0
videorenderer.c
dlls/quartz/tests/videorenderer.c
+45
-0
vmr7.c
dlls/quartz/tests/vmr7.c
+46
-0
vmr9.c
dlls/quartz/tests/vmr9.c
+46
-0
waveparser.c
dlls/quartz/tests/waveparser.c
+119
-0
No files found.
dlls/quartz/tests/avidec.c
View file @
f8b6b55c
...
@@ -468,7 +468,7 @@ static void test_media_types(void)
...
@@ -468,7 +468,7 @@ static void test_media_types(void)
{
{
IBaseFilter
*
filter
=
create_avi_dec
();
IBaseFilter
*
filter
=
create_avi_dec
();
AM_MEDIA_TYPE
mt
=
{{
0
}},
*
pmt
;
AM_MEDIA_TYPE
mt
=
{{
0
}},
*
pmt
;
VIDEOINFOHEADER
vih
=
{
0
};
VIDEOINFOHEADER
vih
=
{
{
0
}
};
IEnumMediaTypes
*
enummt
;
IEnumMediaTypes
*
enummt
;
HRESULT
hr
;
HRESULT
hr
;
ULONG
ref
;
ULONG
ref
;
...
@@ -543,6 +543,81 @@ static void test_media_types(void)
...
@@ -543,6 +543,81 @@ static void test_media_types(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
}
static
void
test_enum_media_types
(
void
)
{
IBaseFilter
*
filter
=
create_avi_dec
();
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
1
];
ULONG
ref
,
count
;
HRESULT
hr
;
IPin
*
pin
;
IBaseFilter_FindPin
(
filter
,
sink_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
IBaseFilter_FindPin
(
filter
,
source_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
START_TEST
(
avidec
)
START_TEST
(
avidec
)
{
{
BOOL
ret
;
BOOL
ret
;
...
@@ -558,6 +633,7 @@ START_TEST(avidec)
...
@@ -558,6 +633,7 @@ START_TEST(avidec)
test_find_pin
();
test_find_pin
();
test_pin_info
();
test_pin_info
();
test_media_types
();
test_media_types
();
test_enum_media_types
();
CoUninitialize
();
CoUninitialize
();
...
...
dlls/quartz/tests/avisplit.c
View file @
f8b6b55c
...
@@ -654,6 +654,124 @@ static void test_media_types(void)
...
@@ -654,6 +654,124 @@ static void test_media_types(void)
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
}
}
static
void
test_enum_media_types
(
void
)
{
const
WCHAR
*
filename
=
load_resource
(
avifile
);
IBaseFilter
*
filter
=
create_avi_splitter
();
IFilterGraph2
*
graph
=
connect_input
(
filter
,
filename
);
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
2
];
ULONG
ref
,
count
;
HRESULT
hr
;
IPin
*
pin
;
BOOL
ret
;
IBaseFilter_FindPin
(
filter
,
sink_name
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
IBaseFilter_FindPin
(
filter
,
source0_name
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
2
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
CoTaskMemFree
(
mts
[
0
]);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
IFilterGraph2_Release
(
graph
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ret
=
DeleteFileW
(
filename
);
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
}
static
void
test_filter_graph
(
void
)
static
void
test_filter_graph
(
void
)
{
{
IFileSourceFilter
*
pfile
=
NULL
;
IFileSourceFilter
*
pfile
=
NULL
;
...
@@ -906,6 +1024,7 @@ START_TEST(avisplit)
...
@@ -906,6 +1024,7 @@ START_TEST(avisplit)
test_find_pin
();
test_find_pin
();
test_pin_info
();
test_pin_info
();
test_media_types
();
test_media_types
();
test_enum_media_types
();
test_filter_graph
();
test_filter_graph
();
CoUninitialize
();
CoUninitialize
();
...
...
dlls/quartz/tests/dsoundrender.c
View file @
f8b6b55c
...
@@ -494,6 +494,87 @@ static void test_basic_audio(void)
...
@@ -494,6 +494,87 @@ static void test_basic_audio(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
}
static
void
test_enum_media_types
(
void
)
{
IBaseFilter
*
filter
=
create_dsound_render
();
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
2
];
ULONG
ref
,
count
;
HRESULT
hr
;
IPin
*
pin
;
IBaseFilter_FindPin
(
filter
,
sink_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
if
(
count
>
0
)
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
if
(
count
>
0
)
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
2
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_pin
(
IPin
*
pin
)
static
void
test_pin
(
IPin
*
pin
)
{
{
IMemInputPin
*
mpin
=
NULL
;
IMemInputPin
*
mpin
=
NULL
;
...
@@ -575,6 +656,7 @@ START_TEST(dsoundrender)
...
@@ -575,6 +656,7 @@ START_TEST(dsoundrender)
test_find_pin
();
test_find_pin
();
test_pin_info
();
test_pin_info
();
test_basic_audio
();
test_basic_audio
();
test_enum_media_types
();
test_basefilter
();
test_basefilter
();
CoUninitialize
();
CoUninitialize
();
...
...
dlls/quartz/tests/filesource.c
View file @
f8b6b55c
...
@@ -1081,6 +1081,112 @@ static void test_async_reader(void)
...
@@ -1081,6 +1081,112 @@ static void test_async_reader(void)
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
}
}
static
void
test_enum_media_types
(
void
)
{
const
WCHAR
*
filename
=
load_resource
(
avifile
);
IBaseFilter
*
filter
=
create_file_source
();
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
3
];
ULONG
ref
,
count
;
HRESULT
hr
;
IPin
*
pin
;
BOOL
ret
;
load_file
(
filter
,
filename
);
IBaseFilter_FindPin
(
filter
,
source_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
2
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]);
CoTaskMemFree
(
mts
[
1
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
3
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
2
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]);
CoTaskMemFree
(
mts
[
1
]);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
3
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
mts
[
0
]);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ret
=
DeleteFileW
(
filename
);
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
}
START_TEST
(
filesource
)
START_TEST
(
filesource
)
{
{
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
...
@@ -1093,6 +1199,7 @@ START_TEST(filesource)
...
@@ -1093,6 +1199,7 @@ START_TEST(filesource)
test_filter_state
();
test_filter_state
();
test_file_source_filter
();
test_file_source_filter
();
test_async_reader
();
test_async_reader
();
test_enum_media_types
();
CoUninitialize
();
CoUninitialize
();
}
}
dlls/quartz/tests/mpegsplit.c
View file @
f8b6b55c
...
@@ -810,6 +810,193 @@ done:
...
@@ -810,6 +810,193 @@ done:
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
}
}
static
void
test_enum_media_types
(
void
)
{
const
WCHAR
*
filename
=
load_resource
(
mp3file
);
IBaseFilter
*
filter
=
create_mpeg_splitter
();
IFilterGraph2
*
graph
=
connect_input
(
filter
,
filename
);
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
5
];
ULONG
ref
,
count
;
unsigned
int
i
;
HRESULT
hr
;
IPin
*
pin
;
BOOL
ret
;
IBaseFilter_FindPin
(
filter
,
inputW
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]);
}
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]);
}
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
count
==
2
,
"Got count %u.
\n
"
,
count
);
if
(
count
>
0
)
CoTaskMemFree
(
mts
[
0
]);
if
(
count
>
1
)
CoTaskMemFree
(
mts
[
1
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
3
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
count
==
2
,
"Got count %u.
\n
"
,
count
);
if
(
count
>
0
)
CoTaskMemFree
(
mts
[
0
]);
if
(
count
>
1
)
CoTaskMemFree
(
mts
[
1
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
5
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
4
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
IBaseFilter_FindPin
(
filter
,
audioW
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
3
;
++
i
)
{
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
todo_wine_if
(
i
)
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]);
}
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
3
;
++
i
)
{
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
todo_wine_if
(
i
)
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine_if
(
i
)
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
if
(
hr
==
S_OK
)
CoTaskMemFree
(
mts
[
0
]);
}
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
count
==
2
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
CoTaskMemFree
(
mts
[
0
]);
if
(
count
>
1
)
CoTaskMemFree
(
mts
[
1
]
->
pbFormat
);
if
(
count
>
1
)
CoTaskMemFree
(
mts
[
1
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
if
(
count
)
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
if
(
count
)
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
4
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
3
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
CoTaskMemFree
(
mts
[
0
]);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
IFilterGraph2_Release
(
graph
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ret
=
DeleteFileW
(
filename
);
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
}
START_TEST
(
mpegsplit
)
START_TEST
(
mpegsplit
)
{
{
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
...
@@ -820,6 +1007,7 @@ START_TEST(mpegsplit)
...
@@ -820,6 +1007,7 @@ START_TEST(mpegsplit)
test_find_pin
();
test_find_pin
();
test_pin_info
();
test_pin_info
();
test_media_types
();
test_media_types
();
test_enum_media_types
();
CoUninitialize
();
CoUninitialize
();
}
}
dlls/quartz/tests/videorenderer.c
View file @
f8b6b55c
...
@@ -428,6 +428,50 @@ static void test_media_types(void)
...
@@ -428,6 +428,50 @@ static void test_media_types(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
}
static
void
test_enum_media_types
(
void
)
{
IBaseFilter
*
filter
=
create_video_renderer
();
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
2
];
ULONG
ref
,
count
;
HRESULT
hr
;
IPin
*
pin
;
IBaseFilter_FindPin
(
filter
,
sink_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_pin
(
IPin
*
pin
)
static
void
test_pin
(
IPin
*
pin
)
{
{
IMemInputPin
*
mpin
=
NULL
;
IMemInputPin
*
mpin
=
NULL
;
...
@@ -494,6 +538,7 @@ START_TEST(videorenderer)
...
@@ -494,6 +538,7 @@ START_TEST(videorenderer)
test_find_pin
();
test_find_pin
();
test_pin_info
();
test_pin_info
();
test_media_types
();
test_media_types
();
test_enum_media_types
();
test_basefilter
();
test_basefilter
();
CoUninitialize
();
CoUninitialize
();
...
...
dlls/quartz/tests/vmr7.c
View file @
f8b6b55c
...
@@ -730,6 +730,51 @@ static void test_media_types(void)
...
@@ -730,6 +730,51 @@ static void test_media_types(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
}
static
void
test_enum_media_types
(
void
)
{
WCHAR
sink_id
[]
=
{
'V'
,
'M'
,
'R'
,
' '
,
'I'
,
'n'
,
'p'
,
'u'
,
't'
,
'0'
,
0
};
IBaseFilter
*
filter
=
create_vmr7
(
0
);
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
2
];
ULONG
ref
,
count
;
HRESULT
hr
;
IPin
*
pin
;
IBaseFilter_FindPin
(
filter
,
sink_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
START_TEST
(
vmr7
)
START_TEST
(
vmr7
)
{
{
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
...
@@ -741,6 +786,7 @@ START_TEST(vmr7)
...
@@ -741,6 +786,7 @@ START_TEST(vmr7)
test_find_pin
();
test_find_pin
();
test_pin_info
();
test_pin_info
();
test_media_types
();
test_media_types
();
test_enum_media_types
();
CoUninitialize
();
CoUninitialize
();
}
}
dlls/quartz/tests/vmr9.c
View file @
f8b6b55c
...
@@ -734,6 +734,51 @@ static void test_media_types(void)
...
@@ -734,6 +734,51 @@ static void test_media_types(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
}
static
void
test_enum_media_types
(
void
)
{
WCHAR
sink_id
[]
=
{
'V'
,
'M'
,
'R'
,
' '
,
'I'
,
'n'
,
'p'
,
'u'
,
't'
,
'0'
,
0
};
IBaseFilter
*
filter
=
create_vmr9
(
0
);
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
2
];
ULONG
ref
,
count
;
HRESULT
hr
;
IPin
*
pin
;
IBaseFilter_FindPin
(
filter
,
sink_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
START_TEST
(
vmr9
)
START_TEST
(
vmr9
)
{
{
IBaseFilter
*
filter
;
IBaseFilter
*
filter
;
...
@@ -756,6 +801,7 @@ START_TEST(vmr9)
...
@@ -756,6 +801,7 @@ START_TEST(vmr9)
test_find_pin
();
test_find_pin
();
test_pin_info
();
test_pin_info
();
test_media_types
();
test_media_types
();
test_enum_media_types
();
CoUninitialize
();
CoUninitialize
();
}
}
dlls/quartz/tests/waveparser.c
View file @
f8b6b55c
...
@@ -642,6 +642,124 @@ static void test_media_types(void)
...
@@ -642,6 +642,124 @@ static void test_media_types(void)
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
}
}
static
void
test_enum_media_types
(
void
)
{
const
WCHAR
*
filename
=
load_resource
(
wavefile
);
IBaseFilter
*
filter
=
create_wave_parser
();
IFilterGraph2
*
graph
=
connect_input
(
filter
,
filename
);
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
2
];
ULONG
ref
,
count
;
HRESULT
hr
;
IPin
*
pin
;
BOOL
ret
;
IBaseFilter_FindPin
(
filter
,
sink_name
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
IBaseFilter_FindPin
(
filter
,
source_name
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
2
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
mts
[
0
]
->
pbFormat
);
CoTaskMemFree
(
mts
[
0
]);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
IFilterGraph2_Release
(
graph
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ret
=
DeleteFileW
(
filename
);
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
}
START_TEST
(
waveparser
)
START_TEST
(
waveparser
)
{
{
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
...
@@ -652,6 +770,7 @@ START_TEST(waveparser)
...
@@ -652,6 +770,7 @@ START_TEST(waveparser)
test_find_pin
();
test_find_pin
();
test_pin_info
();
test_pin_info
();
test_media_types
();
test_media_types
();
test_enum_media_types
();
CoUninitialize
();
CoUninitialize
();
}
}
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