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
1d2e6e6a
Commit
1d2e6e6a
authored
Feb 16, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/evr: Implement IsRateSupported().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d54a0e2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
4 deletions
+121
-4
evr.c
dlls/mf/evr.c
+30
-3
mf.c
dlls/mf/tests/mf.c
+91
-1
No files found.
dlls/mf/evr.c
View file @
1d2e6e6a
...
...
@@ -2715,6 +2715,17 @@ static ULONG WINAPI video_renderer_rate_support_Release(IMFRateSupport *iface)
return
IMFMediaSink_Release
(
&
renderer
->
IMFMediaSink_iface
);
}
static
BOOL
video_renderer_is_main_stream_configured
(
const
struct
video_renderer
*
renderer
)
{
IMFMediaType
*
media_type
;
HRESULT
hr
;
if
(
SUCCEEDED
(
hr
=
IMFTransform_GetInputCurrentType
(
renderer
->
mixer
,
0
,
&
media_type
)))
IMFMediaType_Release
(
media_type
);
return
SUCCEEDED
(
hr
);
}
static
HRESULT
WINAPI
video_renderer_rate_support_GetSlowestRate
(
IMFRateSupport
*
iface
,
MFRATE_DIRECTION
direction
,
BOOL
thin
,
float
*
rate
)
{
...
...
@@ -2741,11 +2752,27 @@ static HRESULT WINAPI video_renderer_rate_support_GetFastestRate(IMFRateSupport
}
static
HRESULT
WINAPI
video_renderer_rate_support_IsRateSupported
(
IMFRateSupport
*
iface
,
BOOL
thin
,
float
rate
,
float
*
nearest_
supported_
rate
)
float
*
nearest_rate
)
{
FIXME
(
"%p, %d, %f, %p.
\n
"
,
iface
,
thin
,
rate
,
nearest_supported_rate
);
struct
video_renderer
*
renderer
=
impl_from_IMFRateSupport
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %d, %f, %p.
\n
"
,
iface
,
thin
,
rate
,
nearest_rate
);
EnterCriticalSection
(
&
renderer
->
cs
);
if
(
renderer
->
flags
&
EVR_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
{
if
(
!
thin
&&
!
video_renderer_is_main_stream_configured
(
renderer
))
hr
=
MF_E_INVALIDREQUEST
;
if
(
nearest_rate
)
*
nearest_rate
=
rate
;
}
LeaveCriticalSection
(
&
renderer
->
cs
);
return
hr
;
}
static
const
IMFRateSupportVtbl
video_renderer_rate_support_vtbl
=
...
...
dlls/mf/tests/mf.c
View file @
1d2e6e6a
...
...
@@ -4258,6 +4258,10 @@ if (SUCCEEDED(hr))
static
void
test_evr
(
void
)
{
static
const
float
supported_rates
[]
=
{
0
.
0
f
,
1
.
0
f
,
-
20
.
0
f
,
20
.
0
f
,
1000
.
0
f
,
-
1000
.
0
f
,
};
IMFVideoSampleAllocatorCallback
*
allocator_callback
;
IMFStreamSink
*
stream_sink
,
*
stream_sink2
;
IMFVideoDisplayControl
*
display_control
;
...
...
@@ -4275,8 +4279,9 @@ static void test_evr(void)
IMFRateSupport
*
rs
;
LONG
sample_count
;
IMFSample
*
sample
;
IUnknown
*
unk
;
unsigned
int
i
;
UINT64
window3
;
IUnknown
*
unk
;
float
rate
;
HRESULT
hr
;
GUID
guid
;
...
...
@@ -4607,6 +4612,88 @@ todo_wine {
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_REVERSE
,
TRUE
,
&
rate
);
ok
(
hr
==
MF_E_INVALIDREQUEST
,
"Unexpected hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
supported_rates
);
++
i
)
{
rate
=
supported_rates
[
i
]
+
1
.
0
f
;
hr
=
IMFRateSupport_IsRateSupported
(
rs
,
TRUE
,
supported_rates
[
i
],
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rate
==
supported_rates
[
i
],
"Unexpected rate %f.
\n
"
,
rate
);
rate
=
supported_rates
[
i
]
+
1
.
0
f
;
hr
=
IMFRateSupport_IsRateSupported
(
rs
,
FALSE
,
supported_rates
[
i
],
&
rate
);
ok
(
hr
==
MF_E_INVALIDREQUEST
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rate
==
supported_rates
[
i
],
"Unexpected rate %f.
\n
"
,
rate
);
hr
=
IMFRateSupport_IsRateSupported
(
rs
,
TRUE
,
supported_rates
[
i
],
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_IsRateSupported
(
rs
,
FALSE
,
supported_rates
[
i
],
NULL
);
ok
(
hr
==
MF_E_INVALIDREQUEST
,
"Unexpected hr %#x.
\n
"
,
hr
);
}
/* Configuring stream type make rate support work. */
hr
=
IMFMediaSink_GetStreamSinkById
(
sink
,
0
,
&
stream_sink
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFStreamSink_GetMediaTypeHandler
(
stream_sink
,
&
type_handler
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
MFCreateMediaType
(
&
media_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaType_SetGUID
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
MFMediaType_Video
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaType_SetGUID
(
media_type
,
&
MF_MT_SUBTYPE
,
&
MFVideoFormat_RGB32
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaType_SetUINT64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
(
UINT64
)
64
<<
32
|
64
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_ALL_SAMPLES_INDEPENDENT
,
TRUE
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_SetCurrentMediaType
(
type_handler
,
media_type
);
ok
(
hr
==
S_OK
,
"Failed to set current type, hr %#x.
\n
"
,
hr
);
rate
=
1
.
0
f
;
hr
=
IMFRateSupport_GetSlowestRate
(
rs
,
MFRATE_FORWARD
,
TRUE
,
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rate
==
0
.
0
f
,
"Unexpected rate %f.
\n
"
,
rate
);
rate
=
1
.
0
f
;
hr
=
IMFRateSupport_GetSlowestRate
(
rs
,
MFRATE_REVERSE
,
TRUE
,
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rate
==
0
.
0
f
,
"Unexpected rate %f.
\n
"
,
rate
);
rate
=
0
.
0
f
;
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_FORWARD
,
TRUE
,
&
rate
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rate
==
FLT_MAX
,
"Unexpected rate %f.
\n
"
,
rate
);
}
rate
=
0
.
0
f
;
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_REVERSE
,
TRUE
,
&
rate
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rate
==
-
FLT_MAX
,
"Unexpected rate %f.
\n
"
,
rate
);
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
supported_rates
);
++
i
)
{
rate
=
supported_rates
[
i
]
+
1
.
0
f
;
hr
=
IMFRateSupport_IsRateSupported
(
rs
,
TRUE
,
supported_rates
[
i
],
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rate
==
supported_rates
[
i
],
"Unexpected rate %f.
\n
"
,
rate
);
rate
=
supported_rates
[
i
]
+
1
.
0
f
;
hr
=
IMFRateSupport_IsRateSupported
(
rs
,
FALSE
,
supported_rates
[
i
],
&
rate
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
rate
==
supported_rates
[
i
],
"Unexpected rate %f.
\n
"
,
rate
);
hr
=
IMFRateSupport_IsRateSupported
(
rs
,
TRUE
,
supported_rates
[
i
],
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_IsRateSupported
(
rs
,
FALSE
,
supported_rates
[
i
],
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
}
IMFMediaTypeHandler_Release
(
type_handler
);
IMFMediaType_Release
(
media_type
);
IMFStreamSink_Release
(
stream_sink
);
hr
=
IMFMediaSink_Shutdown
(
sink
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -4622,6 +4709,9 @@ todo_wine {
hr
=
IMFRateSupport_GetFastestRate
(
rs
,
MFRATE_FORWARD
,
FALSE
,
&
rate
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFRateSupport_IsRateSupported
(
rs
,
TRUE
,
1
.
0
f
,
&
rate
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFPresentationClock_Release
(
clock
);
IMFActivate_Release
(
activate
);
...
...
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