2 * Copyright 2021 Nikolay Sivov for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/test.h"
29 static HRESULT WINAPI
test_callback_QueryInterface(IMFPMediaPlayerCallback
*iface
, REFIID riid
, void **obj
)
31 if (IsEqualIID(riid
, &IID_IMFPMediaPlayerCallback
) ||
32 IsEqualIID(riid
, &IID_IUnknown
))
35 IMFPMediaPlayerCallback_AddRef(iface
);
43 static ULONG WINAPI
test_callback_AddRef(IMFPMediaPlayerCallback
*iface
)
48 static ULONG WINAPI
test_callback_Release(IMFPMediaPlayerCallback
*iface
)
53 static void WINAPI
test_callback_OnMediaPlayerEvent(IMFPMediaPlayerCallback
*iface
, MFP_EVENT_HEADER
*event_header
)
57 static const IMFPMediaPlayerCallbackVtbl test_callback_vtbl
=
59 test_callback_QueryInterface
,
61 test_callback_Release
,
62 test_callback_OnMediaPlayerEvent
,
65 static void test_create_player(void)
67 IMFPMediaPlayerCallback callback
= { &test_callback_vtbl
};
68 IMFPMediaPlayer
*player
;
71 hr
= MFPCreateMediaPlayer(NULL
, FALSE
, 0, NULL
, NULL
, &player
);
72 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
73 IMFPMediaPlayer_Release(player
);
75 hr
= MFPCreateMediaPlayer(NULL
, FALSE
, 0, &callback
, NULL
, &player
);
76 ok(hr
== S_OK
, "Unexpected hr %#x.\n", hr
);
77 IMFPMediaPlayer_Release(player
);