Nikolay Sivov : mfplay: Implement aspect ratio control methods.

Alexandre Julliard julliard at winehq.org
Wed Apr 21 15:57:54 CDT 2021


Module: wine
Branch: master
Commit: 69e6f194b6ebb29d59d178b5cd23c29810779039
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=69e6f194b6ebb29d59d178b5cd23c29810779039

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Apr 21 12:29:47 2021 +0300

mfplay: Implement aspect ratio control methods.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mfplay/player.c | 30 ++++++++++++++++++++++++++----
 1 file changed, 26 insertions(+), 4 deletions(-)

diff --git a/dlls/mfplay/player.c b/dlls/mfplay/player.c
index cfbb3764905..708df7614e8 100644
--- a/dlls/mfplay/player.c
+++ b/dlls/mfplay/player.c
@@ -1308,17 +1308,39 @@ static HRESULT WINAPI media_player_GetVideoSourceRect(IMFPMediaPlayer *iface,
 
 static HRESULT WINAPI media_player_SetAspectRatioMode(IMFPMediaPlayer *iface, DWORD mode)
 {
-    FIXME("%p, %u.\n", iface, mode);
+    struct media_player *player = impl_from_IMFPMediaPlayer(iface);
+    IMFVideoDisplayControl *display_control;
+    HRESULT hr;
 
-    return E_NOTIMPL;
+    TRACE("%p, %u.\n", iface, mode);
+
+    if (SUCCEEDED(hr = MFGetService((IUnknown *)player->session, &MR_VIDEO_RENDER_SERVICE,
+            &IID_IMFVideoDisplayControl, (void **)&display_control)))
+    {
+        hr = IMFVideoDisplayControl_SetAspectRatioMode(display_control, mode);
+        IMFVideoDisplayControl_Release(display_control);
+    }
+
+    return hr;
 }
 
 static HRESULT WINAPI media_player_GetAspectRatioMode(IMFPMediaPlayer *iface,
         DWORD *mode)
 {
-    FIXME("%p, %p.\n", iface, mode);
+    struct media_player *player = impl_from_IMFPMediaPlayer(iface);
+    IMFVideoDisplayControl *display_control;
+    HRESULT hr;
 
-    return E_NOTIMPL;
+    TRACE("%p, %p.\n", iface, mode);
+
+    if (SUCCEEDED(hr = MFGetService((IUnknown *)player->session, &MR_VIDEO_RENDER_SERVICE,
+            &IID_IMFVideoDisplayControl, (void **)&display_control)))
+    {
+        hr = IMFVideoDisplayControl_GetAspectRatioMode(display_control, mode);
+        IMFVideoDisplayControl_Release(display_control);
+    }
+
+    return hr;
 }
 
 static HRESULT WINAPI media_player_GetVideoWindow(IMFPMediaPlayer *iface, HWND *window)




More information about the wine-cvs mailing list