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
d576a61f
Commit
d576a61f
authored
Feb 17, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/tests: Add some tests for rate support in SAR.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6971e7e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
110 additions
and
0 deletions
+110
-0
mf.c
dlls/mf/tests/mf.c
+110
-0
No files found.
dlls/mf/tests/mf.c
View file @
d576a61f
...
...
@@ -3842,6 +3842,108 @@ static void test_quality_manager(void)
ok
(
hr
==
S_OK
,
"Shutdown failure, hr %#x.
\n
"
,
hr
);
}
static
void
check_sar_rate_support
(
IMFMediaSink
*
sink
)
{
IMFRateSupport
*
rate_support
;
IMFMediaTypeHandler
*
handler
;
IMFStreamSink
*
stream_sink
;
IMFMediaType
*
media_type
;
HRESULT
hr
;
float
rate
;
hr
=
IMFMediaSink_QueryInterface
(
sink
,
&
IID_IMFRateSupport
,
(
void
**
)
&
rate_support
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
hr
=
IMFMediaSink_GetStreamSinkByIndex
(
sink
,
0
,
&
stream_sink
);
if
(
hr
==
MF_E_SHUTDOWN
)
{
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_FORWARD
,
FALSE
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_FORWARD
,
FALSE
,
&
rate
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rate_support
,
MFRATE_FORWARD
,
FALSE
,
&
rate
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFRateSupport_Release
(
rate_support
);
return
;
}
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFStreamSink_GetMediaTypeHandler
(
stream_sink
,
&
handler
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFStreamSink_Release
(
stream_sink
);
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_FORWARD
,
FALSE
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rate_support
,
MFRATE_FORWARD
,
FALSE
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_GetCurrentMediaType
(
handler
,
&
media_type
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_FORWARD
,
FALSE
,
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_FORWARD
,
TRUE
,
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_REVERSE
,
FALSE
,
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_REVERSE
,
TRUE
,
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rate_support
,
MFRATE_FORWARD
,
FALSE
,
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rate_support
,
MFRATE_FORWARD
,
TRUE
,
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rate_support
,
MFRATE_REVERSE
,
FALSE
,
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rate_support
,
MFRATE_REVERSE
,
TRUE
,
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFMediaType_Release
(
media_type
);
}
else
{
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_FORWARD
,
FALSE
,
&
rate
);
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_FORWARD
,
TRUE
,
&
rate
);
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_REVERSE
,
FALSE
,
&
rate
);
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetSlowestRate
(
rate_support
,
MFRATE_REVERSE
,
TRUE
,
&
rate
);
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rate_support
,
MFRATE_FORWARD
,
FALSE
,
&
rate
);
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rate_support
,
MFRATE_FORWARD
,
TRUE
,
&
rate
);
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rate_support
,
MFRATE_REVERSE
,
FALSE
,
&
rate
);
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_GetFastestRate
(
rate_support
,
MFRATE_REVERSE
,
TRUE
,
&
rate
);
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
}
IMFMediaTypeHandler_Release
(
handler
);
IMFRateSupport_Release
(
rate_support
);
}
static
void
test_sar
(
void
)
{
IMFPresentationClock
*
present_clock
,
*
present_clock2
;
...
...
@@ -4073,9 +4175,13 @@ if (SUCCEEDED(hr))
IMFMediaType_Release
(
mediatype
);
check_sar_rate_support
(
sink
);
hr
=
IMFMediaTypeHandler_SetCurrentMediaType
(
handler
,
mediatype2
);
ok
(
hr
==
S_OK
,
"Failed to set current type, hr %#x.
\n
"
,
hr
);
check_sar_rate_support
(
sink
);
hr
=
IMFMediaTypeHandler_GetCurrentMediaType
(
handler
,
&
mediatype
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
mediatype
==
mediatype2
,
"Unexpected instance.
\n
"
);
...
...
@@ -4184,6 +4290,8 @@ if (SUCCEEDED(hr))
hr
=
IMFMediaSink_GetPresentationClock
(
sink
,
&
present_clock2
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
check_sar_rate_support
(
sink
);
IMFMediaSink_Release
(
sink
);
/* Activation */
...
...
@@ -4253,6 +4361,8 @@ if (SUCCEEDED(hr))
hr
=
MFCreateAudioRenderer
(
attributes
,
&
sink
);
ok
(
hr
==
MF_E_NO_AUDIO_PLAYBACK_DEVICE
,
"Failed to create a sink, hr %#x.
\n
"
,
hr
);
IMFAttributes_Release
(
attributes
);
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