include: Add winber.h.
[wine/zf.git] / include / mfplay.idl
blobf130ce12287cf9e8ac0f32446c86d1f1729294f8
1 /*
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
19 import "unknwn.idl";
20 import "propsys.idl";
21 import "evr.idl";
23 interface IMFNetCredential;
25 typedef [v1_enum] enum _MFP_CREATION_OPTIONS
27 MFP_OPTION_NONE = 0,
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,
45 MFP_EVENT_TYPE_PAUSE,
46 MFP_EVENT_TYPE_STOP,
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,
53 MFP_EVENT_TYPE_MF,
54 MFP_EVENT_TYPE_ERROR,
55 MFP_EVENT_TYPE_PLAYBACK_ENDED,
56 MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL,
57 } MFP_EVENT_TYPE;
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;
87 HRESULT hrEvent;
88 IMFPMediaPlayer *pMediaPlayer;
89 MFP_MEDIAPLAYER_STATE eState;
90 IPropertyStore *pPropertyStore;
91 } MFP_EVENT_HEADER;
93 typedef struct MFP_PLAY_EVENT
95 MFP_EVENT_HEADER header;
96 IMFPMediaItem *pMediaItem;
97 } MFP_PLAY_EVENT;
99 typedef struct MFP_PAUSE_EVENT
101 MFP_EVENT_HEADER header;
102 IMFPMediaItem *pMediaItem;
103 } MFP_PAUSE_EVENT;
105 typedef struct MFP_STOP_EVENT
107 MFP_EVENT_HEADER header;
108 IMFPMediaItem *pMediaItem;
109 } MFP_STOP_EVENT;
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;
121 float flRate;
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;
155 } MFP_MF_EVENT;
157 typedef struct MFP_ERROR_EVENT
159 MFP_EVENT_HEADER header;
160 } MFP_ERROR_EVENT;
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;
174 LPCWSTR pwszURL;
175 LPCWSTR pwszSite;
176 LPCWSTR pwszRealm;
177 LPCWSTR pwszPackage;
178 LONG nRetries;
179 MFP_CREDENTIAL_FLAGS flags;
180 IMFNetCredential *pCredential;
181 } MFP_ACQUIRE_USER_CREDENTIAL_EVENT;
184 object,
185 uuid(766c8ffb-5fdb-4fea-a28d-b912996f51bd),
186 local,
188 interface IMFPMediaPlayerCallback : IUnknown
190 void OnMediaPlayerEvent([in] MFP_EVENT_HEADER *event_header);
194 object,
195 uuid(a714590a-58af-430a-85bf-44f5ec838d85),
196 local,
198 interface IMFPMediaPlayer : IUnknown
200 HRESULT Play();
202 HRESULT Pause();
204 HRESULT Stop();
206 HRESULT FrameStep();
208 HRESULT SetPosition(
209 [in] REFGUID position_type,
210 [in] const PROPVARIANT *position);
212 HRESULT GetPosition(
213 [in] REFGUID position_type,
214 [out] PROPVARIANT *position);
216 HRESULT GetDuration(
217 [in] REFGUID position_type,
218 [out] PROPVARIANT *duration);
220 HRESULT SetRate(
221 [in] float rate);
223 HRESULT GetRate(
224 [out] float *rate);
226 HRESULT GetSupportedRates(
227 [in] BOOL forward,
228 [out] float *slowest_rate,
229 [out] float *fastest_rate);
231 HRESULT GetState(
232 [out] MFP_MEDIAPLAYER_STATE *state);
234 HRESULT CreateMediaItemFromURL(
235 [in] const WCHAR *url,
236 [in] BOOL sync,
237 [in] DWORD_PTR user_data,
238 [out] IMFPMediaItem **item);
240 HRESULT CreateMediaItemFromObject(
241 [in] IUnknown *object,
242 [in] BOOL sync,
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);
254 HRESULT GetVolume(
255 [out] float *volume);
257 HRESULT SetVolume(
258 [in] float volume);
260 HRESULT GetBalance(
261 [out] float *balance);
263 HRESULT SetBalance(
264 [in] float balance);
266 HRESULT GetMute(
267 [out] BOOL *mute);
269 HRESULT SetMute(
270 [in] BOOL mute);
272 HRESULT GetNativeVideoSize(
273 [out] SIZE *video,
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(
287 [in] DWORD mode);
289 HRESULT GetAspectRatioMode(
290 [out] DWORD *mode);
292 HRESULT GetVideoWindow(
293 [out] HWND *hwnd);
295 HRESULT UpdateVideo();
297 HRESULT SetBorderColor(
298 [in] COLORREF color);
300 HRESULT GetBorderColor(
301 [out] COLORREF *color);
303 HRESULT InsertEffect(
304 [in] IUnknown *effect,
305 [in] BOOL optional);
307 HRESULT RemoveEffect(
308 [in] IUnknown *effect);
310 HRESULT RemoveAllEffects();
312 HRESULT Shutdown();
316 object,
317 uuid(90eb3e6b-ecbf-45cc-b1da-c6fe3ea70d57),
318 local,
320 interface IMFPMediaItem : IUnknown
322 HRESULT GetMediaPlayer(
323 [out] IMFPMediaPlayer **player);
325 HRESULT GetURL(
326 [out] LPWSTR *url);
328 HRESULT GetObject(
329 [out] IUnknown **obj);
331 HRESULT GetUserData(
332 [out] DWORD_PTR *user_data);
334 HRESULT SetUserData(
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);
349 HRESULT HasVideo(
350 [out] BOOL *has_video,
351 [out] BOOL *selected);
353 HRESULT HasAudio(
354 [out] BOOL *has_audio,
355 [out] BOOL *selected);
357 HRESULT IsProtected(
358 [out] BOOL *protected);
360 HRESULT GetDuration(
361 [in] REFGUID format,
362 [out] PROPVARIANT *value);
364 HRESULT GetNumberOfStreams(
365 [out] DWORD *count);
367 HRESULT GetStreamSelection(
368 [in] DWORD index,
369 [out] BOOL *enabled);
371 HRESULT SetStreamSelection(
372 [in] DWORD index,
373 [in] BOOL enabled);
375 HRESULT GetStreamAttribute(
376 [in] DWORD index,
377 [in] REFGUID key,
378 [out] PROPVARIANT *value);
380 HRESULT GetPresentationAttribute(
381 [in] REFGUID key,
382 [out] PROPVARIANT *value);
384 HRESULT GetCharacteristics(
385 [out] MFP_MEDIAITEM_CHARACTERISTICS *flags);
387 HRESULT SetStreamSink(
388 [in] DWORD index,
389 [in] IUnknown *sink);
391 HRESULT GetMetadata(
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);")