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
f4280cc0
Commit
f4280cc0
authored
Feb 28, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Add support for returning slowest/fastest rates for session.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0e8ea983
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
4 deletions
+58
-4
session.c
dlls/mf/session.c
+58
-4
No files found.
dlls/mf/session.c
View file @
f4280cc0
...
...
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
#include <math.h>
#define COBJMACROS
...
...
@@ -1447,20 +1448,73 @@ static ULONG WINAPI session_rate_support_Release(IMFRateSupport *iface)
return
IMFMediaSession_Release
(
&
session
->
IMFMediaSession_iface
);
}
static
void
session_presentation_object_get_rate
(
IUnknown
*
object
,
MFRATE_DIRECTION
direction
,
BOOL
thin
,
BOOL
fastest
,
float
*
result
)
{
IMFRateSupport
*
rate_support
;
float
rate
;
if
(
SUCCEEDED
(
MFGetService
(
object
,
&
MF_RATE_CONTROL_SERVICE
,
&
IID_IMFRateSupport
,
(
void
**
)
&
rate_support
)))
{
rate
=
0
.
0
f
;
if
(
fastest
)
{
if
(
SUCCEEDED
(
IMFRateSupport_GetFastestRate
(
rate_support
,
direction
,
thin
,
&
rate
)))
*
result
=
min
(
fabsf
(
rate
),
*
result
);
}
else
{
if
(
SUCCEEDED
(
IMFRateSupport_GetSlowestRate
(
rate_support
,
direction
,
thin
,
&
rate
)))
*
result
=
max
(
fabsf
(
rate
),
*
result
);
}
IMFRateSupport_Release
(
rate_support
);
}
}
static
HRESULT
session_get_presentation_rate
(
struct
media_session
*
session
,
MFRATE_DIRECTION
direction
,
BOOL
thin
,
BOOL
fastest
,
float
*
result
)
{
struct
media_source
*
source
;
struct
media_sink
*
sink
;
*
result
=
0
.
0
f
;
EnterCriticalSection
(
&
session
->
cs
);
LIST_FOR_EACH_ENTRY
(
source
,
&
session
->
presentation
.
sources
,
struct
media_source
,
entry
)
{
session_presentation_object_get_rate
((
IUnknown
*
)
source
->
source
,
direction
,
thin
,
fastest
,
result
);
}
LIST_FOR_EACH_ENTRY
(
sink
,
&
session
->
presentation
.
sinks
,
struct
media_sink
,
entry
)
{
session_presentation_object_get_rate
((
IUnknown
*
)
sink
->
sink
,
direction
,
thin
,
fastest
,
result
);
}
LeaveCriticalSection
(
&
session
->
cs
);
return
S_OK
;
}
static
HRESULT
WINAPI
session_rate_support_GetSlowestRate
(
IMFRateSupport
*
iface
,
MFRATE_DIRECTION
direction
,
BOOL
thin
,
float
*
rate
)
{
FIXME
(
"%p, %d, %d, %p.
\n
"
,
iface
,
direction
,
thin
,
rat
e
);
struct
media_session
*
session
=
impl_session_from_IMFRateSupport
(
ifac
e
);
return
E_NOTIMPL
;
TRACE
(
"%p, %d, %d, %p.
\n
"
,
iface
,
direction
,
thin
,
rate
);
return
session_get_presentation_rate
(
session
,
direction
,
thin
,
FALSE
,
rate
);
}
static
HRESULT
WINAPI
session_rate_support_GetFastestRate
(
IMFRateSupport
*
iface
,
MFRATE_DIRECTION
direction
,
BOOL
thin
,
float
*
rate
)
{
FIXME
(
"%p, %d, %d, %p.
\n
"
,
iface
,
direction
,
thin
,
rat
e
);
struct
media_session
*
session
=
impl_session_from_IMFRateSupport
(
ifac
e
);
return
E_NOTIMPL
;
TRACE
(
"%p, %d, %d, %p.
\n
"
,
iface
,
direction
,
thin
,
rate
);
return
session_get_presentation_rate
(
session
,
direction
,
thin
,
TRUE
,
rate
);
}
static
HRESULT
WINAPI
session_rate_support_IsRateSupported
(
IMFRateSupport
*
iface
,
BOOL
thin
,
float
rate
,
...
...
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