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 UINT32 MFP_CREATION_OPTIONS
;
27 typedef [v1_enum] enum _MFP_CREATION_OPTIONS
30 MFP_OPTION_FREE_THREADED_CALLBACK
= 0x1,
31 MFP_OPTION_NO_MMCSS
= 0x2,
32 MFP_OPTION_NO_REMOTE_DESKTOP_OPTIMIZATION
= 0x4,
33 } _MFP_CREATION_OPTIONS
;
35 typedef [v1_enum] enum MFP_MEDIAPLAYER_STATE
37 MFP_MEDIAPLAYER_STATE_EMPTY
= 0,
38 MFP_MEDIAPLAYER_STATE_STOPPED
,
39 MFP_MEDIAPLAYER_STATE_PLAYING
,
40 MFP_MEDIAPLAYER_STATE_PAUSED
,
41 MFP_MEDIAPLAYER_STATE_SHUTDOWN
,
42 } MFP_MEDIAPLAYER_STATE
;
44 typedef enum MFP_EVENT_TYPE
46 MFP_EVENT_TYPE_PLAY
= 0,
49 MFP_EVENT_TYPE_POSITION_SET
,
50 MFP_EVENT_TYPE_RATE_SET
,
51 MFP_EVENT_TYPE_MEDIAITEM_CREATED
,
52 MFP_EVENT_TYPE_MEDIAITEM_SET
,
53 MFP_EVENT_TYPE_FRAME_STEP
,
54 MFP_EVENT_TYPE_MEDIAITEM_CLEARED
,
57 MFP_EVENT_TYPE_PLAYBACK_ENDED
,
58 MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL
,
61 typedef UINT32 MFP_MEDIAITEM_CHARACTERISTICS
;
63 typedef [v1_enum] enum _MFP_MEDIAITEM_CHARACTERISTICS
65 MFP_MEDIAITEM_IS_LIVE
= 0x00000001,
66 MFP_MEDIAITEM_CAN_SEEK
= 0x00000002,
67 MFP_MEDIAITEM_CAN_PAUSE
= 0x00000004,
68 MFP_MEDIAITEM_HAS_SLOW_SEEK
= 0x00000008,
69 } _MFP_MEDIAITEM_CHARACTERISTICS
;
71 typedef UINT32 MFP_CREDENTIAL_FLAGS
;
73 typedef [v1_enum] enum _MFP_CREDENTIAL_FLAGS
75 MFP_CREDENTIAL_PROMPT
= 0x00000001,
76 MFP_CREDENTIAL_SAVE
= 0x00000002,
77 MFP_CREDENTIAL_DO_NOT_CACHE
= 0x00000004,
78 MFP_CREDENTIAL_CLEAR_TEXT
= 0x00000008,
79 MFP_CREDENTIAL_PROXY
= 0x00000010,
80 MFP_CREDENTIAL_LOGGED_ON_USER
= 0x00000020,
81 } _MFP_CREDENTIAL_FLAGS
;
83 interface IMFPMediaPlayer
;
84 interface IMFPMediaItem
;
86 typedef struct MFP_EVENT_HEADER
88 MFP_EVENT_TYPE eEventType
;
90 IMFPMediaPlayer
*pMediaPlayer
;
91 MFP_MEDIAPLAYER_STATE eState
;
92 IPropertyStore
*pPropertyStore
;
95 typedef struct MFP_PLAY_EVENT
97 MFP_EVENT_HEADER header
;
98 IMFPMediaItem
*pMediaItem
;
101 typedef struct MFP_PAUSE_EVENT
103 MFP_EVENT_HEADER header
;
104 IMFPMediaItem
*pMediaItem
;
107 typedef struct MFP_STOP_EVENT
109 MFP_EVENT_HEADER header
;
110 IMFPMediaItem
*pMediaItem
;
113 typedef struct MFP_POSITION_SET_EVENT
115 MFP_EVENT_HEADER header
;
116 IMFPMediaItem
*pMediaItem
;
117 } MFP_POSITION_SET_EVENT
;
119 typedef struct MFP_RATE_SET_EVENT
121 MFP_EVENT_HEADER header
;
122 IMFPMediaItem
*pMediaItem
;
124 } MFP_RATE_SET_EVENT
;
126 typedef struct MFP_MEDIAITEM_CREATED_EVENT
128 MFP_EVENT_HEADER header
;
129 IMFPMediaItem
*pMediaItem
;
130 DWORD_PTR dwUserData
;
131 } MFP_MEDIAITEM_CREATED_EVENT
;
133 typedef struct MFP_MEDIAITEM_SET_EVENT
135 MFP_EVENT_HEADER header
;
136 IMFPMediaItem
*pMediaItem
;
137 } MFP_MEDIAITEM_SET_EVENT
;
139 typedef struct MFP_FRAME_STEP_EVENT
141 MFP_EVENT_HEADER header
;
142 IMFPMediaItem
*pMediaItem
;
143 } MFP_FRAME_STEP_EVENT
;
145 typedef struct MFP_MEDIAITEM_CLEARED_EVENT
147 MFP_EVENT_HEADER header
;
148 IMFPMediaItem
*pMediaItem
;
149 } MFP_MEDIAITEM_CLEARED_EVENT
;
151 typedef struct MFP_MF_EVENT
153 MFP_EVENT_HEADER header
;
154 MediaEventType MFEventType
;
155 IMFMediaEvent
*pMFMediaEvent
;
156 IMFPMediaItem
*pMediaItem
;
159 typedef struct MFP_ERROR_EVENT
161 MFP_EVENT_HEADER header
;
164 typedef struct MFP_PLAYBACK_ENDED_EVENT
166 MFP_EVENT_HEADER header
;
167 IMFPMediaItem
*pMediaItem
;
168 } MFP_PLAYBACK_ENDED_EVENT
;
170 typedef struct MFP_ACQUIRE_USER_CREDENTIAL_EVENT
172 MFP_EVENT_HEADER header
;
173 DWORD_PTR dwUserData
;
174 BOOL fProceedWithAuthentication
;
175 HRESULT hrAuthenticationStatus
;
181 MFP_CREDENTIAL_FLAGS flags
;
182 IMFNetCredential
*pCredential
;
183 } MFP_ACQUIRE_USER_CREDENTIAL_EVENT
;
185 cpp_quote
("#define __MFP_CAST_EVENT(hdr, tag) (((hdr)->eEventType == MFP_EVENT_TYPE_##tag) ? (MFP_##Tag##_EVENT *)(hdr) : NULL)")
186 cpp_quote
("#define MFP_GET_PLAY_EVENT(hdr) __MFP_CAST_EVENT(hdr, PLAY)")
187 cpp_quote
("#define MFP_GET_PAUSE_EVENT(hdr) __MFP_CAST_EVENT(hdr, PAUSE)")
188 cpp_quote
("#define MFP_GET_STOP_EVENT(hdr) __MFP_CAST_EVENT(hdr, STOP)")
189 cpp_quote
("#define MFP_GET_POSITION_SET_EVENT(hdr) __MFP_CAST_EVENT(hdr, POSITION_SET)")
190 cpp_quote
("#define MFP_GET_RATE_SET_EVENT(hdr) __MFP_CAST_EVENT(hdr, RATE_SET)")
191 cpp_quote
("#define MFP_GET_MEDIAITEM_CREATED_EVENT(hdr) __MFP_CAST_EVENT(hdr, MEDIAITEM_CREATED)")
192 cpp_quote
("#define MFP_GET_MEDIAITEM_SET_EVENT(hdr) __MFP_CAST_EVENT(hdr, MEDIAITEM_SET)")
193 cpp_quote
("#define MFP_GET_FRAME_STEP_EVENT(hdr) __MFP_CAST_EVENT(hdr, FRAME_STEP)")
194 cpp_quote
("#define MFP_GET_MEDIAITEM_CLEARED_EVENT(hdr) __MFP_CAST_EVENT(hdr, MEDIAITEM_CLEARED)")
195 cpp_quote
("#define MFP_GET_MF_EVENT(hdr) __MFP_CAST_EVENT(hdr, MF)")
196 cpp_quote
("#define MFP_GET_ERROR_EVENT(hdr) __MFP_CAST_EVENT(hdr, ERROR)")
197 cpp_quote
("#define MFP_GET_PLAYBACK_ENDED_EVENT(hdr) __MFP_CAST_EVENT(hdr, PLAYBACK_ENDED)")
198 cpp_quote
("#define MFP_GET_ACQUIRE_USER_CREDENTIAL_EVENT(hdr) __MFP_CAST_EVENT(hdr, ACQUIRE_USER_CREDENTIAL)")
200 cpp_quote
("EXTERN_GUID(MFP_POSITIONTYPE_100NS, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0);")
204 uuid(766c8ffb
-5fdb
-4fea
-a28d
-b912996f51bd
),
207 interface IMFPMediaPlayerCallback
: IUnknown
209 void OnMediaPlayerEvent
([in] MFP_EVENT_HEADER
*event_header
);
214 uuid(a714590a
-58af
-430a
-85bf
-44f5ec838d85
),
217 interface IMFPMediaPlayer
: IUnknown
228 [in] REFGUID position_type
,
229 [in] const PROPVARIANT
*position
);
232 [in] REFGUID position_type
,
233 [out] PROPVARIANT
*position
);
236 [in] REFGUID position_type
,
237 [out] PROPVARIANT
*duration
);
245 HRESULT GetSupportedRates
(
247 [out] float *slowest_rate
,
248 [out] float *fastest_rate
);
251 [out] MFP_MEDIAPLAYER_STATE
*state
);
253 HRESULT CreateMediaItemFromURL
(
254 [in] const WCHAR
*url
,
256 [in] DWORD_PTR user_data
,
257 [out] IMFPMediaItem
**item
);
259 HRESULT CreateMediaItemFromObject
(
260 [in] IUnknown
*object,
262 [in] DWORD_PTR user_data
,
263 [out] IMFPMediaItem
**item
);
265 HRESULT SetMediaItem
(
266 [in] IMFPMediaItem
*item
);
268 HRESULT ClearMediaItem
();
270 HRESULT GetMediaItem
(
271 [out] IMFPMediaItem
**item
);
274 [out] float *volume
);
280 [out] float *balance
);
291 HRESULT GetNativeVideoSize
(
293 [out] SIZE
*arvideo
);
295 HRESULT GetIdealVideoSize
(
296 [out] SIZE
*min_size
,
297 [out] SIZE
*max_size
);
299 HRESULT SetVideoSourceRect
(
300 [in] MFVideoNormalizedRect
const *rect
);
302 HRESULT GetVideoSourceRect
(
303 [out] MFVideoNormalizedRect
*rect
);
305 HRESULT SetAspectRatioMode
(
308 HRESULT GetAspectRatioMode
(
311 HRESULT GetVideoWindow
(
314 HRESULT UpdateVideo
();
316 HRESULT SetBorderColor
(
317 [in] COLORREF color
);
319 HRESULT GetBorderColor
(
320 [out] COLORREF
*color
);
322 HRESULT InsertEffect
(
323 [in] IUnknown
*effect
,
326 HRESULT RemoveEffect
(
327 [in] IUnknown
*effect
);
329 HRESULT RemoveAllEffects
();
336 uuid(90eb3e6b
-ecbf
-45cc
-b1da
-c6fe3ea70d57
),
339 interface IMFPMediaItem
: IUnknown
341 HRESULT GetMediaPlayer
(
342 [out] IMFPMediaPlayer
**player
);
348 [out] IUnknown
**obj
);
351 [out] DWORD_PTR
*user_data
);
354 [in] DWORD_PTR user_data
);
356 HRESULT GetStartStopPosition
(
357 [out] GUID
*start_format
,
358 [out] PROPVARIANT
*start_position
,
359 [out] GUID
*stop_format
,
360 [out] PROPVARIANT
*stop_position
);
362 HRESULT SetStartStopPosition
(
363 [in] const GUID
*start_format
,
364 [in] const PROPVARIANT
*start_position
,
365 [in] const GUID
*stop_format
,
366 [in] const PROPVARIANT
*stop_position
);
369 [out] BOOL
*has_video
,
370 [out] BOOL
*selected
);
373 [out] BOOL
*has_audio
,
374 [out] BOOL
*selected
);
377 [out] BOOL
*protected
);
381 [out] PROPVARIANT
*value
);
383 HRESULT GetNumberOfStreams
(
386 HRESULT GetStreamSelection
(
388 [out] BOOL
*enabled
);
390 HRESULT SetStreamSelection
(
394 HRESULT GetStreamAttribute
(
397 [out] PROPVARIANT
*value
);
399 HRESULT GetPresentationAttribute
(
401 [out] PROPVARIANT
*value
);
403 HRESULT GetCharacteristics
(
404 [out] MFP_MEDIAITEM_CHARACTERISTICS
*flags
);
406 HRESULT SetStreamSink
(
408 [in] IUnknown
*sink
);
411 [out] IPropertyStore
**metadata
);
414 cpp_quote
("HRESULT WINAPI MFPCreateMediaPlayer(const WCHAR *url, BOOL start_playback, MFP_CREATION_OPTIONS options, ")
415 cpp_quote
(" IMFPMediaPlayerCallback *callback, HWND hwnd, IMFPMediaPlayer **player);")