2 * Copyright 2019 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
23 typedef [v1_enum] enum _MFP_CREATION_OPTIONS
26 MFP_OPTION_FREE_THREADED_CALLBACK
= 0x1,
27 MFP_OPTION_NO_MMCSS
= 0x2,
28 MFP_OPTION_NO_REMOTE_DESKTOP_OPTIMIZATION
= 0x4,
29 } MFP_CREATION_OPTIONS
;
31 typedef [v1_enum] enum MFP_MEDIAPLAYER_STATE
33 MFP_MEDIAPLAYER_STATE_EMPTY
= 0,
34 MFP_MEDIAPLAYER_STATE_STOPPED
,
35 MFP_MEDIAPLAYER_STATE_PLAYING
,
36 MFP_MEDIAPLAYER_STATE_PAUSED
,
37 MFP_MEDIAPLAYER_STATE_SHUTDOWN
,
38 } MFP_MEDIAPLAYER_STATE
;
40 typedef enum MFP_EVENT_TYPE
42 MFP_EVENT_TYPE_PLAY
= 0,
45 MFP_EVENT_TYPE_POSITION_SET
,
46 MFP_EVENT_TYPE_RATE_SET
,
47 MFP_EVENT_TYPE_MEDIAITEM_CREATED
,
48 MFP_EVENT_TYPE_MEDIAITEM_SET
,
49 MFP_EVENT_TYPE_FRAME_STEP
,
50 MFP_EVENT_TYPE_MEDIAITEM_CLEARED
,
53 MFP_EVENT_TYPE_PLAYBACK_ENDED
,
54 MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL
,
57 interface IMFPMediaPlayer
;
58 interface IMFPMediaItem
;
60 typedef struct MFP_EVENT_HEADER
62 MFP_EVENT_TYPE eEventType
;
64 IMFPMediaPlayer
*pMediaPlayer
;
65 MFP_MEDIAPLAYER_STATE eState
;
66 IPropertyStore
*pPropertyStore
;
71 uuid(766c8ffb
-5fdb
-4fea
-a28d
-b912996f51bd
),
74 interface IMFPMediaPlayerCallback
: IUnknown
76 void OnMediaPlayerEvent
([in] MFP_EVENT_HEADER
*event_header
);
81 uuid(a714590a
-58af
-430a
-85bf
-44f5ec838d85
),
84 interface IMFPMediaPlayer
: IUnknown
95 [in] REFGUID position_type
,
96 [in] const PROPVARIANT
*position
);
99 [in] REFGUID position_type
,
100 [out] PROPVARIANT
*position
);
103 [in] REFGUID position_type
,
104 [out] PROPVARIANT
*duration
);
112 HRESULT GetSupportedRates
(
114 [out] float *slowest_rate
,
115 [out] float *fastest_rate
);
118 [out] MFP_MEDIAPLAYER_STATE
*state
);
120 HRESULT CreateMediaItemFromURL
(
121 [in] const WCHAR
*url
,
123 [in] DWORD_PTR user_data
,
124 [out] IMFPMediaItem
**item
);
126 HRESULT CreateMediaItemFromObject
(
127 [in] IUnknown
*object,
129 [in] DWORD_PTR user_data
,
130 [out] IMFPMediaItem
**item
);
132 HRESULT SetMediaItem
(
133 [in] IMFPMediaItem
*item
);
135 HRESULT ClearMediaItem
();
137 HRESULT GetMediaItem
(
138 [out] IMFPMediaItem
**item
);
141 [out] float *volume
);
147 [out] float *balance
);
158 HRESULT GetNativeVideoSize
(
160 [out] SIZE
*arvideo
);
162 HRESULT GetIdealVideoSize
(
163 [out] SIZE
*min_size
,
164 [out] SIZE
*max_size
);
166 HRESULT SetVideoSourceRect
(
167 [in] MFVideoNormalizedRect
const *rect
);
169 HRESULT GetVideoSourceRect
(
170 [out] MFVideoNormalizedRect
*rect
);
172 HRESULT SetAspectRatioMode
(
175 HRESULT GetAspectRatioMode
(
178 HRESULT GetVideoWindow
(
181 HRESULT UpdateVideo
();
183 HRESULT SetBorderColor
(
184 [in] COLORREF color
);
186 HRESULT GetBorderColor
(
187 [out] COLORREF
*color
);
189 HRESULT InsertEffect
(
190 [in] IUnknown
*effect
,
193 HRESULT RemoveEffect
(
194 [in] IUnknown
*effect
);
196 HRESULT RemoveAllEffects
();
201 cpp_quote
("HRESULT WINAPI MFPCreateMediaPlayer(const WCHAR *url, BOOL start_playback, MFP_CREATION_OPTIONS options, ")
202 cpp_quote
(" IMFPMediaPlayerCallback *callback, HWND hwnd, IMFPMediaPlayer **player);")