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 interface IMFNetCredential
;
25 typedef [v1_enum] enum _MFP_CREATION_OPTIONS
28 MFP_OPTION_FREE_THREADED_CALLBACK
= 0x1,
29 MFP_OPTION_NO_MMCSS
= 0x2,
30 MFP_OPTION_NO_REMOTE_DESKTOP_OPTIMIZATION
= 0x4,
31 } MFP_CREATION_OPTIONS
;
33 typedef [v1_enum] enum MFP_MEDIAPLAYER_STATE
35 MFP_MEDIAPLAYER_STATE_EMPTY
= 0,
36 MFP_MEDIAPLAYER_STATE_STOPPED
,
37 MFP_MEDIAPLAYER_STATE_PLAYING
,
38 MFP_MEDIAPLAYER_STATE_PAUSED
,
39 MFP_MEDIAPLAYER_STATE_SHUTDOWN
,
40 } MFP_MEDIAPLAYER_STATE
;
42 typedef enum MFP_EVENT_TYPE
44 MFP_EVENT_TYPE_PLAY
= 0,
47 MFP_EVENT_TYPE_POSITION_SET
,
48 MFP_EVENT_TYPE_RATE_SET
,
49 MFP_EVENT_TYPE_MEDIAITEM_CREATED
,
50 MFP_EVENT_TYPE_MEDIAITEM_SET
,
51 MFP_EVENT_TYPE_FRAME_STEP
,
52 MFP_EVENT_TYPE_MEDIAITEM_CLEARED
,
55 MFP_EVENT_TYPE_PLAYBACK_ENDED
,
56 MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL
,
59 typedef UINT32 MFP_MEDIAITEM_CHARACTERISTICS
;
61 typedef [v1_enum] enum _MFP_MEDIAITEM_CHARACTERISTICS
63 MFP_MEDIAITEM_IS_LIVE
= 0x00000001,
64 MFP_MEDIAITEM_CAN_SEEK
= 0x00000002,
65 MFP_MEDIAITEM_CAN_PAUSE
= 0x00000004,
66 MFP_MEDIAITEM_HAS_SLOW_SEEK
= 0x00000008,
67 } _MFP_MEDIAITEM_CHARACTERISTICS
;
69 typedef UINT32 MFP_CREDENTIAL_FLAGS
;
71 typedef [v1_enum] enum _MFP_CREDENTIAL_FLAGS
73 MFP_CREDENTIAL_PROMPT
= 0x00000001,
74 MFP_CREDENTIAL_SAVE
= 0x00000002,
75 MFP_CREDENTIAL_DO_NOT_CACHE
= 0x00000004,
76 MFP_CREDENTIAL_CLEAR_TEXT
= 0x00000008,
77 MFP_CREDENTIAL_PROXY
= 0x00000010,
78 MFP_CREDENTIAL_LOGGED_ON_USER
= 0x00000020,
79 } _MFP_CREDENTIAL_FLAGS
;
81 interface IMFPMediaPlayer
;
82 interface IMFPMediaItem
;
84 typedef struct MFP_EVENT_HEADER
86 MFP_EVENT_TYPE eEventType
;
88 IMFPMediaPlayer
*pMediaPlayer
;
89 MFP_MEDIAPLAYER_STATE eState
;
90 IPropertyStore
*pPropertyStore
;
93 typedef struct MFP_PLAY_EVENT
95 MFP_EVENT_HEADER header
;
96 IMFPMediaItem
*pMediaItem
;
99 typedef struct MFP_PAUSE_EVENT
101 MFP_EVENT_HEADER header
;
102 IMFPMediaItem
*pMediaItem
;
105 typedef struct MFP_STOP_EVENT
107 MFP_EVENT_HEADER header
;
108 IMFPMediaItem
*pMediaItem
;
111 typedef struct MFP_POSITION_SET_EVENT
113 MFP_EVENT_HEADER header
;
114 IMFPMediaItem
*pMediaItem
;
115 } MFP_POSITION_SET_EVENT
;
117 typedef struct MFP_RATE_SET_EVENT
119 MFP_EVENT_HEADER header
;
120 IMFPMediaItem
*pMediaItem
;
122 } MFP_RATE_SET_EVENT
;
124 typedef struct MFP_MEDIAITEM_CREATED_EVENT
126 MFP_EVENT_HEADER header
;
127 IMFPMediaItem
*pMediaItem
;
128 DWORD_PTR dwUserData
;
129 } MFP_MEDIAITEM_CREATED_EVENT
;
131 typedef struct MFP_MEDIAITEM_SET_EVENT
133 MFP_EVENT_HEADER header
;
134 IMFPMediaItem
*pMediaItem
;
135 } MFP_MEDIAITEM_SET_EVENT
;
137 typedef struct MFP_FRAME_STEP_EVENT
139 MFP_EVENT_HEADER header
;
140 IMFPMediaItem
*pMediaItem
;
141 } MFP_FRAME_STEP_EVENT
;
143 typedef struct MFP_MEDIAITEM_CLEARED_EVENT
145 MFP_EVENT_HEADER header
;
146 IMFPMediaItem
*pMediaItem
;
147 } MFP_MEDIAITEM_CLEARED_EVENT
;
149 typedef struct MFP_MF_EVENT
151 MFP_EVENT_HEADER header
;
152 MediaEventType MFEventType
;
153 IMFMediaEvent
*pMFMediaEvent
;
154 IMFPMediaItem
*pMediaItem
;
157 typedef struct MFP_ERROR_EVENT
159 MFP_EVENT_HEADER header
;
162 typedef struct MFP_PLAYBACK_ENDED_EVENT
164 MFP_EVENT_HEADER header
;
165 IMFPMediaItem
*pMediaItem
;
166 } MFP_PLAYBACK_ENDED_EVENT
;
168 typedef struct MFP_ACQUIRE_USER_CREDENTIAL_EVENT
170 MFP_EVENT_HEADER header
;
171 DWORD_PTR dwUserData
;
172 BOOL fProceedWithAuthentication
;
173 HRESULT hrAuthenticationStatus
;
179 MFP_CREDENTIAL_FLAGS flags
;
180 IMFNetCredential
*pCredential
;
181 } MFP_ACQUIRE_USER_CREDENTIAL_EVENT
;
185 uuid(766c8ffb
-5fdb
-4fea
-a28d
-b912996f51bd
),
188 interface IMFPMediaPlayerCallback
: IUnknown
190 void OnMediaPlayerEvent
([in] MFP_EVENT_HEADER
*event_header
);
195 uuid(a714590a
-58af
-430a
-85bf
-44f5ec838d85
),
198 interface IMFPMediaPlayer
: IUnknown
209 [in] REFGUID position_type
,
210 [in] const PROPVARIANT
*position
);
213 [in] REFGUID position_type
,
214 [out] PROPVARIANT
*position
);
217 [in] REFGUID position_type
,
218 [out] PROPVARIANT
*duration
);
226 HRESULT GetSupportedRates
(
228 [out] float *slowest_rate
,
229 [out] float *fastest_rate
);
232 [out] MFP_MEDIAPLAYER_STATE
*state
);
234 HRESULT CreateMediaItemFromURL
(
235 [in] const WCHAR
*url
,
237 [in] DWORD_PTR user_data
,
238 [out] IMFPMediaItem
**item
);
240 HRESULT CreateMediaItemFromObject
(
241 [in] IUnknown
*object,
243 [in] DWORD_PTR user_data
,
244 [out] IMFPMediaItem
**item
);
246 HRESULT SetMediaItem
(
247 [in] IMFPMediaItem
*item
);
249 HRESULT ClearMediaItem
();
251 HRESULT GetMediaItem
(
252 [out] IMFPMediaItem
**item
);
255 [out] float *volume
);
261 [out] float *balance
);
272 HRESULT GetNativeVideoSize
(
274 [out] SIZE
*arvideo
);
276 HRESULT GetIdealVideoSize
(
277 [out] SIZE
*min_size
,
278 [out] SIZE
*max_size
);
280 HRESULT SetVideoSourceRect
(
281 [in] MFVideoNormalizedRect
const *rect
);
283 HRESULT GetVideoSourceRect
(
284 [out] MFVideoNormalizedRect
*rect
);
286 HRESULT SetAspectRatioMode
(
289 HRESULT GetAspectRatioMode
(
292 HRESULT GetVideoWindow
(
295 HRESULT UpdateVideo
();
297 HRESULT SetBorderColor
(
298 [in] COLORREF color
);
300 HRESULT GetBorderColor
(
301 [out] COLORREF
*color
);
303 HRESULT InsertEffect
(
304 [in] IUnknown
*effect
,
307 HRESULT RemoveEffect
(
308 [in] IUnknown
*effect
);
310 HRESULT RemoveAllEffects
();
317 uuid(90eb3e6b
-ecbf
-45cc
-b1da
-c6fe3ea70d57
),
320 interface IMFPMediaItem
: IUnknown
322 HRESULT GetMediaPlayer
(
323 [out] IMFPMediaPlayer
**player
);
329 [out] IUnknown
**obj
);
332 [out] DWORD_PTR
*user_data
);
335 [in] DWORD_PTR user_data
);
337 HRESULT GetStartStopPosition
(
338 [out] GUID
*start_format
,
339 [out] PROPVARIANT
*start_position
,
340 [out] GUID
*stop_format
,
341 [out] PROPVARIANT
*stop_position
);
343 HRESULT SetStartStopPosition
(
344 [in] const GUID
*start_format
,
345 [in] const PROPVARIANT
*start_position
,
346 [in] const GUID
*stop_format
,
347 [in] const PROPVARIANT
*stop_position
);
350 [out] BOOL
*has_video
,
351 [out] BOOL
*selected
);
354 [out] BOOL
*has_audio
,
355 [out] BOOL
*selected
);
358 [out] BOOL
*protected
);
362 [out] PROPVARIANT
*value
);
364 HRESULT GetNumberOfStreams
(
367 HRESULT GetStreamSelection
(
369 [out] BOOL
*enabled
);
371 HRESULT SetStreamSelection
(
375 HRESULT GetStreamAttribute
(
378 [out] PROPVARIANT
*value
);
380 HRESULT GetPresentationAttribute
(
382 [out] PROPVARIANT
*value
);
384 HRESULT GetCharacteristics
(
385 [out] MFP_MEDIAITEM_CHARACTERISTICS
*flags
);
387 HRESULT SetStreamSink
(
389 [in] IUnknown
*sink
);
392 [out] IPropertyStore
**metadata
);
395 cpp_quote
("HRESULT WINAPI MFPCreateMediaPlayer(const WCHAR *url, BOOL start_playback, MFP_CREATION_OPTIONS options, ")
396 cpp_quote
(" IMFPMediaPlayerCallback *callback, HWND hwnd, IMFPMediaPlayer **player);")