wmvcore: Support IWMReaderAccelerator in IWMReader.
[wine.git] / dlls / wmvcore / wmvcore_main.c
blob4023152f0879810f3567cdc02e9dd8671724e2a4
1 /*
2 * Copyright 2012 Austin English
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 #include "wmvcore.h"
21 #include "initguid.h"
22 #include "wmsdk.h"
23 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
27 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
29 TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
31 switch (fdwReason)
33 case DLL_WINE_PREATTACH:
34 return FALSE; /* prefer native version */
35 case DLL_PROCESS_ATTACH:
36 DisableThreadLibraryCalls(hinstDLL);
37 break;
40 return TRUE;
43 HRESULT WINAPI DllRegisterServer(void)
45 FIXME("(): stub\n");
47 return S_OK;
50 HRESULT WINAPI WMCheckURLScheme(const WCHAR *scheme)
52 FIXME("(%s): stub\n", wine_dbgstr_w(scheme));
54 return NS_E_INVALID_NAME;
57 HRESULT WINAPI WMCreateEditor(IWMMetadataEditor **editor)
59 FIXME("(%p): stub\n", editor);
61 *editor = NULL;
63 return E_NOTIMPL;
66 typedef struct {
67 IWMReader IWMReader_iface;
68 IWMReaderAdvanced6 IWMReaderAdvanced6_iface;
69 IWMReaderAccelerator IWMReaderAccelerator_iface;
70 LONG ref;
71 } WMReader;
73 static inline WMReader *impl_from_IWMReader(IWMReader *iface)
75 return CONTAINING_RECORD(iface, WMReader, IWMReader_iface);
78 static HRESULT WINAPI WMReader_QueryInterface(IWMReader *iface, REFIID riid, void **ppv)
80 WMReader *This = impl_from_IWMReader(iface);
82 if(IsEqualGUID(riid, &IID_IUnknown)) {
83 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
84 *ppv = &This->IWMReader_iface;
85 }else if(IsEqualGUID(riid, &IID_IWMReader)) {
86 TRACE("(%p)->(IID_IWMReader %p)\n", This, ppv);
87 *ppv = &This->IWMReader_iface;
88 }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced)) {
89 TRACE("(%p)->(IID_IWMReaderAdvanced %p)\n", This, ppv);
90 *ppv = &This->IWMReaderAdvanced6_iface;
91 }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced2)) {
92 TRACE("(%p)->(IID_IWMReaderAdvanced2 %p)\n", This, ppv);
93 *ppv = &This->IWMReaderAdvanced6_iface;
94 }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced3)) {
95 TRACE("(%p)->(IID_IWMReaderAdvanced3 %p)\n", This, ppv);
96 *ppv = &This->IWMReaderAdvanced6_iface;
97 }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced4)) {
98 TRACE("(%p)->(IID_IWMReaderAdvanced4 %p)\n", This, ppv);
99 *ppv = &This->IWMReaderAdvanced6_iface;
100 }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced5)) {
101 TRACE("(%p)->(IID_IWMReaderAdvanced5 %p)\n", This, ppv);
102 *ppv = &This->IWMReaderAdvanced6_iface;
103 }else if(IsEqualGUID(riid, &IID_IWMReaderAdvanced6)) {
104 TRACE("(%p)->(IID_IWMReaderAdvanced6 %p)\n", This, ppv);
105 *ppv = &This->IWMReaderAdvanced6_iface;
106 }else if(IsEqualGUID(riid, &IID_IWMReaderAccelerator)) {
107 TRACE("(%p)->(IID_IWMReaderAccelerator %p)\n", This, ppv);
108 *ppv = &This->IWMReaderAccelerator_iface;
109 }else {
110 *ppv = NULL;
111 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
112 return E_NOINTERFACE;
115 IUnknown_AddRef((IUnknown*)*ppv);
116 return S_OK;
119 static ULONG WINAPI WMReader_AddRef(IWMReader *iface)
121 WMReader *This = impl_from_IWMReader(iface);
122 LONG ref = InterlockedIncrement(&This->ref);
124 TRACE("(%p) ref=%d\n", This, ref);
126 return ref;
129 static ULONG WINAPI WMReader_Release(IWMReader *iface)
131 WMReader *This = impl_from_IWMReader(iface);
132 LONG ref = InterlockedDecrement(&This->ref);
134 TRACE("(%p) ref=%d\n", This, ref);
136 if(!ref)
137 heap_free(This);
139 return ref;
142 static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url, IWMReaderCallback *callback, void *context)
144 WMReader *This = impl_from_IWMReader(iface);
145 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(url), callback, context);
146 return E_NOTIMPL;
149 static HRESULT WINAPI WMReader_Close(IWMReader *iface)
151 WMReader *This = impl_from_IWMReader(iface);
152 FIXME("(%p)\n", This);
153 return E_NOTIMPL;
156 static HRESULT WINAPI WMReader_GetOutputCount(IWMReader *iface, DWORD *outputs)
158 WMReader *This = impl_from_IWMReader(iface);
159 FIXME("(%p)->(%p)\n", This, outputs);
160 return E_NOTIMPL;
163 static HRESULT WINAPI WMReader_GetOutputProps(IWMReader *iface, DWORD output_num, IWMOutputMediaProps **output)
165 WMReader *This = impl_from_IWMReader(iface);
166 FIXME("(%p)->(%u %p)\n", This, output_num, output);
167 return E_NOTIMPL;
170 static HRESULT WINAPI WMReader_SetOutputProps(IWMReader *iface, DWORD output_num, IWMOutputMediaProps *output)
172 WMReader *This = impl_from_IWMReader(iface);
173 FIXME("(%p)->(%u %p)\n", This, output_num, output);
174 return E_NOTIMPL;
177 static HRESULT WINAPI WMReader_GetOutputFormatCount(IWMReader *iface, DWORD output_num, DWORD *formats)
179 WMReader *This = impl_from_IWMReader(iface);
180 FIXME("(%p)->(%u %p)\n", This, output_num, formats);
181 return E_NOTIMPL;
184 static HRESULT WINAPI WMReader_GetOutputFormat(IWMReader *iface, DWORD output_num, DWORD format_num, IWMOutputMediaProps **props)
186 WMReader *This = impl_from_IWMReader(iface);
187 FIXME("(%p)->(%u %u %p)\n", This, output_num, format_num, props);
188 return E_NOTIMPL;
191 static HRESULT WINAPI WMReader_Start(IWMReader *iface, QWORD start, QWORD duration, float rate, void *context)
193 WMReader *This = impl_from_IWMReader(iface);
194 FIXME("(%p)->(%s %s %f %p)\n", This, wine_dbgstr_longlong(start), wine_dbgstr_longlong(duration), rate, context);
195 return E_NOTIMPL;
198 static HRESULT WINAPI WMReader_Stop(IWMReader *iface)
200 WMReader *This = impl_from_IWMReader(iface);
201 FIXME("(%p)\n", This);
202 return E_NOTIMPL;
205 static HRESULT WINAPI WMReader_Pause(IWMReader *iface)
207 WMReader *This = impl_from_IWMReader(iface);
208 FIXME("(%p)\n", This);
209 return E_NOTIMPL;
212 static HRESULT WINAPI WMReader_Resume(IWMReader *iface)
214 WMReader *This = impl_from_IWMReader(iface);
215 FIXME("(%p)\n", This);
216 return E_NOTIMPL;
219 static const IWMReaderVtbl WMReaderVtbl = {
220 WMReader_QueryInterface,
221 WMReader_AddRef,
222 WMReader_Release,
223 WMReader_Open,
224 WMReader_Close,
225 WMReader_GetOutputCount,
226 WMReader_GetOutputProps,
227 WMReader_SetOutputProps,
228 WMReader_GetOutputFormatCount,
229 WMReader_GetOutputFormat,
230 WMReader_Start,
231 WMReader_Stop,
232 WMReader_Pause,
233 WMReader_Resume
236 static inline WMReader *impl_from_IWMReaderAdvanced6(IWMReaderAdvanced6 *iface)
238 return CONTAINING_RECORD(iface, WMReader, IWMReaderAdvanced6_iface);
241 static HRESULT WINAPI WMReaderAdvanced_QueryInterface(IWMReaderAdvanced6 *iface, REFIID riid, void **ppv)
243 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
244 return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv);
247 static ULONG WINAPI WMReaderAdvanced_AddRef(IWMReaderAdvanced6 *iface)
249 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
250 return IWMReader_AddRef(&This->IWMReader_iface);
253 static ULONG WINAPI WMReaderAdvanced_Release(IWMReaderAdvanced6 *iface)
255 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
256 return IWMReader_Release(&This->IWMReader_iface);
259 static HRESULT WINAPI WMReaderAdvanced_SetUserProvidedClock(IWMReaderAdvanced6 *iface, BOOL user_clock)
261 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
262 FIXME("(%p)->(%x)\n", This, user_clock);
263 return E_NOTIMPL;
266 static HRESULT WINAPI WMReaderAdvanced_GetUserProvidedClock(IWMReaderAdvanced6 *iface, BOOL *user_clock)
268 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
269 FIXME("(%p)->(%p)\n", This, user_clock);
270 return E_NOTIMPL;
273 static HRESULT WINAPI WMReaderAdvanced_DeliverTime(IWMReaderAdvanced6 *iface, QWORD time)
275 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
276 FIXME("(%p)->(%s)\n", This, wine_dbgstr_longlong(time));
277 return E_NOTIMPL;
280 static HRESULT WINAPI WMReaderAdvanced_SetManualStreamSelection(IWMReaderAdvanced6 *iface, BOOL selection)
282 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
283 FIXME("(%p)->(%x)\n", This, selection);
284 return E_NOTIMPL;
287 static HRESULT WINAPI WMReaderAdvanced_GetManualStreamSelection(IWMReaderAdvanced6 *iface, BOOL *selection)
289 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
290 FIXME("(%p)->(%p)\n", This, selection);
291 return E_NOTIMPL;
294 static HRESULT WINAPI WMReaderAdvanced_SetStreamsSelected(IWMReaderAdvanced6 *iface, WORD stream_count,
295 WORD *stream_numbers, WMT_STREAM_SELECTION *selections)
297 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
298 FIXME("(%p)->(%d %p %p)\n", This, stream_count, stream_numbers, selections);
299 return E_NOTIMPL;
302 static HRESULT WINAPI WMReaderAdvanced_GetStreamSelected(IWMReaderAdvanced6 *iface, WORD stream_num,
303 WMT_STREAM_SELECTION *selection)
305 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
306 FIXME("(%p)->(%d %p)\n", This, stream_num, selection);
307 return E_NOTIMPL;
310 static HRESULT WINAPI WMReaderAdvanced_SetReceiveSelectionCallbacks(IWMReaderAdvanced6 *iface, BOOL get_callbacks)
312 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
313 FIXME("(%p)->(%x)\n", This, get_callbacks);
314 return E_NOTIMPL;
317 static HRESULT WINAPI WMReaderAdvanced_GetReceiveSelectionCallbacks(IWMReaderAdvanced6 *iface, BOOL *get_callbacks)
319 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
320 FIXME("(%p)->(%p)\n", This, get_callbacks);
321 return E_NOTIMPL;
324 static HRESULT WINAPI WMReaderAdvanced_SetReceiveStreamSamples(IWMReaderAdvanced6 *iface, WORD stream_num,
325 BOOL receive_stream_samples)
327 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
328 FIXME("(%p)->(%d %x)\n", This, stream_num, receive_stream_samples);
329 return E_NOTIMPL;
332 static HRESULT WINAPI WMReaderAdvanced_GetReceiveStreamSamples(IWMReaderAdvanced6 *iface, WORD stream_num,
333 BOOL *receive_stream_samples)
335 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
336 FIXME("(%p)->(%d %p)\n", This, stream_num, receive_stream_samples);
337 return E_NOTIMPL;
340 static HRESULT WINAPI WMReaderAdvanced_SetAllocateForOutput(IWMReaderAdvanced6 *iface, DWORD output_num, BOOL allocate)
342 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
343 FIXME("(%p)->(%d %x)\n", This, output_num, allocate);
344 return E_NOTIMPL;
347 static HRESULT WINAPI WMReaderAdvanced_GetAllocateForOutput(IWMReaderAdvanced6 *iface, DWORD output_num, BOOL *allocate)
349 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
350 FIXME("(%p)->(%d %p)\n", This, output_num, allocate);
351 return E_NOTIMPL;
354 static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 *iface, WORD output_num, BOOL allocate)
356 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
357 FIXME("(%p)->(%d %x)\n", This, output_num, allocate);
358 return E_NOTIMPL;
361 static HRESULT WINAPI WMReaderAdvanced_GetAllocateForStream(IWMReaderAdvanced6 *iface, WORD output_num, BOOL *allocate)
363 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
364 FIXME("(%p)->(%d %p)\n", This, output_num, allocate);
365 return E_NOTIMPL;
368 static HRESULT WINAPI WMReaderAdvanced_GetStatistics(IWMReaderAdvanced6 *iface, WM_READER_STATISTICS *statistics)
370 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
371 FIXME("(%p)->(%p)\n", This, statistics);
372 return E_NOTIMPL;
375 static HRESULT WINAPI WMReaderAdvanced_SetClientInfo(IWMReaderAdvanced6 *iface, WM_READER_CLIENTINFO *client_info)
377 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
378 FIXME("(%p)->(%p)\n", This, client_info);
379 return E_NOTIMPL;
382 static HRESULT WINAPI WMReaderAdvanced_GetMaxOutputSampleSize(IWMReaderAdvanced6 *iface, DWORD output, DWORD *max)
384 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
385 FIXME("(%p)->(%d %p)\n", This, output, max);
386 return E_NOTIMPL;
389 static HRESULT WINAPI WMReaderAdvanced_GetMaxStreamSampleSize(IWMReaderAdvanced6 *iface, WORD stream, DWORD *max)
391 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
392 FIXME("(%p)->(%d %p)\n", This, stream, max);
393 return E_NOTIMPL;
396 static HRESULT WINAPI WMReaderAdvanced_NotifyLateDelivery(IWMReaderAdvanced6 *iface, QWORD lateness)
398 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
399 FIXME("(%p)->(%s)\n", This, wine_dbgstr_longlong(lateness));
400 return E_NOTIMPL;
403 static HRESULT WINAPI WMReaderAdvanced2_SetPlayMode(IWMReaderAdvanced6 *iface, WMT_PLAY_MODE mode)
405 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
406 FIXME("(%p)->(%d)\n", This, mode);
407 return E_NOTIMPL;
410 static HRESULT WINAPI WMReaderAdvanced2_GetPlayMode(IWMReaderAdvanced6 *iface, WMT_PLAY_MODE *mode)
412 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
413 FIXME("(%p)->(%p)\n", This, mode);
414 return E_NOTIMPL;
417 static HRESULT WINAPI WMReaderAdvanced2_GetBufferProgress(IWMReaderAdvanced6 *iface, DWORD *percent, QWORD *buffering)
419 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
420 FIXME("(%p)->(%p %p)\n", This, percent, buffering);
421 return E_NOTIMPL;
424 static HRESULT WINAPI WMReaderAdvanced2_GetDownloadProgress(IWMReaderAdvanced6 *iface, DWORD *percent,
425 QWORD *bytes_downloaded, QWORD *download)
427 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
428 FIXME("(%p)->(%p %p %p)\n", This, percent, bytes_downloaded, download);
429 return E_NOTIMPL;
432 static HRESULT WINAPI WMReaderAdvanced2_GetSaveAsProgress(IWMReaderAdvanced6 *iface, DWORD *percent)
434 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
435 FIXME("(%p)->(%p)\n", This, percent);
436 return E_NOTIMPL;
439 static HRESULT WINAPI WMReaderAdvanced2_SaveFileAs(IWMReaderAdvanced6 *iface, const WCHAR *filename)
441 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
442 FIXME("(%p)->(%s)\n", This, debugstr_w(filename));
443 return E_NOTIMPL;
446 static HRESULT WINAPI WMReaderAdvanced2_GetProtocolName(IWMReaderAdvanced6 *iface, WCHAR *protocol, DWORD *protocol_len)
448 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
449 FIXME("(%p)->(%p %p)\n", This, protocol, protocol_len);
450 return E_NOTIMPL;
453 static HRESULT WINAPI WMReaderAdvanced2_StartAtMarker(IWMReaderAdvanced6 *iface, WORD marker_index,
454 QWORD duration, float rate, void *context)
456 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
457 FIXME("(%p)->(%d %s %f %p)\n", This, marker_index, wine_dbgstr_longlong(duration), rate, context);
458 return E_NOTIMPL;
461 static HRESULT WINAPI WMReaderAdvanced2_GetOutputSetting(IWMReaderAdvanced6 *iface, DWORD output_num,
462 const WCHAR *name, WMT_ATTR_DATATYPE *type, BYTE *value, WORD *length)
464 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
465 FIXME("(%p)->(%d %s %p %p %p)\n", This, output_num, debugstr_w(name), type, value, length);
466 return E_NOTIMPL;
469 static HRESULT WINAPI WMReaderAdvanced2_SetOutputSetting(IWMReaderAdvanced6 *iface, DWORD output_num,
470 const WCHAR *name, WMT_ATTR_DATATYPE type, const BYTE *value, WORD length)
472 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
473 FIXME("(%p)->(%d %s %d %p %d)\n", This, output_num, debugstr_w(name), type, value, length);
474 return E_NOTIMPL;
477 static HRESULT WINAPI WMReaderAdvanced2_Preroll(IWMReaderAdvanced6 *iface, QWORD start, QWORD duration, float rate)
479 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
480 FIXME("(%p)->(%s %s %f)\n", This, wine_dbgstr_longlong(start), wine_dbgstr_longlong(duration), rate);
481 return E_NOTIMPL;
484 static HRESULT WINAPI WMReaderAdvanced2_SetLogClientID(IWMReaderAdvanced6 *iface, BOOL log_client_id)
486 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
487 FIXME("(%p)->(%x)\n", This, log_client_id);
488 return E_NOTIMPL;
491 static HRESULT WINAPI WMReaderAdvanced2_GetLogClientID(IWMReaderAdvanced6 *iface, BOOL *log_client_id)
493 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
494 FIXME("(%p)->(%p)\n", This, log_client_id);
495 return E_NOTIMPL;
498 static HRESULT WINAPI WMReaderAdvanced2_StopBuffering(IWMReaderAdvanced6 *iface)
500 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
501 FIXME("(%p)\n", This);
502 return E_NOTIMPL;
505 static HRESULT WINAPI WMReaderAdvanced2_OpenStream(IWMReaderAdvanced6 *iface, IStream *stream,
506 IWMReaderCallback *callback, void *context)
508 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
509 FIXME("(%p)->(%p %p %p)\n", This, stream, callback, context);
510 return E_NOTIMPL;
513 static HRESULT WINAPI WMReaderAdvanced3_StopNetStreaming(IWMReaderAdvanced6 *iface)
515 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
516 FIXME("(%p)\n", This);
517 return E_NOTIMPL;
520 static HRESULT WINAPI WMReaderAdvanced3_StartAtPosition(IWMReaderAdvanced6 *iface, WORD stream_num,
521 void *offset_start, void *duration, WMT_OFFSET_FORMAT format, float rate, void *context)
523 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
524 FIXME("(%p)->(%d %p %p %d %f %p)\n", This, stream_num, offset_start, duration, format, rate, context);
525 return E_NOTIMPL;
528 static HRESULT WINAPI WMReaderAdvanced4_GetLanguageCount(IWMReaderAdvanced6 *iface, DWORD output_num, WORD *language_count)
530 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
531 FIXME("(%p)->(%d %p)\n", This, output_num, language_count);
532 return E_NOTIMPL;
535 static HRESULT WINAPI WMReaderAdvanced4_GetLanguage(IWMReaderAdvanced6 *iface, DWORD output_num,
536 WORD language, WCHAR *language_string, WORD *language_string_len)
538 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
539 FIXME("(%p)->(%d %x %p %p)\n", This, output_num, language, language_string, language_string_len);
540 return E_NOTIMPL;
543 static HRESULT WINAPI WMReaderAdvanced4_GetMaxSpeedFactor(IWMReaderAdvanced6 *iface, double *factor)
545 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
546 FIXME("(%p)->(%p)\n", This, factor);
547 return E_NOTIMPL;
550 static HRESULT WINAPI WMReaderAdvanced4_IsUsingFastCache(IWMReaderAdvanced6 *iface, BOOL *using_fast_cache)
552 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
553 FIXME("(%p)->(%p)\n", This, using_fast_cache);
554 return E_NOTIMPL;
557 static HRESULT WINAPI WMReaderAdvanced4_AddLogParam(IWMReaderAdvanced6 *iface, const WCHAR *namespace,
558 const WCHAR *name, const WCHAR *value)
560 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
561 FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(namespace), debugstr_w(name), debugstr_w(value));
562 return E_NOTIMPL;
565 static HRESULT WINAPI WMReaderAdvanced4_SendLogParams(IWMReaderAdvanced6 *iface)
567 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
568 FIXME("(%p)\n", This);
569 return E_NOTIMPL;
572 static HRESULT WINAPI WMReaderAdvanced4_CanSaveFileAs(IWMReaderAdvanced6 *iface, BOOL *can_save)
574 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
575 FIXME("(%p)->(%p)\n", This, can_save);
576 return E_NOTIMPL;
579 static HRESULT WINAPI WMReaderAdvanced4_CancelSaveFileAs(IWMReaderAdvanced6 *iface)
581 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
582 FIXME("(%p)\n", This);
583 return E_NOTIMPL;
586 static HRESULT WINAPI WMReaderAdvanced4_GetURL(IWMReaderAdvanced6 *iface, WCHAR *url, DWORD *url_len)
588 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
589 FIXME("(%p)->(%p %p)\n", This, url, url_len);
590 return E_NOTIMPL;
593 static HRESULT WINAPI WMReaderAdvanced5_SetPlayerHook(IWMReaderAdvanced6 *iface, DWORD output_num, IWMPlayerHook *hook)
595 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
596 FIXME("(%p)->(%d %p)\n", This, output_num, hook);
597 return E_NOTIMPL;
600 static HRESULT WINAPI WMReaderAdvanced6_SetProtextStreamSamples(IWMReaderAdvanced6 *iface, BYTE *cert,
601 DWORD cert_size, DWORD cert_type, DWORD flags, BYTE *initialization_vector, DWORD *initialization_vector_size)
603 WMReader *This = impl_from_IWMReaderAdvanced6(iface);
604 FIXME("(%p)->(%p %d %d %x %p %p)\n", This, cert, cert_size, cert_type, flags, initialization_vector,
605 initialization_vector_size);
606 return E_NOTIMPL;
609 static const IWMReaderAdvanced6Vtbl WMReaderAdvanced6Vtbl = {
610 WMReaderAdvanced_QueryInterface,
611 WMReaderAdvanced_AddRef,
612 WMReaderAdvanced_Release,
613 WMReaderAdvanced_SetUserProvidedClock,
614 WMReaderAdvanced_GetUserProvidedClock,
615 WMReaderAdvanced_DeliverTime,
616 WMReaderAdvanced_SetManualStreamSelection,
617 WMReaderAdvanced_GetManualStreamSelection,
618 WMReaderAdvanced_SetStreamsSelected,
619 WMReaderAdvanced_GetStreamSelected,
620 WMReaderAdvanced_SetReceiveSelectionCallbacks,
621 WMReaderAdvanced_GetReceiveSelectionCallbacks,
622 WMReaderAdvanced_SetReceiveStreamSamples,
623 WMReaderAdvanced_GetReceiveStreamSamples,
624 WMReaderAdvanced_SetAllocateForOutput,
625 WMReaderAdvanced_GetAllocateForOutput,
626 WMReaderAdvanced_SetAllocateForStream,
627 WMReaderAdvanced_GetAllocateForStream,
628 WMReaderAdvanced_GetStatistics,
629 WMReaderAdvanced_SetClientInfo,
630 WMReaderAdvanced_GetMaxOutputSampleSize,
631 WMReaderAdvanced_GetMaxStreamSampleSize,
632 WMReaderAdvanced_NotifyLateDelivery,
633 WMReaderAdvanced2_SetPlayMode,
634 WMReaderAdvanced2_GetPlayMode,
635 WMReaderAdvanced2_GetBufferProgress,
636 WMReaderAdvanced2_GetDownloadProgress,
637 WMReaderAdvanced2_GetSaveAsProgress,
638 WMReaderAdvanced2_SaveFileAs,
639 WMReaderAdvanced2_GetProtocolName,
640 WMReaderAdvanced2_StartAtMarker,
641 WMReaderAdvanced2_GetOutputSetting,
642 WMReaderAdvanced2_SetOutputSetting,
643 WMReaderAdvanced2_Preroll,
644 WMReaderAdvanced2_SetLogClientID,
645 WMReaderAdvanced2_GetLogClientID,
646 WMReaderAdvanced2_StopBuffering,
647 WMReaderAdvanced2_OpenStream,
648 WMReaderAdvanced3_StopNetStreaming,
649 WMReaderAdvanced3_StartAtPosition,
650 WMReaderAdvanced4_GetLanguageCount,
651 WMReaderAdvanced4_GetLanguage,
652 WMReaderAdvanced4_GetMaxSpeedFactor,
653 WMReaderAdvanced4_IsUsingFastCache,
654 WMReaderAdvanced4_AddLogParam,
655 WMReaderAdvanced4_SendLogParams,
656 WMReaderAdvanced4_CanSaveFileAs,
657 WMReaderAdvanced4_CancelSaveFileAs,
658 WMReaderAdvanced4_GetURL,
659 WMReaderAdvanced5_SetPlayerHook,
660 WMReaderAdvanced6_SetProtextStreamSamples
663 static inline WMReader *impl_from_IWMReaderAccelerator(IWMReaderAccelerator *iface)
665 return CONTAINING_RECORD(iface, WMReader, IWMReaderAccelerator_iface);
668 static HRESULT WINAPI reader_accl_QueryInterface(IWMReaderAccelerator *iface, REFIID riid, void **object)
670 WMReader *This = impl_from_IWMReaderAccelerator(iface);
671 return IWMReader_QueryInterface(&This->IWMReader_iface, riid, object);
674 static ULONG WINAPI reader_accl_AddRef(IWMReaderAccelerator *iface)
676 WMReader *This = impl_from_IWMReaderAccelerator(iface);
677 return IWMReader_AddRef(&This->IWMReader_iface);
680 static ULONG WINAPI reader_accl_Release(IWMReaderAccelerator *iface)
682 WMReader *This = impl_from_IWMReaderAccelerator(iface);
683 return IWMReader_Release(&This->IWMReader_iface);
686 static HRESULT WINAPI reader_accl_GetCodecInterface(IWMReaderAccelerator *iface, DWORD output, REFIID riid, void **codec)
688 WMReader *This = impl_from_IWMReaderAccelerator(iface);
690 FIXME("%p, %d, %s, %p\n", This, output, debugstr_guid(riid), codec);
692 return E_NOTIMPL;
695 static HRESULT WINAPI reader_accl_Notify(IWMReaderAccelerator *iface, DWORD output, WM_MEDIA_TYPE *subtype)
697 WMReader *This = impl_from_IWMReaderAccelerator(iface);
699 FIXME("%p, %d, %p\n", This, output, subtype);
701 return E_NOTIMPL;
704 static const IWMReaderAcceleratorVtbl WMReaderAcceleratorVtbl = {
705 reader_accl_QueryInterface,
706 reader_accl_AddRef,
707 reader_accl_Release,
708 reader_accl_GetCodecInterface,
709 reader_accl_Notify
712 HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **ret_reader)
714 WMReader *reader;
716 TRACE("(%p, %x, %p)\n", reserved, rights, ret_reader);
718 reader = heap_alloc(sizeof(*reader));
719 if(!reader)
720 return E_OUTOFMEMORY;
722 reader->IWMReader_iface.lpVtbl = &WMReaderVtbl;
723 reader->IWMReaderAdvanced6_iface.lpVtbl = &WMReaderAdvanced6Vtbl;
724 reader->IWMReaderAccelerator_iface.lpVtbl = &WMReaderAcceleratorVtbl;
725 reader->ref = 1;
727 *ret_reader = &reader->IWMReader_iface;
728 return S_OK;
731 HRESULT WINAPI WMCreateReaderPriv(IWMReader **ret_reader)
733 return WMCreateReader(NULL, 0, ret_reader);
736 HRESULT WINAPI WMCreateSyncReader(IUnknown *pcert, DWORD rights, IWMSyncReader **syncreader)
738 FIXME("(%p, %x, %p): stub\n", pcert, rights, syncreader);
740 *syncreader = NULL;
742 return E_NOTIMPL;
745 typedef struct {
746 IWMProfileManager IWMProfileManager_iface;
747 LONG ref;
748 } WMProfileManager;
750 static inline WMProfileManager *impl_from_IWMProfileManager(IWMProfileManager *iface)
752 return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager_iface);
755 static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager *iface, REFIID riid, void **ppv)
757 WMProfileManager *This = impl_from_IWMProfileManager(iface);
759 if(IsEqualGUID(&IID_IUnknown, riid)) {
760 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
761 *ppv = &This->IWMProfileManager_iface;
762 }else if(IsEqualGUID(&IID_IWMProfileManager, riid)) {
763 TRACE("(%p)->(IID_IWMProfileManager %p)\n", This, ppv);
764 *ppv = &This->IWMProfileManager_iface;
765 }else {
766 *ppv = NULL;
767 return E_NOINTERFACE;
770 IUnknown_AddRef((IUnknown*)*ppv);
771 return S_OK;
774 static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager *iface)
776 WMProfileManager *This = impl_from_IWMProfileManager(iface);
777 LONG ref = InterlockedIncrement(&This->ref);
779 TRACE("(%p) ref=%d\n", This, ref);
781 return ref;
784 static ULONG WINAPI WMProfileManager_Release(IWMProfileManager *iface)
786 WMProfileManager *This = impl_from_IWMProfileManager(iface);
787 LONG ref = InterlockedDecrement(&This->ref);
789 TRACE("(%p) ref=%d\n", This, ref);
791 if(!ref)
792 heap_free(This);
794 return ref;
797 static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager *iface, WMT_VERSION version, IWMProfile **ret)
799 WMProfileManager *This = impl_from_IWMProfileManager(iface);
800 FIXME("(%p)->(%x %p)\n", This, version, ret);
801 return E_NOTIMPL;
804 static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager *iface, REFGUID guid, IWMProfile **ret)
806 WMProfileManager *This = impl_from_IWMProfileManager(iface);
807 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(guid), ret);
808 return E_NOTIMPL;
811 static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager *iface, const WCHAR *profile, IWMProfile **ret)
813 WMProfileManager *This = impl_from_IWMProfileManager(iface);
814 FIXME("(%p)->(%s %p)\n", This, debugstr_w(profile), ret);
815 return E_NOTIMPL;
818 static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len)
820 WMProfileManager *This = impl_from_IWMProfileManager(iface);
821 FIXME("(%p)->(%p %p %p)\n", This, profile, profile_str, len);
822 return E_NOTIMPL;
825 static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager *iface, DWORD *ret)
827 WMProfileManager *This = impl_from_IWMProfileManager(iface);
828 FIXME("(%p)->(%p)\n", This, ret);
829 return E_NOTIMPL;
832 static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager *iface, DWORD index, IWMProfile **ret)
834 WMProfileManager *This = impl_from_IWMProfileManager(iface);
835 FIXME("(%p)->(%d %p)\n", This, index, ret);
836 return E_NOTIMPL;
839 static const IWMProfileManagerVtbl WMProfileManagerVtbl = {
840 WMProfileManager_QueryInterface,
841 WMProfileManager_AddRef,
842 WMProfileManager_Release,
843 WMProfileManager_CreateEmptyProfile,
844 WMProfileManager_LoadProfileByID,
845 WMProfileManager_LoadProfileByData,
846 WMProfileManager_SaveProfile,
847 WMProfileManager_GetSystemProfileCount,
848 WMProfileManager_LoadSystemProfile
851 HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
853 WMProfileManager *profile_mgr;
855 TRACE("(%p)\n", ret);
857 profile_mgr = heap_alloc(sizeof(*profile_mgr));
858 if(!profile_mgr)
859 return E_OUTOFMEMORY;
861 profile_mgr->IWMProfileManager_iface.lpVtbl = &WMProfileManagerVtbl;
862 profile_mgr->ref = 1;
864 *ret = &profile_mgr->IWMProfileManager_iface;
865 return S_OK;