Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/mfplay/player.c | 18 ++++++++++++------
dlls/mfplay/tests/mfplay.c | 8 +++++++-
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/dlls/mfplay/player.c b/dlls/mfplay/player.c
index 246704c2799..479aca40890 100644
--- a/dlls/mfplay/player.c
+++ b/dlls/mfplay/player.c
@@ -69,6 +69,7 @@ struct media_player
IMFSourceResolver *resolver;
MFP_CREATION_OPTIONS options;
HWND event_window;
+ HWND output_window;
};
struct generic_event
@@ -862,11 +863,15 @@ static HRESULT WINAPI media_player_GetAspectRatioMode(IMFPMediaPlayer *iface,
return E_NOTIMPL;
}
-static HRESULT WINAPI media_player_GetVideoWindow(IMFPMediaPlayer *iface, HWND *hwnd)
+static HRESULT WINAPI media_player_GetVideoWindow(IMFPMediaPlayer *iface, HWND *window)
{
- FIXME("%p, %p.\n", iface, hwnd);
+ struct media_player *player = impl_from_IMFPMediaPlayer(iface);
- return E_NOTIMPL;
+ TRACE("%p, %p.\n", iface, window);
+
+ *window = player->output_window;
+
+ return S_OK;
}
static HRESULT WINAPI media_player_UpdateVideo(IMFPMediaPlayer *iface)
@@ -1166,12 +1171,12 @@ static const IMFAsyncCallbackVtbl media_player_events_callback_vtbl =
};
HRESULT WINAPI MFPCreateMediaPlayer(const WCHAR *url, BOOL start_playback, MFP_CREATION_OPTIONS options,
- IMFPMediaPlayerCallback *callback, HWND hwnd, IMFPMediaPlayer **player)
+ IMFPMediaPlayerCallback *callback, HWND window, IMFPMediaPlayer **player)
{
struct media_player *object;
HRESULT hr;
- TRACE("%s, %d, %#x, %p, %p, %p.\n", debugstr_w(url), start_playback, options, callback, hwnd, player);
+ TRACE("%s, %d, %#x, %p, %p, %p.\n", debugstr_w(url), start_playback, options, callback, window, player);
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
@@ -1184,9 +1189,10 @@ HRESULT WINAPI MFPCreateMediaPlayer(const WCHAR *url, BOOL start_playback, MFP_C
object->events_callback.lpVtbl = &media_player_events_callback_vtbl;
object->refcount = 1;
object->callback = callback;
- object->options = options;
if (object->callback)
IMFPMediaPlayerCallback_AddRef(object->callback);
+ object->options = options;
+ object->output_window = window;
if (FAILED(hr = CreatePropertyStore(&object->propstore)))
goto failed;
if (FAILED(hr = MFCreateSourceResolver(&object->resolver)))
diff --git a/dlls/mfplay/tests/mfplay.c b/dlls/mfplay/tests/mfplay.c
index 64347265c40..6d82f630075 100644
--- a/dlls/mfplay/tests/mfplay.c
+++ b/dlls/mfplay/tests/mfplay.c
@@ -83,6 +83,7 @@ static void test_create_player(void)
IPropertyStore *propstore;
IMFPMediaPlayer *player;
IUnknown *unk, *unk2;
+ HWND window;
HRESULT hr;
hr = MFPCreateMediaPlayer(NULL, FALSE, 0, NULL, NULL, &player);
@@ -108,8 +109,13 @@ static void test_create_player(void)
IMFPMediaPlayer_Release(player);
- hr = MFPCreateMediaPlayer(NULL, FALSE, 0, &callback, NULL, &player);
+ hr = MFPCreateMediaPlayer(NULL, FALSE, 0, &callback, (HWND)0x1, &player);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+ hr = IMFPMediaPlayer_GetVideoWindow(player, &window);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(window == (HWND)0x1, "Unexpected window.\n");
+
IMFPMediaPlayer_Release(player);
}
--
2.30.2