[PATCH 5/8] mfplay: Implement source rectangle methods.
Nikolay Sivov
nsivov at codeweavers.com
Wed Apr 21 04:29:46 CDT 2021
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/mfplay/player.c | 31 +++++++++++++++++++++++++++----
1 file changed, 27 insertions(+), 4 deletions(-)
diff --git a/dlls/mfplay/player.c b/dlls/mfplay/player.c
index 80c88721c78..cfbb3764905 100644
--- a/dlls/mfplay/player.c
+++ b/dlls/mfplay/player.c
@@ -1270,17 +1270,40 @@ static HRESULT WINAPI media_player_GetIdealVideoSize(IMFPMediaPlayer *iface,
static HRESULT WINAPI media_player_SetVideoSourceRect(IMFPMediaPlayer *iface,
MFVideoNormalizedRect const *rect)
{
- FIXME("%p, %p.\n", iface, rect);
+ struct media_player *player = impl_from_IMFPMediaPlayer(iface);
+ IMFVideoDisplayControl *display_control;
+ HRESULT hr;
- return E_NOTIMPL;
+ TRACE("%p, %p.\n", iface, rect);
+
+ if (SUCCEEDED(hr = MFGetService((IUnknown *)player->session, &MR_VIDEO_RENDER_SERVICE,
+ &IID_IMFVideoDisplayControl, (void **)&display_control)))
+ {
+ hr = IMFVideoDisplayControl_SetVideoPosition(display_control, rect, NULL);
+ IMFVideoDisplayControl_Release(display_control);
+ }
+
+ return hr;
}
static HRESULT WINAPI media_player_GetVideoSourceRect(IMFPMediaPlayer *iface,
MFVideoNormalizedRect *rect)
{
- FIXME("%p, %p.\n", iface, rect);
+ struct media_player *player = impl_from_IMFPMediaPlayer(iface);
+ IMFVideoDisplayControl *display_control;
+ HRESULT hr;
+ RECT dest;
- return E_NOTIMPL;
+ TRACE("%p, %p.\n", iface, rect);
+
+ if (SUCCEEDED(hr = MFGetService((IUnknown *)player->session, &MR_VIDEO_RENDER_SERVICE,
+ &IID_IMFVideoDisplayControl, (void **)&display_control)))
+ {
+ hr = IMFVideoDisplayControl_GetVideoPosition(display_control, rect, &dest);
+ IMFVideoDisplayControl_Release(display_control);
+ }
+
+ return hr;
}
static HRESULT WINAPI media_player_SetAspectRatioMode(IMFPMediaPlayer *iface, DWORD mode)
--
2.30.2
More information about the wine-devel
mailing list