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
d8f54a71
Commit
d8f54a71
authored
Mar 31, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Clean up tests for video renderer filter interfaces.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c6ff0e01
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
69 deletions
+46
-69
videorenderer.c
dlls/quartz/tests/videorenderer.c
+46
-69
No files found.
dlls/quartz/tests/videorenderer.c
View file @
d8f54a71
...
...
@@ -19,71 +19,60 @@
*/
#define COBJMACROS
#include "wine/test.h"
#include "dshow.h"
#include "wine/test.h"
#define QI_SUCCEED(iface, riid, ppv) hr = IUnknown_QueryInterface(iface, &riid, (LPVOID*)&ppv); \
ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); \
ok(ppv != NULL, "Pointer is NULL\n");
#define RELEASE_EXPECT(iface, num) if (iface) { \
hr = IUnknown_Release((IUnknown*)iface); \
ok(hr == num, "IUnknown_Release should return %d, got %d\n", num, hr); \
}
static
IUnknown
*
pVideoRenderer
=
NULL
;
static
int
create_video_renderer
(
void
)
static
IBaseFilter
*
create_video_renderer
(
void
)
{
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_VideoRenderer
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
pVideoRendere
r
);
return
(
hr
==
S_OK
&&
pVideoRenderer
!=
NULL
)
;
IBaseFilter
*
filter
=
NULL
;
HRESULT
hr
=
CoCreateInstance
(
&
CLSID_VideoRenderer
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
h
r
);
return
filter
;
}
static
void
release_video_renderer
(
void
)
#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
static
void
check_interface_
(
unsigned
int
line
,
void
*
iface_ptr
,
REFIID
iid
,
BOOL
supported
)
{
HRESULT
hr
;
IUnknown
*
iface
=
iface_ptr
;
HRESULT
hr
,
expected_hr
;
IUnknown
*
unk
;
expected_hr
=
supported
?
S_OK
:
E_NOINTERFACE
;
hr
=
IUnknown_Release
(
pVideoRenderer
);
ok
(
hr
==
0
,
"IUnknown_Release failed with %x
\n
"
,
hr
);
hr
=
IUnknown_QueryInterface
(
iface
,
iid
,
(
void
**
)
&
unk
);
ok_
(
__FILE__
,
line
)(
hr
==
expected_hr
,
"Got hr %#x, expected %#x.
\n
"
,
hr
,
expected_hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
unk
);
}
static
void
test_
query_interface
(
void
)
static
void
test_
interfaces
(
void
)
{
HRESULT
hr
;
IBaseFilter
*
pBaseFilter
=
NULL
;
IBasicVideo
*
pBasicVideo
=
NULL
;
IDirectDrawVideo
*
pDirectDrawVideo
=
NULL
;
IKsPropertySet
*
pKsPropertySet
=
NULL
;
IMediaPosition
*
pMediaPosition
=
NULL
;
IMediaSeeking
*
pMediaSeeking
=
NULL
;
IQualityControl
*
pQualityControl
=
NULL
;
IQualProp
*
pQualProp
=
NULL
;
IVideoWindow
*
pVideoWindow
=
NULL
;
QI_SUCCEED
(
pVideoRenderer
,
IID_IBaseFilter
,
pBaseFilter
);
RELEASE_EXPECT
(
pBaseFilter
,
1
);
QI_SUCCEED
(
pVideoRenderer
,
IID_IBasicVideo
,
pBasicVideo
);
RELEASE_EXPECT
(
pBasicVideo
,
1
);
QI_SUCCEED
(
pVideoRenderer
,
IID_IMediaSeeking
,
pMediaSeeking
);
RELEASE_EXPECT
(
pMediaSeeking
,
1
);
QI_SUCCEED
(
pVideoRenderer
,
IID_IQualityControl
,
pQualityControl
);
RELEASE_EXPECT
(
pQualityControl
,
1
);
todo_wine
{
QI_SUCCEED
(
pVideoRenderer
,
IID_IDirectDrawVideo
,
pDirectDrawVideo
);
RELEASE_EXPECT
(
pDirectDrawVideo
,
1
);
QI_SUCCEED
(
pVideoRenderer
,
IID_IKsPropertySet
,
pKsPropertySet
);
RELEASE_EXPECT
(
pKsPropertySet
,
1
);
QI_SUCCEED
(
pVideoRenderer
,
IID_IQualProp
,
pQualProp
);
RELEASE_EXPECT
(
pQualProp
,
1
);
}
QI_SUCCEED
(
pVideoRenderer
,
IID_IMediaPosition
,
pMediaPosition
);
RELEASE_EXPECT
(
pMediaPosition
,
1
);
QI_SUCCEED
(
pVideoRenderer
,
IID_IVideoWindow
,
pVideoWindow
);
RELEASE_EXPECT
(
pVideoWindow
,
1
);
IBaseFilter
*
filter
=
create_video_renderer
();
check_interface
(
filter
,
&
IID_IBaseFilter
,
TRUE
);
check_interface
(
filter
,
&
IID_IBasicVideo
,
TRUE
);
todo_wine
check_interface
(
filter
,
&
IID_IBasicVideo2
,
TRUE
);
todo_wine
check_interface
(
filter
,
&
IID_IDirectDrawVideo
,
TRUE
);
todo_wine
check_interface
(
filter
,
&
IID_IKsPropertySet
,
TRUE
);
check_interface
(
filter
,
&
IID_IMediaFilter
,
TRUE
);
check_interface
(
filter
,
&
IID_IMediaPosition
,
TRUE
);
check_interface
(
filter
,
&
IID_IMediaSeeking
,
TRUE
);
check_interface
(
filter
,
&
IID_IPersist
,
TRUE
);
check_interface
(
filter
,
&
IID_IQualityControl
,
TRUE
);
todo_wine
check_interface
(
filter
,
&
IID_IQualProp
,
TRUE
);
check_interface
(
filter
,
&
IID_IUnknown
,
TRUE
);
check_interface
(
filter
,
&
IID_IVideoWindow
,
TRUE
);
todo_wine
check_interface
(
filter
,
&
IID_IAMFilterMiscFlags
,
FALSE
);
check_interface
(
filter
,
&
IID_IBasicAudio
,
FALSE
);
check_interface
(
filter
,
&
IID_IDispatch
,
FALSE
);
check_interface
(
filter
,
&
IID_IOverlay
,
FALSE
);
check_interface
(
filter
,
&
IID_IPersistPropertyBag
,
FALSE
);
check_interface
(
filter
,
&
IID_IPin
,
FALSE
);
check_interface
(
filter
,
&
IID_IReferenceClock
,
FALSE
);
IBaseFilter_Release
(
filter
);
}
static
void
test_pin
(
IPin
*
pin
)
...
...
@@ -105,19 +94,11 @@ static void test_pin(IPin *pin)
static
void
test_basefilter
(
void
)
{
IEnumPins
*
pin_enum
=
NULL
;
IBaseFilter
*
base
=
NULL
;
IBaseFilter
*
base
=
create_video_renderer
()
;
IPin
*
pins
[
2
];
ULONG
ref
;
HRESULT
hr
;
IUnknown_QueryInterface
(
pVideoRenderer
,
&
IID_IBaseFilter
,
(
void
**
)
&
base
);
if
(
base
==
NULL
)
{
/* test_query_interface handles this case */
skip
(
"No IBaseFilter
\n
"
);
return
;
}
hr
=
IBaseFilter_EnumPins
(
base
,
NULL
);
ok
(
hr
==
E_POINTER
,
"hr = %08x and not E_POINTER
\n
"
,
hr
);
...
...
@@ -153,13 +134,9 @@ static void test_basefilter(void)
START_TEST
(
videorenderer
)
{
CoInitialize
(
NULL
);
if
(
!
create_video_renderer
())
return
;
test_
query_interface
();
test_
interfaces
();
test_basefilter
();
release_video_renderer
();
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