msxml4/tests: Copy namespaces as attributes tests.
[wine.git] / include / mfplay.idl
blob42591439a0bf4fba2f21f1c960b1d5b876cc16fd
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 UINT32 MFP_CREATION_OPTIONS;
27 typedef [v1_enum] enum _MFP_CREATION_OPTIONS
29 MFP_OPTION_NONE = 0,
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,
47 MFP_EVENT_TYPE_PAUSE,
48 MFP_EVENT_TYPE_STOP,
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,
55 MFP_EVENT_TYPE_MF,
56 MFP_EVENT_TYPE_ERROR,
57 MFP_EVENT_TYPE_PLAYBACK_ENDED,
58 MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL,
59 } MFP_EVENT_TYPE;
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;
89 HRESULT hrEvent;
90 IMFPMediaPlayer *pMediaPlayer;
91 MFP_MEDIAPLAYER_STATE eState;
92 IPropertyStore *pPropertyStore;
93 } MFP_EVENT_HEADER;
95 typedef struct MFP_PLAY_EVENT
97 MFP_EVENT_HEADER header;
98 IMFPMediaItem *pMediaItem;
99 } MFP_PLAY_EVENT;
101 typedef struct MFP_PAUSE_EVENT
103 MFP_EVENT_HEADER header;
104 IMFPMediaItem *pMediaItem;
105 } MFP_PAUSE_EVENT;
107 typedef struct MFP_STOP_EVENT
109 MFP_EVENT_HEADER header;
110 IMFPMediaItem *pMediaItem;
111 } MFP_STOP_EVENT;
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;
123 float flRate;
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;
157 } MFP_MF_EVENT;
159 typedef struct MFP_ERROR_EVENT
161 MFP_EVENT_HEADER header;
162 } MFP_ERROR_EVENT;
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;
176 LPCWSTR pwszURL;
177 LPCWSTR pwszSite;
178 LPCWSTR pwszRealm;
179 LPCWSTR pwszPackage;
180 LONG nRetries;
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);")
203 object,
204 uuid(766c8ffb-5fdb-4fea-a28d-b912996f51bd),
205 local,
207 interface IMFPMediaPlayerCallback : IUnknown
209 void OnMediaPlayerEvent([in] MFP_EVENT_HEADER *event_header);
213 object,
214 uuid(a714590a-58af-430a-85bf-44f5ec838d85),
215 local,
217 interface IMFPMediaPlayer : IUnknown
219 HRESULT Play();
221 HRESULT Pause();
223 HRESULT Stop();
225 HRESULT FrameStep();
227 HRESULT SetPosition(
228 [in] REFGUID position_type,
229 [in] const PROPVARIANT *position);
231 HRESULT GetPosition(
232 [in] REFGUID position_type,
233 [out] PROPVARIANT *position);
235 HRESULT GetDuration(
236 [in] REFGUID position_type,
237 [out] PROPVARIANT *duration);
239 HRESULT SetRate(
240 [in] float rate);
242 HRESULT GetRate(
243 [out] float *rate);
245 HRESULT GetSupportedRates(
246 [in] BOOL forward,
247 [out] float *slowest_rate,
248 [out] float *fastest_rate);
250 HRESULT GetState(
251 [out] MFP_MEDIAPLAYER_STATE *state);
253 HRESULT CreateMediaItemFromURL(
254 [in] const WCHAR *url,
255 [in] BOOL sync,
256 [in] DWORD_PTR user_data,
257 [out] IMFPMediaItem **item);
259 HRESULT CreateMediaItemFromObject(
260 [in] IUnknown *object,
261 [in] BOOL sync,
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);
273 HRESULT GetVolume(
274 [out] float *volume);
276 HRESULT SetVolume(
277 [in] float volume);
279 HRESULT GetBalance(
280 [out] float *balance);
282 HRESULT SetBalance(
283 [in] float balance);
285 HRESULT GetMute(
286 [out] BOOL *mute);
288 HRESULT SetMute(
289 [in] BOOL mute);
291 HRESULT GetNativeVideoSize(
292 [out] SIZE *video,
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(
306 [in] DWORD mode);
308 HRESULT GetAspectRatioMode(
309 [out] DWORD *mode);
311 HRESULT GetVideoWindow(
312 [out] HWND *hwnd);
314 HRESULT UpdateVideo();
316 HRESULT SetBorderColor(
317 [in] COLORREF color);
319 HRESULT GetBorderColor(
320 [out] COLORREF *color);
322 HRESULT InsertEffect(
323 [in] IUnknown *effect,
324 [in] BOOL optional);
326 HRESULT RemoveEffect(
327 [in] IUnknown *effect);
329 HRESULT RemoveAllEffects();
331 HRESULT Shutdown();
335 object,
336 uuid(90eb3e6b-ecbf-45cc-b1da-c6fe3ea70d57),
337 local,
339 interface IMFPMediaItem : IUnknown
341 HRESULT GetMediaPlayer(
342 [out] IMFPMediaPlayer **player);
344 HRESULT GetURL(
345 [out] LPWSTR *url);
347 HRESULT GetObject(
348 [out] IUnknown **obj);
350 HRESULT GetUserData(
351 [out] DWORD_PTR *user_data);
353 HRESULT SetUserData(
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);
368 HRESULT HasVideo(
369 [out] BOOL *has_video,
370 [out] BOOL *selected);
372 HRESULT HasAudio(
373 [out] BOOL *has_audio,
374 [out] BOOL *selected);
376 HRESULT IsProtected(
377 [out] BOOL *protected);
379 HRESULT GetDuration(
380 [in] REFGUID format,
381 [out] PROPVARIANT *value);
383 HRESULT GetNumberOfStreams(
384 [out] DWORD *count);
386 HRESULT GetStreamSelection(
387 [in] DWORD index,
388 [out] BOOL *enabled);
390 HRESULT SetStreamSelection(
391 [in] DWORD index,
392 [in] BOOL enabled);
394 HRESULT GetStreamAttribute(
395 [in] DWORD index,
396 [in] REFGUID key,
397 [out] PROPVARIANT *value);
399 HRESULT GetPresentationAttribute(
400 [in] REFGUID key,
401 [out] PROPVARIANT *value);
403 HRESULT GetCharacteristics(
404 [out] MFP_MEDIAITEM_CHARACTERISTICS *flags);
406 HRESULT SetStreamSink(
407 [in] DWORD index,
408 [in] IUnknown *sink);
410 HRESULT GetMetadata(
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);")