Nikolay Sivov : mfplay: Implement GetSupportedRates().
Alexandre Julliard
julliard at winehq.org
Wed Apr 7 15:48:30 CDT 2021
Module: wine
Branch: master
Commit: b39b55a10be6b294b626b4b2800a81beab4f5029
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b39b55a10be6b294b626b4b2800a81beab4f5029
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Wed Apr 7 11:07:04 2021 +0300
mfplay: Implement GetSupportedRates().
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mfplay/player.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/mfplay/player.c b/dlls/mfplay/player.c
index ddc83e9f441..3aa03103240 100644
--- a/dlls/mfplay/player.c
+++ b/dlls/mfplay/player.c
@@ -722,11 +722,23 @@ static HRESULT WINAPI media_player_GetRate(IMFPMediaPlayer *iface, float *rate)
return E_NOTIMPL;
}
-static HRESULT WINAPI media_player_GetSupportedRates(IMFPMediaPlayer *iface, BOOL forward, float *slowest_rate, float *fastest_rate)
+static HRESULT WINAPI media_player_GetSupportedRates(IMFPMediaPlayer *iface, BOOL forward,
+ float *slowest_rate, float *fastest_rate)
{
- FIXME("%p, %d, %p, %p.\n", iface, forward, slowest_rate, fastest_rate);
+ struct media_player *player = impl_from_IMFPMediaPlayer(iface);
+ IMFRateSupport *rs;
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("%p, %d, %p, %p.\n", iface, forward, slowest_rate, fastest_rate);
+
+ if (SUCCEEDED(hr = MFGetService((IUnknown *)player->session, &MF_RATE_CONTROL_SERVICE, &IID_IMFRateSupport, (void **)&rs)))
+ {
+ if (SUCCEEDED(hr = IMFRateSupport_GetSlowestRate(rs, forward ? MFRATE_FORWARD : MFRATE_REVERSE, FALSE, slowest_rate)))
+ hr = IMFRateSupport_GetFastestRate(rs, forward ? MFRATE_FORWARD : MFRATE_REVERSE, FALSE, fastest_rate);
+ IMFRateSupport_Release(rs);
+ }
+
+ return hr;
}
static HRESULT WINAPI media_player_GetState(IMFPMediaPlayer *iface, MFP_MEDIAPLAYER_STATE *state)
More information about the wine-cvs
mailing list