Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7db3e3c2
Commit
7db3e3c2
authored
Feb 27, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Test IMediaControl on a fully connected graph.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d635d7e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
105 deletions
+63
-105
filtergraph.c
dlls/quartz/tests/filtergraph.c
+63
-105
No files found.
dlls/quartz/tests/filtergraph.c
View file @
7db3e3c2
...
@@ -283,6 +283,68 @@ static void test_basic_video(void)
...
@@ -283,6 +283,68 @@ static void test_basic_video(void)
IBasicVideo_Release
(
pbv
);
IBasicVideo_Release
(
pbv
);
}
}
static
void
test_mediacontrol
(
void
)
{
IMediaSeeking
*
seeking
;
IMediaFilter
*
filter
;
IMediaControl
*
control
;
LONGLONG
pos
;
GUID
format
;
HRESULT
hr
;
IGraphBuilder_SetDefaultSyncSource
(
pgraph
);
hr
=
IGraphBuilder_QueryInterface
(
pgraph
,
&
IID_IMediaSeeking
,
(
void
**
)
&
seeking
);
ok
(
hr
==
S_OK
,
"QueryInterface(IMediaControl) failed: %08x
\n
"
,
hr
);
hr
=
IGraphBuilder_QueryInterface
(
pgraph
,
&
IID_IMediaFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"QueryInterface(IMediaFilter) failed: %08x
\n
"
,
hr
);
hr
=
IGraphBuilder_QueryInterface
(
pgraph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
ok
(
hr
==
S_OK
,
"QueryInterface(IMediaControl) failed: %08x
\n
"
,
hr
);
format
=
GUID_NULL
;
hr
=
IMediaSeeking_GetTimeFormat
(
seeking
,
&
format
);
ok
(
hr
==
S_OK
,
"GetTimeFormat failed: %#x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
format
,
&
TIME_FORMAT_MEDIA_TIME
),
"got %s
\n
"
,
wine_dbgstr_guid
(
&
format
));
pos
=
0xdeadbeef
;
hr
=
IMediaSeeking_ConvertTimeFormat
(
seeking
,
&
pos
,
NULL
,
0x123456789a
,
NULL
);
ok
(
hr
==
S_OK
,
"ConvertTimeFormat failed: %#x
\n
"
,
hr
);
ok
(
pos
==
0x123456789a
,
"got %s
\n
"
,
wine_dbgstr_longlong
(
pos
));
pos
=
0xdeadbeef
;
hr
=
IMediaSeeking_ConvertTimeFormat
(
seeking
,
&
pos
,
&
TIME_FORMAT_MEDIA_TIME
,
0x123456789a
,
NULL
);
ok
(
hr
==
S_OK
,
"ConvertTimeFormat failed: %#x
\n
"
,
hr
);
ok
(
pos
==
0x123456789a
,
"got %s
\n
"
,
wine_dbgstr_longlong
(
pos
));
pos
=
0xdeadbeef
;
hr
=
IMediaSeeking_ConvertTimeFormat
(
seeking
,
&
pos
,
NULL
,
0x123456789a
,
&
TIME_FORMAT_MEDIA_TIME
);
ok
(
hr
==
S_OK
,
"ConvertTimeFormat failed: %#x
\n
"
,
hr
);
ok
(
pos
==
0x123456789a
,
"got %s
\n
"
,
wine_dbgstr_longlong
(
pos
));
hr
=
IMediaSeeking_GetCurrentPosition
(
seeking
,
&
pos
);
ok
(
hr
==
S_OK
,
"GetCurrentPosition failed: %#x
\n
"
,
hr
);
ok
(
pos
==
0
,
"got %s
\n
"
,
wine_dbgstr_longlong
(
pos
));
hr
=
IMediaSeeking_SetPositions
(
seeking
,
NULL
,
AM_SEEKING_ReturnTime
,
NULL
,
AM_SEEKING_NoPositioning
);
ok
(
hr
==
S_OK
,
"SetPositions failed: %#x
\n
"
,
hr
);
hr
=
IMediaSeeking_SetPositions
(
seeking
,
NULL
,
AM_SEEKING_NoPositioning
,
NULL
,
AM_SEEKING_ReturnTime
);
ok
(
hr
==
S_OK
,
"SetPositions failed: %#x
\n
"
,
hr
);
IMediaFilter_SetSyncSource
(
filter
,
NULL
);
pos
=
0xdeadbeef
;
hr
=
IMediaSeeking_GetCurrentPosition
(
seeking
,
&
pos
);
ok
(
hr
==
S_OK
,
"GetCurrentPosition failed: %#x
\n
"
,
hr
);
ok
(
pos
==
0
,
"got %s
\n
"
,
wine_dbgstr_longlong
(
pos
));
hr
=
IMediaControl_GetState
(
control
,
1000
,
NULL
);
ok
(
hr
==
E_POINTER
,
"expected E_POINTER, got %#x
\n
"
,
hr
);
IMediaControl_Release
(
control
);
IMediaSeeking_Release
(
seeking
);
IMediaFilter_Release
(
filter
);
}
static
void
rungraph
(
void
)
static
void
rungraph
(
void
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -304,6 +366,7 @@ static void rungraph(void)
...
@@ -304,6 +366,7 @@ static void rungraph(void)
IMediaFilter_Release
(
pmf
);
IMediaFilter_Release
(
pmf
);
test_basic_video
();
test_basic_video
();
test_mediacontrol
();
hr
=
IMediaControl_Run
(
pmc
);
hr
=
IMediaControl_Run
(
pmc
);
ok
(
hr
==
S_FALSE
,
"Cannot run the graph returned: %x
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"Cannot run the graph returned: %x
\n
"
,
hr
);
...
@@ -555,109 +618,6 @@ static void test_graph_builder(void)
...
@@ -555,109 +618,6 @@ static void test_graph_builder(void)
releasefiltergraph
();
releasefiltergraph
();
}
}
static
void
test_graph_builder_addfilter
(
void
)
{
HRESULT
hr
;
IBaseFilter
*
pF
=
NULL
;
static
const
WCHAR
testFilterW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'F'
,
'i'
,
'l'
,
't'
,
'e'
,
'r'
,
0
};
if
(
!
createfiltergraph
())
return
;
hr
=
IGraphBuilder_AddFilter
(
pgraph
,
NULL
,
testFilterW
);
ok
(
hr
==
E_POINTER
,
"IGraphBuilder_AddFilter returned: %x
\n
"
,
hr
);
/* create video filter */
hr
=
CoCreateInstance
(
&
CLSID_VideoRenderer
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IBaseFilter
,
(
LPVOID
*
)
&
pF
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed with %x
\n
"
,
hr
);
ok
(
pF
!=
NULL
,
"pF is NULL
\n
"
);
if
(
!
pF
)
{
skip
(
"failed to created filter, skipping
\n
"
);
return
;
}
hr
=
IGraphBuilder_AddFilter
(
pgraph
,
pF
,
NULL
);
ok
(
hr
==
S_OK
,
"IGraphBuilder_AddFilter returned: %x
\n
"
,
hr
);
IBaseFilter_Release
(
pF
);
}
static
void
test_mediacontrol
(
void
)
{
HRESULT
hr
;
LONGLONG
pos
=
0xdeadbeef
;
GUID
format
=
GUID_NULL
;
IMediaSeeking
*
seeking
=
NULL
;
IMediaFilter
*
filter
=
NULL
;
IMediaControl
*
control
=
NULL
;
IGraphBuilder_SetDefaultSyncSource
(
pgraph
);
hr
=
IGraphBuilder_QueryInterface
(
pgraph
,
&
IID_IMediaSeeking
,
(
void
**
)
&
seeking
);
ok
(
hr
==
S_OK
,
"QueryInterface IMediaControl failed: %08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
hr
=
IGraphBuilder_QueryInterface
(
pgraph
,
&
IID_IMediaFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"QueryInterface IMediaFilter failed: %08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
IMediaSeeking_Release
(
seeking
);
return
;
}
hr
=
IGraphBuilder_QueryInterface
(
pgraph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
ok
(
hr
==
S_OK
,
"QueryInterface IMediaControl failed: %08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
IMediaSeeking_Release
(
seeking
);
IMediaFilter_Release
(
filter
);
return
;
}
format
=
GUID_NULL
;
hr
=
IMediaSeeking_GetTimeFormat
(
seeking
,
&
format
);
ok
(
hr
==
S_OK
,
"GetTimeFormat failed: %08x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
format
,
&
TIME_FORMAT_MEDIA_TIME
),
"GetTimeFormat: unexpected format %s
\n
"
,
wine_dbgstr_guid
(
&
format
));
pos
=
0xdeadbeef
;
hr
=
IMediaSeeking_ConvertTimeFormat
(
seeking
,
&
pos
,
NULL
,
0x123456789a
,
NULL
);
ok
(
hr
==
S_OK
,
"ConvertTimeFormat failed: %08x
\n
"
,
hr
);
ok
(
pos
==
0x123456789a
,
"ConvertTimeFormat: expected 123456789a, got (%s)
\n
"
,
wine_dbgstr_longlong
(
pos
));
pos
=
0xdeadbeef
;
hr
=
IMediaSeeking_ConvertTimeFormat
(
seeking
,
&
pos
,
&
TIME_FORMAT_MEDIA_TIME
,
0x123456789a
,
NULL
);
ok
(
hr
==
S_OK
,
"ConvertTimeFormat failed: %08x
\n
"
,
hr
);
ok
(
pos
==
0x123456789a
,
"ConvertTimeFormat: expected 123456789a, got (%s)
\n
"
,
wine_dbgstr_longlong
(
pos
));
pos
=
0xdeadbeef
;
hr
=
IMediaSeeking_ConvertTimeFormat
(
seeking
,
&
pos
,
NULL
,
0x123456789a
,
&
TIME_FORMAT_MEDIA_TIME
);
ok
(
hr
==
S_OK
,
"ConvertTimeFormat failed: %08x
\n
"
,
hr
);
ok
(
pos
==
0x123456789a
,
"ConvertTimeFormat: expected 123456789a, got (%s)
\n
"
,
wine_dbgstr_longlong
(
pos
));
hr
=
IMediaSeeking_GetCurrentPosition
(
seeking
,
&
pos
);
ok
(
hr
==
S_OK
,
"GetCurrentPosition failed: %08x
\n
"
,
hr
);
ok
(
pos
==
0
,
"Position != 0 (%s)
\n
"
,
wine_dbgstr_longlong
(
pos
));
hr
=
IMediaSeeking_SetPositions
(
seeking
,
NULL
,
AM_SEEKING_ReturnTime
,
NULL
,
AM_SEEKING_NoPositioning
);
ok
(
hr
==
S_OK
,
"SetPositions failed: %08x
\n
"
,
hr
);
hr
=
IMediaSeeking_SetPositions
(
seeking
,
NULL
,
AM_SEEKING_NoPositioning
,
NULL
,
AM_SEEKING_ReturnTime
);
ok
(
hr
==
S_OK
,
"SetPositions failed: %08x
\n
"
,
hr
);
IMediaFilter_SetSyncSource
(
filter
,
NULL
);
pos
=
0xdeadbeef
;
hr
=
IMediaSeeking_GetCurrentPosition
(
seeking
,
&
pos
);
ok
(
hr
==
S_OK
,
"GetCurrentPosition failed: %08x
\n
"
,
hr
);
ok
(
pos
==
0
,
"Position != 0 (%s)
\n
"
,
wine_dbgstr_longlong
(
pos
));
hr
=
IMediaControl_GetState
(
control
,
1000
,
NULL
);
ok
(
hr
==
E_POINTER
,
"GetState expected %08x, got %08x
\n
"
,
E_POINTER
,
hr
);
IMediaControl_Release
(
control
);
IMediaSeeking_Release
(
seeking
);
IMediaFilter_Release
(
filter
);
releasefiltergraph
();
}
static
void
test_filter_graph2
(
void
)
static
void
test_filter_graph2
(
void
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -2344,8 +2304,6 @@ START_TEST(filtergraph)
...
@@ -2344,8 +2304,6 @@ START_TEST(filtergraph)
test_render_run
(
avifile
);
test_render_run
(
avifile
);
test_render_run
(
mpegfile
);
test_render_run
(
mpegfile
);
test_graph_builder
();
test_graph_builder
();
test_graph_builder_addfilter
();
test_mediacontrol
();
test_filter_graph2
();
test_filter_graph2
();
test_render_filter_priority
();
test_render_filter_priority
();
test_aggregate_filter_graph
();
test_aggregate_filter_graph
();
...
...
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