winegstreamer: Introduce a new async_reader_deliver_sample helper.
[wine.git] / dlls / winegstreamer / wm_asyncreader.c
blob27195f2e0943ee9d726f07e829dd09976e7e3d8c
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 "gst_private.h"
21 #include "wine/list.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
25 union async_op_data
27 struct
29 QWORD start;
30 QWORD duration;
31 void *context;
32 } start;
35 struct async_op
37 enum async_op_type
39 ASYNC_OP_START,
40 ASYNC_OP_STOP,
41 ASYNC_OP_CLOSE,
42 } type;
43 union async_op_data u;
44 struct list entry;
47 struct sample
49 INSSBuffer *buffer;
50 QWORD pts, duration;
51 DWORD flags;
52 WORD stream;
55 struct async_reader
57 struct wm_reader reader;
59 IWMReader IWMReader_iface;
60 IWMReaderAdvanced6 IWMReaderAdvanced6_iface;
61 IWMReaderAccelerator IWMReaderAccelerator_iface;
62 IWMReaderNetworkConfig2 IWMReaderNetworkConfig2_iface;
63 IWMReaderStreamClock IWMReaderStreamClock_iface;
64 IWMReaderTypeNegotiation IWMReaderTypeNegotiation_iface;
65 IReferenceClock IReferenceClock_iface;
67 IWMReaderCallbackAdvanced *callback_advanced;
68 IWMReaderCallback *callback;
69 void *context;
71 REFERENCE_TIME clock_start;
72 LARGE_INTEGER clock_frequency;
74 HANDLE callback_thread;
75 CRITICAL_SECTION callback_cs;
76 CONDITION_VARIABLE callback_cv;
78 bool running;
79 struct list async_ops;
81 bool user_clock;
82 QWORD user_time;
85 static REFERENCE_TIME get_current_time(const struct async_reader *reader)
87 LARGE_INTEGER time;
89 QueryPerformanceCounter(&time);
90 return (time.QuadPart * 1000) / reader->clock_frequency.QuadPart * 10000;
93 static DWORD async_reader_get_wait_timeout(struct async_reader *reader, QWORD pts)
95 REFERENCE_TIME current_time = reader->user_time;
96 DWORD timeout = INFINITE;
98 if (!reader->user_clock)
100 current_time = get_current_time(reader) - reader->clock_start;
101 timeout = (pts - current_time) / 10000;
104 return pts > current_time ? timeout : 0;
107 static bool async_reader_wait_pts(struct async_reader *reader, QWORD pts)
109 IWMReaderCallbackAdvanced *callback_advanced = reader->callback_advanced;
110 DWORD timeout;
112 TRACE("reader %p, pts %I64d.\n", reader, pts);
114 if (reader->user_clock && pts > reader->user_time && callback_advanced)
116 QWORD user_time = reader->user_time;
117 LeaveCriticalSection(&reader->callback_cs);
118 IWMReaderCallbackAdvanced_OnTime(callback_advanced, user_time, reader->context);
119 EnterCriticalSection(&reader->callback_cs);
122 while (reader->running && list_empty(&reader->async_ops))
124 if (!(timeout = async_reader_get_wait_timeout(reader, pts)))
125 return true;
126 SleepConditionVariableCS(&reader->callback_cv, &reader->callback_cs, timeout);
129 return false;
132 static void async_reader_deliver_sample(struct async_reader *reader, struct sample *sample)
134 IWMReaderCallbackAdvanced *callback_advanced = reader->callback_advanced;
135 IWMReaderCallback *callback = reader->callback;
136 struct wm_stream *stream;
137 BOOL read_compressed;
138 HRESULT hr;
140 TRACE("reader %p, stream %u, pts %s, duration %s, flags %#lx, buffer %p.\n",
141 reader, sample->stream, debugstr_time(sample->pts), debugstr_time(sample->duration),
142 sample->flags, sample->buffer);
144 stream = wm_reader_get_stream_by_stream_number(&reader->reader, sample->stream);
145 read_compressed = stream->read_compressed;
147 LeaveCriticalSection(&reader->callback_cs);
148 if (read_compressed)
149 hr = IWMReaderCallbackAdvanced_OnStreamSample(callback_advanced, sample->stream,
150 sample->pts, sample->duration, sample->flags, sample->buffer, reader->context);
151 else
152 hr = IWMReaderCallback_OnSample(callback, sample->stream - 1, sample->pts, sample->duration,
153 sample->flags, sample->buffer, reader->context);
154 EnterCriticalSection(&reader->callback_cs);
156 TRACE("Callback returned %#lx.\n", hr);
158 INSSBuffer_Release(sample->buffer);
161 static void callback_thread_run(struct async_reader *reader)
163 IWMReaderCallbackAdvanced *callback_advanced = reader->callback_advanced;
164 IWMReaderCallback *callback = reader->callback;
165 static const DWORD zero;
166 HRESULT hr = S_OK;
168 while (reader->running && list_empty(&reader->async_ops))
170 struct sample sample;
172 LeaveCriticalSection(&reader->callback_cs);
173 hr = wm_reader_get_stream_sample(&reader->reader, callback_advanced, 0, &sample.buffer,
174 &sample.pts, &sample.duration, &sample.flags, &sample.stream);
175 EnterCriticalSection(&reader->callback_cs);
176 if (hr != S_OK)
177 break;
179 if (async_reader_wait_pts(reader, sample.pts))
180 async_reader_deliver_sample(reader, &sample);
181 else
182 INSSBuffer_Release(sample.buffer);
185 if (hr == NS_E_NO_MORE_SAMPLES)
187 BOOL user_clock = reader->user_clock;
188 QWORD user_time = reader->user_time;
190 LeaveCriticalSection(&reader->callback_cs);
192 IWMReaderCallback_OnStatus(callback, WMT_END_OF_STREAMING, S_OK,
193 WMT_TYPE_DWORD, (BYTE *)&zero, reader->context);
194 IWMReaderCallback_OnStatus(callback, WMT_EOF, S_OK,
195 WMT_TYPE_DWORD, (BYTE *)&zero, reader->context);
197 if (user_clock && callback_advanced)
199 /* We can only get here if user_time is greater than the PTS
200 * of all samples, in which case we cannot have sent this
201 * notification already. */
202 IWMReaderCallbackAdvanced_OnTime(callback_advanced,
203 user_time, reader->context);
206 EnterCriticalSection(&reader->callback_cs);
208 TRACE("Reached end of stream; exiting.\n");
210 else if (hr != S_OK)
212 ERR("Failed to get sample, hr %#lx.\n", hr);
216 static DWORD WINAPI async_reader_callback_thread(void *arg)
218 struct async_reader *reader = arg;
219 static const DWORD zero;
220 struct list *entry;
221 HRESULT hr = S_OK;
223 IWMReaderCallback_OnStatus(reader->callback, WMT_OPENED, S_OK,
224 WMT_TYPE_DWORD, (BYTE *)&zero, reader->context);
226 EnterCriticalSection(&reader->callback_cs);
228 while (reader->running)
230 if ((entry = list_head(&reader->async_ops)))
232 struct async_op *op = LIST_ENTRY(entry, struct async_op, entry);
233 list_remove(&op->entry);
235 hr = list_empty(&reader->async_ops) ? S_OK : E_ABORT;
236 switch (op->type)
238 case ASYNC_OP_START:
240 reader->context = op->u.start.context;
241 if (SUCCEEDED(hr))
243 wm_reader_seek(&reader->reader, op->u.start.start, op->u.start.duration);
244 reader->clock_start = get_current_time(reader);
247 LeaveCriticalSection(&reader->callback_cs);
248 IWMReaderCallback_OnStatus(reader->callback, WMT_STARTED, hr,
249 WMT_TYPE_DWORD, (BYTE *)&zero, reader->context);
250 EnterCriticalSection(&reader->callback_cs);
252 if (SUCCEEDED(hr))
253 callback_thread_run(reader);
254 break;
257 case ASYNC_OP_STOP:
258 LeaveCriticalSection(&reader->callback_cs);
259 IWMReaderCallback_OnStatus(reader->callback, WMT_STOPPED, hr,
260 WMT_TYPE_DWORD, (BYTE *)&zero, reader->context);
261 EnterCriticalSection(&reader->callback_cs);
262 break;
264 case ASYNC_OP_CLOSE:
265 LeaveCriticalSection(&reader->callback_cs);
266 IWMReaderCallback_OnStatus(reader->callback, WMT_CLOSED, hr,
267 WMT_TYPE_DWORD, (BYTE *)&zero, reader->context);
268 EnterCriticalSection(&reader->callback_cs);
270 if (SUCCEEDED(hr))
271 reader->running = false;
272 break;
275 free(op);
278 if (reader->running && list_empty(&reader->async_ops))
279 SleepConditionVariableCS(&reader->callback_cv, &reader->callback_cs, INFINITE);
282 LeaveCriticalSection(&reader->callback_cs);
284 TRACE("Reader is stopping; exiting.\n");
285 return 0;
288 static void async_reader_close(struct async_reader *reader)
290 struct async_op *op, *next;
292 if (reader->callback_thread)
294 WaitForSingleObject(reader->callback_thread, INFINITE);
295 CloseHandle(reader->callback_thread);
296 reader->callback_thread = NULL;
299 LIST_FOR_EACH_ENTRY_SAFE(op, next, &reader->async_ops, struct async_op, entry)
301 list_remove(&op->entry);
302 free(op);
305 if (reader->callback_advanced)
306 IWMReaderCallbackAdvanced_Release(reader->callback_advanced);
307 reader->callback_advanced = NULL;
309 if (reader->callback)
310 IWMReaderCallback_Release(reader->callback);
311 reader->callback = NULL;
312 reader->context = NULL;
315 static HRESULT async_reader_open(struct async_reader *reader, IWMReaderCallback *callback, void *context)
317 HRESULT hr = E_OUTOFMEMORY;
319 IWMReaderCallback_AddRef((reader->callback = callback));
320 reader->context = context;
322 if (FAILED(hr = IWMReaderCallback_QueryInterface(callback, &IID_IWMReaderCallbackAdvanced,
323 (void **)&reader->callback_advanced)))
325 WARN("Failed to retrieve IWMReaderCallbackAdvanced interface, hr %#lx\n", hr);
326 reader->callback_advanced = NULL;
329 reader->running = true;
330 if (!(reader->callback_thread = CreateThread(NULL, 0, async_reader_callback_thread, reader, 0, NULL)))
331 goto error;
333 return S_OK;
335 error:
336 async_reader_close(reader);
337 return hr;
340 static HRESULT async_reader_queue_op(struct async_reader *reader, enum async_op_type type, union async_op_data *data)
342 struct async_op *op;
344 if (!(op = calloc(1, sizeof(*op))))
345 return E_OUTOFMEMORY;
346 op->type = type;
347 if (data)
348 op->u = *data;
350 EnterCriticalSection(&reader->callback_cs);
351 list_add_tail(&reader->async_ops, &op->entry);
352 LeaveCriticalSection(&reader->callback_cs);
353 WakeConditionVariable(&reader->callback_cv);
355 return S_OK;
358 static struct async_reader *impl_from_IWMReader(IWMReader *iface)
360 return CONTAINING_RECORD(iface, struct async_reader, IWMReader_iface);
363 static HRESULT WINAPI WMReader_QueryInterface(IWMReader *iface, REFIID iid, void **out)
365 struct async_reader *reader = impl_from_IWMReader(iface);
367 return IWMProfile3_QueryInterface(&reader->reader.IWMProfile3_iface, iid, out);
370 static ULONG WINAPI WMReader_AddRef(IWMReader *iface)
372 struct async_reader *reader = impl_from_IWMReader(iface);
374 return IWMProfile3_AddRef(&reader->reader.IWMProfile3_iface);
377 static ULONG WINAPI WMReader_Release(IWMReader *iface)
379 struct async_reader *reader = impl_from_IWMReader(iface);
381 return IWMProfile3_Release(&reader->reader.IWMProfile3_iface);
384 static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url,
385 IWMReaderCallback *callback, void *context)
387 struct async_reader *reader = impl_from_IWMReader(iface);
388 HRESULT hr;
390 TRACE("reader %p, url %s, callback %p, context %p.\n",
391 reader, debugstr_w(url), callback, context);
393 EnterCriticalSection(&reader->reader.cs);
395 if (reader->reader.wg_parser)
397 LeaveCriticalSection(&reader->reader.cs);
398 WARN("Stream is already open; returning E_UNEXPECTED.\n");
399 return E_UNEXPECTED;
402 if (SUCCEEDED(hr = wm_reader_open_file(&reader->reader, url))
403 && FAILED(hr = async_reader_open(reader, callback, context)))
404 wm_reader_close(&reader->reader);
406 LeaveCriticalSection(&reader->reader.cs);
407 return hr;
410 static HRESULT WINAPI WMReader_Close(IWMReader *iface)
412 struct async_reader *reader = impl_from_IWMReader(iface);
413 HRESULT hr;
415 TRACE("reader %p.\n", reader);
417 EnterCriticalSection(&reader->reader.cs);
419 if (SUCCEEDED(hr = async_reader_queue_op(reader, ASYNC_OP_CLOSE, NULL)))
421 async_reader_close(reader);
422 hr = wm_reader_close(&reader->reader);
425 LeaveCriticalSection(&reader->reader.cs);
427 return hr;
430 static HRESULT WINAPI WMReader_GetOutputCount(IWMReader *iface, DWORD *count)
432 struct async_reader *reader = impl_from_IWMReader(iface);
434 TRACE("reader %p, count %p.\n", reader, count);
436 EnterCriticalSection(&reader->reader.cs);
437 *count = reader->reader.stream_count;
438 LeaveCriticalSection(&reader->reader.cs);
439 return S_OK;
442 static HRESULT WINAPI WMReader_GetOutputProps(IWMReader *iface, DWORD output, IWMOutputMediaProps **props)
444 struct async_reader *reader = impl_from_IWMReader(iface);
446 TRACE("reader %p, output %lu, props %p.\n", reader, output, props);
448 return wm_reader_get_output_props(&reader->reader, output, props);
451 static HRESULT WINAPI WMReader_SetOutputProps(IWMReader *iface, DWORD output, IWMOutputMediaProps *props)
453 struct async_reader *reader = impl_from_IWMReader(iface);
455 TRACE("reader %p, output %lu, props %p.\n", reader, output, props);
457 return wm_reader_set_output_props(&reader->reader, output, props);
460 static HRESULT WINAPI WMReader_GetOutputFormatCount(IWMReader *iface, DWORD output, DWORD *count)
462 struct async_reader *reader = impl_from_IWMReader(iface);
464 TRACE("reader %p, output %lu, count %p.\n", reader, output, count);
466 return wm_reader_get_output_format_count(&reader->reader, output, count);
469 static HRESULT WINAPI WMReader_GetOutputFormat(IWMReader *iface, DWORD output,
470 DWORD index, IWMOutputMediaProps **props)
472 struct async_reader *reader = impl_from_IWMReader(iface);
474 TRACE("reader %p, output %lu, index %lu, props %p.\n", reader, output, index, props);
476 return wm_reader_get_output_format(&reader->reader, output, index, props);
479 static HRESULT WINAPI WMReader_Start(IWMReader *iface,
480 QWORD start, QWORD duration, float rate, void *context)
482 union async_op_data data = {.start = {.start = start, .duration = duration, .context = context}};
483 struct async_reader *reader = impl_from_IWMReader(iface);
484 HRESULT hr;
486 TRACE("reader %p, start %s, duration %s, rate %.8e, context %p.\n",
487 reader, debugstr_time(start), debugstr_time(duration), rate, context);
489 if (rate != 1.0f)
490 FIXME("Ignoring rate %.8e.\n", rate);
492 EnterCriticalSection(&reader->reader.cs);
494 if (!reader->callback_thread)
495 hr = NS_E_INVALID_REQUEST;
496 else
497 hr = async_reader_queue_op(reader, ASYNC_OP_START, &data);
499 LeaveCriticalSection(&reader->reader.cs);
501 return hr;
504 static HRESULT WINAPI WMReader_Stop(IWMReader *iface)
506 struct async_reader *reader = impl_from_IWMReader(iface);
507 HRESULT hr;
509 TRACE("reader %p.\n", reader);
511 EnterCriticalSection(&reader->reader.cs);
513 if (!reader->callback_thread)
514 hr = E_UNEXPECTED;
515 else
516 hr = async_reader_queue_op(reader, ASYNC_OP_STOP, NULL);
518 LeaveCriticalSection(&reader->reader.cs);
520 return hr;
523 static HRESULT WINAPI WMReader_Pause(IWMReader *iface)
525 struct async_reader *This = impl_from_IWMReader(iface);
526 FIXME("(%p)\n", This);
527 return E_NOTIMPL;
530 static HRESULT WINAPI WMReader_Resume(IWMReader *iface)
532 struct async_reader *This = impl_from_IWMReader(iface);
533 FIXME("(%p)\n", This);
534 return E_NOTIMPL;
537 static const IWMReaderVtbl WMReaderVtbl = {
538 WMReader_QueryInterface,
539 WMReader_AddRef,
540 WMReader_Release,
541 WMReader_Open,
542 WMReader_Close,
543 WMReader_GetOutputCount,
544 WMReader_GetOutputProps,
545 WMReader_SetOutputProps,
546 WMReader_GetOutputFormatCount,
547 WMReader_GetOutputFormat,
548 WMReader_Start,
549 WMReader_Stop,
550 WMReader_Pause,
551 WMReader_Resume
554 static struct async_reader *impl_from_IWMReaderAdvanced6(IWMReaderAdvanced6 *iface)
556 return CONTAINING_RECORD(iface, struct async_reader, IWMReaderAdvanced6_iface);
559 static HRESULT WINAPI WMReaderAdvanced_QueryInterface(IWMReaderAdvanced6 *iface, REFIID riid, void **ppv)
561 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
562 return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv);
565 static ULONG WINAPI WMReaderAdvanced_AddRef(IWMReaderAdvanced6 *iface)
567 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
568 return IWMReader_AddRef(&This->IWMReader_iface);
571 static ULONG WINAPI WMReaderAdvanced_Release(IWMReaderAdvanced6 *iface)
573 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
574 return IWMReader_Release(&This->IWMReader_iface);
577 static HRESULT WINAPI WMReaderAdvanced_SetUserProvidedClock(IWMReaderAdvanced6 *iface, BOOL user_clock)
579 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
581 TRACE("reader %p, user_clock %d.\n", reader, user_clock);
583 EnterCriticalSection(&reader->callback_cs);
584 reader->user_clock = !!user_clock;
585 LeaveCriticalSection(&reader->callback_cs);
586 WakeConditionVariable(&reader->callback_cv);
587 return S_OK;
590 static HRESULT WINAPI WMReaderAdvanced_GetUserProvidedClock(IWMReaderAdvanced6 *iface, BOOL *user_clock)
592 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
593 FIXME("(%p)->(%p)\n", This, user_clock);
594 return E_NOTIMPL;
597 static HRESULT WINAPI WMReaderAdvanced_DeliverTime(IWMReaderAdvanced6 *iface, QWORD time)
599 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
601 TRACE("reader %p, time %s.\n", reader, debugstr_time(time));
603 EnterCriticalSection(&reader->callback_cs);
605 if (!reader->user_clock)
607 LeaveCriticalSection(&reader->callback_cs);
608 WARN("Not using a user-provided clock; returning E_UNEXPECTED.\n");
609 return E_UNEXPECTED;
612 reader->user_time = time;
614 LeaveCriticalSection(&reader->callback_cs);
615 WakeConditionVariable(&reader->callback_cv);
616 return S_OK;
619 static HRESULT WINAPI WMReaderAdvanced_SetManualStreamSelection(IWMReaderAdvanced6 *iface, BOOL selection)
621 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
622 FIXME("(%p)->(%x)\n", This, selection);
623 return E_NOTIMPL;
626 static HRESULT WINAPI WMReaderAdvanced_GetManualStreamSelection(IWMReaderAdvanced6 *iface, BOOL *selection)
628 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
629 FIXME("(%p)->(%p)\n", This, selection);
630 return E_NOTIMPL;
633 static HRESULT WINAPI WMReaderAdvanced_SetStreamsSelected(IWMReaderAdvanced6 *iface,
634 WORD count, WORD *stream_numbers, WMT_STREAM_SELECTION *selections)
636 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
638 TRACE("reader %p, count %u, stream_numbers %p, selections %p.\n",
639 reader, count, stream_numbers, selections);
641 return wm_reader_set_streams_selected(&reader->reader, count, stream_numbers, selections);
644 static HRESULT WINAPI WMReaderAdvanced_GetStreamSelected(IWMReaderAdvanced6 *iface,
645 WORD stream_number, WMT_STREAM_SELECTION *selection)
647 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
649 TRACE("reader %p, stream_number %u, selection %p.\n", reader, stream_number, selection);
651 return wm_reader_get_stream_selection(&reader->reader, stream_number, selection);
654 static HRESULT WINAPI WMReaderAdvanced_SetReceiveSelectionCallbacks(IWMReaderAdvanced6 *iface, BOOL get_callbacks)
656 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
657 FIXME("(%p)->(%x)\n", This, get_callbacks);
658 return E_NOTIMPL;
661 static HRESULT WINAPI WMReaderAdvanced_GetReceiveSelectionCallbacks(IWMReaderAdvanced6 *iface, BOOL *get_callbacks)
663 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
664 FIXME("(%p)->(%p)\n", This, get_callbacks);
665 return E_NOTIMPL;
668 static HRESULT WINAPI WMReaderAdvanced_SetReceiveStreamSamples(IWMReaderAdvanced6 *iface,
669 WORD stream_number, BOOL compressed)
671 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
673 TRACE("reader %p, stream_number %u, compressed %d.\n", reader, stream_number, compressed);
675 return wm_reader_set_read_compressed(&reader->reader, stream_number, compressed);
678 static HRESULT WINAPI WMReaderAdvanced_GetReceiveStreamSamples(IWMReaderAdvanced6 *iface, WORD stream_num,
679 BOOL *receive_stream_samples)
681 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
682 FIXME("(%p)->(%d %p)\n", This, stream_num, receive_stream_samples);
683 return E_NOTIMPL;
686 static HRESULT WINAPI WMReaderAdvanced_SetAllocateForOutput(IWMReaderAdvanced6 *iface,
687 DWORD output, BOOL allocate)
689 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
691 TRACE("reader %p, output %lu, allocate %d.\n", reader, output, allocate);
693 return wm_reader_set_allocate_for_output(&reader->reader, output, allocate);
696 static HRESULT WINAPI WMReaderAdvanced_GetAllocateForOutput(IWMReaderAdvanced6 *iface, DWORD output_num, BOOL *allocate)
698 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
700 FIXME("reader %p, output %lu, allocate %p, stub!\n", reader, output_num, allocate);
702 return E_NOTIMPL;
705 static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 *iface,
706 WORD stream_number, BOOL allocate)
708 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
710 TRACE("reader %p, stream_number %u, allocate %d.\n", reader, stream_number, allocate);
712 return wm_reader_set_allocate_for_stream(&reader->reader, stream_number, allocate);
715 static HRESULT WINAPI WMReaderAdvanced_GetAllocateForStream(IWMReaderAdvanced6 *iface, WORD output_num, BOOL *allocate)
717 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
718 FIXME("(%p)->(%d %p)\n", This, output_num, allocate);
719 return E_NOTIMPL;
722 static HRESULT WINAPI WMReaderAdvanced_GetStatistics(IWMReaderAdvanced6 *iface, WM_READER_STATISTICS *statistics)
724 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
725 FIXME("(%p)->(%p)\n", This, statistics);
726 return E_NOTIMPL;
729 static HRESULT WINAPI WMReaderAdvanced_SetClientInfo(IWMReaderAdvanced6 *iface, WM_READER_CLIENTINFO *client_info)
731 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
732 FIXME("(%p)->(%p)\n", This, client_info);
733 return E_NOTIMPL;
736 static HRESULT WINAPI WMReaderAdvanced_GetMaxOutputSampleSize(IWMReaderAdvanced6 *iface, DWORD output, DWORD *max)
738 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
739 FIXME("(%p)->(%lu %p)\n", This, output, max);
740 return E_NOTIMPL;
743 static HRESULT WINAPI WMReaderAdvanced_GetMaxStreamSampleSize(IWMReaderAdvanced6 *iface,
744 WORD stream_number, DWORD *size)
746 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
748 TRACE("reader %p, stream_number %u, size %p.\n", reader, stream_number, size);
750 return wm_reader_get_max_stream_size(&reader->reader, stream_number, size);
753 static HRESULT WINAPI WMReaderAdvanced_NotifyLateDelivery(IWMReaderAdvanced6 *iface, QWORD lateness)
755 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
756 FIXME("(%p)->(%s)\n", This, wine_dbgstr_longlong(lateness));
757 return E_NOTIMPL;
760 static HRESULT WINAPI WMReaderAdvanced2_SetPlayMode(IWMReaderAdvanced6 *iface, WMT_PLAY_MODE mode)
762 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
763 FIXME("(%p)->(%d)\n", This, mode);
764 return E_NOTIMPL;
767 static HRESULT WINAPI WMReaderAdvanced2_GetPlayMode(IWMReaderAdvanced6 *iface, WMT_PLAY_MODE *mode)
769 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
770 FIXME("(%p)->(%p)\n", This, mode);
771 return E_NOTIMPL;
774 static HRESULT WINAPI WMReaderAdvanced2_GetBufferProgress(IWMReaderAdvanced6 *iface, DWORD *percent, QWORD *buffering)
776 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
777 FIXME("(%p)->(%p %p)\n", This, percent, buffering);
778 return E_NOTIMPL;
781 static HRESULT WINAPI WMReaderAdvanced2_GetDownloadProgress(IWMReaderAdvanced6 *iface, DWORD *percent,
782 QWORD *bytes_downloaded, QWORD *download)
784 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
785 FIXME("(%p)->(%p %p %p)\n", This, percent, bytes_downloaded, download);
786 return E_NOTIMPL;
789 static HRESULT WINAPI WMReaderAdvanced2_GetSaveAsProgress(IWMReaderAdvanced6 *iface, DWORD *percent)
791 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
792 FIXME("(%p)->(%p)\n", This, percent);
793 return E_NOTIMPL;
796 static HRESULT WINAPI WMReaderAdvanced2_SaveFileAs(IWMReaderAdvanced6 *iface, const WCHAR *filename)
798 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
799 FIXME("(%p)->(%s)\n", This, debugstr_w(filename));
800 return E_NOTIMPL;
803 static HRESULT WINAPI WMReaderAdvanced2_GetProtocolName(IWMReaderAdvanced6 *iface, WCHAR *protocol, DWORD *protocol_len)
805 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
806 FIXME("(%p)->(%p %p)\n", This, protocol, protocol_len);
807 return E_NOTIMPL;
810 static HRESULT WINAPI WMReaderAdvanced2_StartAtMarker(IWMReaderAdvanced6 *iface, WORD marker_index,
811 QWORD duration, float rate, void *context)
813 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
814 FIXME("(%p)->(%d %s %f %p)\n", This, marker_index, wine_dbgstr_longlong(duration), rate, context);
815 return E_NOTIMPL;
818 static HRESULT WINAPI WMReaderAdvanced2_GetOutputSetting(IWMReaderAdvanced6 *iface, DWORD output_num,
819 const WCHAR *name, WMT_ATTR_DATATYPE *type, BYTE *value, WORD *length)
821 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
822 FIXME("(%p)->(%lu %s %p %p %p)\n", This, output_num, debugstr_w(name), type, value, length);
823 return E_NOTIMPL;
826 static HRESULT WINAPI WMReaderAdvanced2_SetOutputSetting(IWMReaderAdvanced6 *iface, DWORD output_num,
827 const WCHAR *name, WMT_ATTR_DATATYPE type, const BYTE *value, WORD length)
829 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
830 FIXME("(%p)->(%lu %s %#x %p %u)\n", This, output_num, debugstr_w(name), type, value, length);
831 return E_NOTIMPL;
834 static HRESULT WINAPI WMReaderAdvanced2_Preroll(IWMReaderAdvanced6 *iface, QWORD start, QWORD duration, float rate)
836 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
837 FIXME("(%p)->(%s %s %f)\n", This, wine_dbgstr_longlong(start), wine_dbgstr_longlong(duration), rate);
838 return E_NOTIMPL;
841 static HRESULT WINAPI WMReaderAdvanced2_SetLogClientID(IWMReaderAdvanced6 *iface, BOOL log_client_id)
843 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
844 FIXME("(%p)->(%x)\n", This, log_client_id);
845 return E_NOTIMPL;
848 static HRESULT WINAPI WMReaderAdvanced2_GetLogClientID(IWMReaderAdvanced6 *iface, BOOL *log_client_id)
850 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
851 FIXME("(%p)->(%p)\n", This, log_client_id);
852 return E_NOTIMPL;
855 static HRESULT WINAPI WMReaderAdvanced2_StopBuffering(IWMReaderAdvanced6 *iface)
857 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
858 FIXME("(%p)\n", This);
859 return E_NOTIMPL;
862 static HRESULT WINAPI WMReaderAdvanced2_OpenStream(IWMReaderAdvanced6 *iface,
863 IStream *stream, IWMReaderCallback *callback, void *context)
865 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
866 HRESULT hr;
868 TRACE("reader %p, stream %p, callback %p, context %p.\n", reader, stream, callback, context);
870 EnterCriticalSection(&reader->reader.cs);
872 if (reader->reader.wg_parser)
874 LeaveCriticalSection(&reader->reader.cs);
875 WARN("Stream is already open; returning E_UNEXPECTED.\n");
876 return E_UNEXPECTED;
879 if (SUCCEEDED(hr = wm_reader_open_stream(&reader->reader, stream))
880 && FAILED(hr = async_reader_open(reader, callback, context)))
881 wm_reader_close(&reader->reader);
883 LeaveCriticalSection(&reader->reader.cs);
884 return hr;
887 static HRESULT WINAPI WMReaderAdvanced3_StopNetStreaming(IWMReaderAdvanced6 *iface)
889 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
890 FIXME("(%p)\n", This);
891 return E_NOTIMPL;
894 static HRESULT WINAPI WMReaderAdvanced3_StartAtPosition(IWMReaderAdvanced6 *iface, WORD stream_num,
895 void *offset_start, void *duration, WMT_OFFSET_FORMAT format, float rate, void *context)
897 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
898 FIXME("(%p)->(%d %p %p %d %f %p)\n", This, stream_num, offset_start, duration, format, rate, context);
899 return E_NOTIMPL;
902 static HRESULT WINAPI WMReaderAdvanced4_GetLanguageCount(IWMReaderAdvanced6 *iface, DWORD output_num, WORD *language_count)
904 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
905 FIXME("(%p)->(%lu %p)\n", This, output_num, language_count);
906 return E_NOTIMPL;
909 static HRESULT WINAPI WMReaderAdvanced4_GetLanguage(IWMReaderAdvanced6 *iface, DWORD output_num,
910 WORD language, WCHAR *language_string, WORD *language_string_len)
912 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
914 FIXME("reader %p, output %lu, language %#x, language_string %p, language_string_len %p, stub!\n",
915 reader, output_num, language, language_string, language_string_len);
917 return E_NOTIMPL;
920 static HRESULT WINAPI WMReaderAdvanced4_GetMaxSpeedFactor(IWMReaderAdvanced6 *iface, double *factor)
922 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
923 FIXME("(%p)->(%p)\n", This, factor);
924 return E_NOTIMPL;
927 static HRESULT WINAPI WMReaderAdvanced4_IsUsingFastCache(IWMReaderAdvanced6 *iface, BOOL *using_fast_cache)
929 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
930 FIXME("(%p)->(%p)\n", This, using_fast_cache);
931 return E_NOTIMPL;
934 static HRESULT WINAPI WMReaderAdvanced4_AddLogParam(IWMReaderAdvanced6 *iface, const WCHAR *namespace,
935 const WCHAR *name, const WCHAR *value)
937 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
938 FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(namespace), debugstr_w(name), debugstr_w(value));
939 return E_NOTIMPL;
942 static HRESULT WINAPI WMReaderAdvanced4_SendLogParams(IWMReaderAdvanced6 *iface)
944 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
945 FIXME("(%p)\n", This);
946 return E_NOTIMPL;
949 static HRESULT WINAPI WMReaderAdvanced4_CanSaveFileAs(IWMReaderAdvanced6 *iface, BOOL *can_save)
951 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
952 FIXME("(%p)->(%p)\n", This, can_save);
953 return E_NOTIMPL;
956 static HRESULT WINAPI WMReaderAdvanced4_CancelSaveFileAs(IWMReaderAdvanced6 *iface)
958 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
959 FIXME("(%p)\n", This);
960 return E_NOTIMPL;
963 static HRESULT WINAPI WMReaderAdvanced4_GetURL(IWMReaderAdvanced6 *iface, WCHAR *url, DWORD *url_len)
965 struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
966 FIXME("(%p)->(%p %p)\n", This, url, url_len);
967 return E_NOTIMPL;
970 static HRESULT WINAPI WMReaderAdvanced5_SetPlayerHook(IWMReaderAdvanced6 *iface, DWORD output_num, IWMPlayerHook *hook)
972 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
974 FIXME("reader %p, output %lu, hook %p, stub!\n", reader, output_num, hook);
976 return E_NOTIMPL;
979 static HRESULT WINAPI WMReaderAdvanced6_SetProtectStreamSamples(IWMReaderAdvanced6 *iface, BYTE *cert,
980 DWORD cert_size, DWORD cert_type, DWORD flags, BYTE *initialization_vector, DWORD *initialization_vector_size)
982 struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
984 FIXME("reader %p, cert %p, cert_size %lu, cert_type %#lx, flags %#lx, vector %p, vector_size %p, stub!\n",
985 reader, cert, cert_size, cert_type, flags, initialization_vector, initialization_vector_size);
987 return E_NOTIMPL;
990 static const IWMReaderAdvanced6Vtbl WMReaderAdvanced6Vtbl = {
991 WMReaderAdvanced_QueryInterface,
992 WMReaderAdvanced_AddRef,
993 WMReaderAdvanced_Release,
994 WMReaderAdvanced_SetUserProvidedClock,
995 WMReaderAdvanced_GetUserProvidedClock,
996 WMReaderAdvanced_DeliverTime,
997 WMReaderAdvanced_SetManualStreamSelection,
998 WMReaderAdvanced_GetManualStreamSelection,
999 WMReaderAdvanced_SetStreamsSelected,
1000 WMReaderAdvanced_GetStreamSelected,
1001 WMReaderAdvanced_SetReceiveSelectionCallbacks,
1002 WMReaderAdvanced_GetReceiveSelectionCallbacks,
1003 WMReaderAdvanced_SetReceiveStreamSamples,
1004 WMReaderAdvanced_GetReceiveStreamSamples,
1005 WMReaderAdvanced_SetAllocateForOutput,
1006 WMReaderAdvanced_GetAllocateForOutput,
1007 WMReaderAdvanced_SetAllocateForStream,
1008 WMReaderAdvanced_GetAllocateForStream,
1009 WMReaderAdvanced_GetStatistics,
1010 WMReaderAdvanced_SetClientInfo,
1011 WMReaderAdvanced_GetMaxOutputSampleSize,
1012 WMReaderAdvanced_GetMaxStreamSampleSize,
1013 WMReaderAdvanced_NotifyLateDelivery,
1014 WMReaderAdvanced2_SetPlayMode,
1015 WMReaderAdvanced2_GetPlayMode,
1016 WMReaderAdvanced2_GetBufferProgress,
1017 WMReaderAdvanced2_GetDownloadProgress,
1018 WMReaderAdvanced2_GetSaveAsProgress,
1019 WMReaderAdvanced2_SaveFileAs,
1020 WMReaderAdvanced2_GetProtocolName,
1021 WMReaderAdvanced2_StartAtMarker,
1022 WMReaderAdvanced2_GetOutputSetting,
1023 WMReaderAdvanced2_SetOutputSetting,
1024 WMReaderAdvanced2_Preroll,
1025 WMReaderAdvanced2_SetLogClientID,
1026 WMReaderAdvanced2_GetLogClientID,
1027 WMReaderAdvanced2_StopBuffering,
1028 WMReaderAdvanced2_OpenStream,
1029 WMReaderAdvanced3_StopNetStreaming,
1030 WMReaderAdvanced3_StartAtPosition,
1031 WMReaderAdvanced4_GetLanguageCount,
1032 WMReaderAdvanced4_GetLanguage,
1033 WMReaderAdvanced4_GetMaxSpeedFactor,
1034 WMReaderAdvanced4_IsUsingFastCache,
1035 WMReaderAdvanced4_AddLogParam,
1036 WMReaderAdvanced4_SendLogParams,
1037 WMReaderAdvanced4_CanSaveFileAs,
1038 WMReaderAdvanced4_CancelSaveFileAs,
1039 WMReaderAdvanced4_GetURL,
1040 WMReaderAdvanced5_SetPlayerHook,
1041 WMReaderAdvanced6_SetProtectStreamSamples
1044 static struct async_reader *impl_from_IWMReaderAccelerator(IWMReaderAccelerator *iface)
1046 return CONTAINING_RECORD(iface, struct async_reader, IWMReaderAccelerator_iface);
1049 static HRESULT WINAPI reader_accl_QueryInterface(IWMReaderAccelerator *iface, REFIID riid, void **object)
1051 struct async_reader *This = impl_from_IWMReaderAccelerator(iface);
1052 return IWMReader_QueryInterface(&This->IWMReader_iface, riid, object);
1055 static ULONG WINAPI reader_accl_AddRef(IWMReaderAccelerator *iface)
1057 struct async_reader *This = impl_from_IWMReaderAccelerator(iface);
1058 return IWMReader_AddRef(&This->IWMReader_iface);
1061 static ULONG WINAPI reader_accl_Release(IWMReaderAccelerator *iface)
1063 struct async_reader *This = impl_from_IWMReaderAccelerator(iface);
1064 return IWMReader_Release(&This->IWMReader_iface);
1067 static HRESULT WINAPI reader_accl_GetCodecInterface(IWMReaderAccelerator *iface, DWORD output, REFIID riid, void **codec)
1069 struct async_reader *reader = impl_from_IWMReaderAccelerator(iface);
1071 FIXME("reader %p, output %lu, iid %s, codec %p, stub!\n", reader, output, debugstr_guid(riid), codec);
1073 return E_NOTIMPL;
1076 static HRESULT WINAPI reader_accl_Notify(IWMReaderAccelerator *iface, DWORD output, WM_MEDIA_TYPE *subtype)
1078 struct async_reader *reader = impl_from_IWMReaderAccelerator(iface);
1080 FIXME("reader %p, output %lu, subtype %p, stub!\n", reader, output, subtype);
1082 return E_NOTIMPL;
1085 static const IWMReaderAcceleratorVtbl WMReaderAcceleratorVtbl = {
1086 reader_accl_QueryInterface,
1087 reader_accl_AddRef,
1088 reader_accl_Release,
1089 reader_accl_GetCodecInterface,
1090 reader_accl_Notify
1093 static struct async_reader *impl_from_IWMReaderNetworkConfig2(IWMReaderNetworkConfig2 *iface)
1095 return CONTAINING_RECORD(iface, struct async_reader, IWMReaderNetworkConfig2_iface);
1098 static HRESULT WINAPI networkconfig_QueryInterface(IWMReaderNetworkConfig2 *iface, REFIID riid, void **ppv)
1100 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1101 return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv);
1104 static ULONG WINAPI networkconfig_AddRef(IWMReaderNetworkConfig2 *iface)
1106 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1107 return IWMReader_AddRef(&This->IWMReader_iface);
1110 static ULONG WINAPI networkconfig_Release(IWMReaderNetworkConfig2 *iface)
1112 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1113 return IWMReader_Release(&This->IWMReader_iface);
1116 static HRESULT WINAPI networkconfig_GetBufferingTime(IWMReaderNetworkConfig2 *iface, QWORD *buffering_time)
1118 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1119 FIXME("%p, %p\n", This, buffering_time);
1120 return E_NOTIMPL;
1123 static HRESULT WINAPI networkconfig_SetBufferingTime(IWMReaderNetworkConfig2 *iface, QWORD buffering_time)
1125 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1126 FIXME("%p, %s\n", This, wine_dbgstr_longlong(buffering_time));
1127 return E_NOTIMPL;
1130 static HRESULT WINAPI networkconfig_GetUDPPortRanges(IWMReaderNetworkConfig2 *iface, WM_PORT_NUMBER_RANGE *array,
1131 DWORD *ranges)
1133 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1134 FIXME("%p, %p, %p\n", This, array, ranges);
1135 return E_NOTIMPL;
1138 static HRESULT WINAPI networkconfig_SetUDPPortRanges(IWMReaderNetworkConfig2 *iface,
1139 WM_PORT_NUMBER_RANGE *ranges, DWORD count)
1141 struct async_reader *reader = impl_from_IWMReaderNetworkConfig2(iface);
1143 FIXME("reader %p, ranges %p, count %lu.\n", reader, ranges, count);
1145 return E_NOTIMPL;
1148 static HRESULT WINAPI networkconfig_GetProxySettings(IWMReaderNetworkConfig2 *iface, const WCHAR *protocol,
1149 WMT_PROXY_SETTINGS *proxy)
1151 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1152 FIXME("%p, %s, %p\n", This, debugstr_w(protocol), proxy);
1153 return E_NOTIMPL;
1156 static HRESULT WINAPI networkconfig_SetProxySettings(IWMReaderNetworkConfig2 *iface, LPCWSTR protocol,
1157 WMT_PROXY_SETTINGS proxy)
1159 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1160 FIXME("%p, %s, %d\n", This, debugstr_w(protocol), proxy);
1161 return E_NOTIMPL;
1164 static HRESULT WINAPI networkconfig_GetProxyHostName(IWMReaderNetworkConfig2 *iface, const WCHAR *protocol,
1165 WCHAR *hostname, DWORD *size)
1167 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1168 FIXME("%p, %s, %p, %p\n", This, debugstr_w(protocol), hostname, size);
1169 return E_NOTIMPL;
1172 static HRESULT WINAPI networkconfig_SetProxyHostName(IWMReaderNetworkConfig2 *iface, const WCHAR *protocol,
1173 const WCHAR *hostname)
1175 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1176 FIXME("%p, %s, %s\n", This, debugstr_w(protocol), debugstr_w(hostname));
1177 return E_NOTIMPL;
1180 static HRESULT WINAPI networkconfig_GetProxyPort(IWMReaderNetworkConfig2 *iface, const WCHAR *protocol,
1181 DWORD *port)
1183 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1184 FIXME("%p, %s, %p\n", This, debugstr_w(protocol), port);
1185 return E_NOTIMPL;
1188 static HRESULT WINAPI networkconfig_SetProxyPort(IWMReaderNetworkConfig2 *iface, const WCHAR *protocol,
1189 DWORD port)
1191 struct async_reader *reader = impl_from_IWMReaderNetworkConfig2(iface);
1193 FIXME("reader %p, protocol %s, port %lu, stub!\n", reader, debugstr_w(protocol), port);
1195 return E_NOTIMPL;
1198 static HRESULT WINAPI networkconfig_GetProxyExceptionList(IWMReaderNetworkConfig2 *iface, const WCHAR *protocol,
1199 WCHAR *exceptions, DWORD *count)
1201 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1202 FIXME("%p, %s, %p, %p\n", This, debugstr_w(protocol), exceptions, count);
1203 return E_NOTIMPL;
1206 static HRESULT WINAPI networkconfig_SetProxyExceptionList(IWMReaderNetworkConfig2 *iface, const WCHAR *protocol,
1207 const WCHAR *exceptions)
1209 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1210 FIXME("%p, %s, %s\n", This, debugstr_w(protocol), debugstr_w(exceptions));
1211 return E_NOTIMPL;
1214 static HRESULT WINAPI networkconfig_GetProxyBypassForLocal(IWMReaderNetworkConfig2 *iface, const WCHAR *protocol,
1215 BOOL *bypass)
1217 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1218 FIXME("%p, %s, %p\n", This, debugstr_w(protocol), bypass);
1219 return E_NOTIMPL;
1222 static HRESULT WINAPI networkconfig_SetProxyBypassForLocal(IWMReaderNetworkConfig2 *iface, const WCHAR *protocol,
1223 BOOL bypass)
1225 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1226 FIXME("%p, %s, %d\n", This, debugstr_w(protocol), bypass);
1227 return E_NOTIMPL;
1230 static HRESULT WINAPI networkconfig_GetForceRerunAutoProxyDetection(IWMReaderNetworkConfig2 *iface,
1231 BOOL *detection)
1233 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1234 FIXME("%p, %p\n", This, detection);
1235 return E_NOTIMPL;
1238 static HRESULT WINAPI networkconfig_SetForceRerunAutoProxyDetection(IWMReaderNetworkConfig2 *iface,
1239 BOOL detection)
1241 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1242 FIXME("%p, %d\n", This, detection);
1243 return E_NOTIMPL;
1246 static HRESULT WINAPI networkconfig_GetEnableMulticast(IWMReaderNetworkConfig2 *iface, BOOL *multicast)
1248 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1249 FIXME("%p, %p\n", This, multicast);
1250 return E_NOTIMPL;
1253 static HRESULT WINAPI networkconfig_SetEnableMulticast(IWMReaderNetworkConfig2 *iface, BOOL multicast)
1255 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1256 FIXME("%p, %d\n", This, multicast);
1257 return E_NOTIMPL;
1260 static HRESULT WINAPI networkconfig_GetEnableHTTP(IWMReaderNetworkConfig2 *iface, BOOL *enable)
1262 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1263 FIXME("%p, %p\n", This, enable);
1264 return E_NOTIMPL;
1267 static HRESULT WINAPI networkconfig_SetEnableHTTP(IWMReaderNetworkConfig2 *iface, BOOL enable)
1269 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1270 FIXME("%p, %d\n", This, enable);
1271 return E_NOTIMPL;
1274 static HRESULT WINAPI networkconfig_GetEnableUDP(IWMReaderNetworkConfig2 *iface, BOOL *enable)
1276 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1277 FIXME("%p, %p\n", This, enable);
1278 return E_NOTIMPL;
1281 static HRESULT WINAPI networkconfig_SetEnableUDP(IWMReaderNetworkConfig2 *iface, BOOL enable)
1283 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1284 FIXME("%p, %d\n", This, enable);
1285 return E_NOTIMPL;
1288 static HRESULT WINAPI networkconfig_GetEnableTCP(IWMReaderNetworkConfig2 *iface, BOOL *enable)
1290 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1291 FIXME("%p, %p\n", This, enable);
1292 return E_NOTIMPL;
1295 static HRESULT WINAPI networkconfig_SetEnableTCP(IWMReaderNetworkConfig2 *iface, BOOL enable)
1297 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1298 FIXME("%p, %d\n", This, enable);
1299 return E_NOTIMPL;
1302 static HRESULT WINAPI networkconfig_ResetProtocolRollover(IWMReaderNetworkConfig2 *iface)
1304 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1305 FIXME("%p\n", This);
1306 return E_NOTIMPL;
1309 static HRESULT WINAPI networkconfig_GetConnectionBandwidth(IWMReaderNetworkConfig2 *iface, DWORD *bandwidth)
1311 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1312 FIXME("%p, %p\n", This, bandwidth);
1313 return E_NOTIMPL;
1316 static HRESULT WINAPI networkconfig_SetConnectionBandwidth(IWMReaderNetworkConfig2 *iface, DWORD bandwidth)
1318 struct async_reader *reader = impl_from_IWMReaderNetworkConfig2(iface);
1320 FIXME("reader %p, bandwidth %lu, stub!\n", reader, bandwidth);
1322 return E_NOTIMPL;
1325 static HRESULT WINAPI networkconfig_GetNumProtocolsSupported(IWMReaderNetworkConfig2 *iface, DWORD *protocols)
1327 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1328 FIXME("%p, %p\n", This, protocols);
1329 return E_NOTIMPL;
1332 static HRESULT WINAPI networkconfig_GetSupportedProtocolName(IWMReaderNetworkConfig2 *iface, DWORD protocol_num,
1333 WCHAR *protocol, DWORD *size)
1335 struct async_reader *reader = impl_from_IWMReaderNetworkConfig2(iface);
1337 FIXME("reader %p, index %lu, protocol %p, size %p, stub!\n", reader, protocol_num, protocol, size);
1339 return E_NOTIMPL;
1342 static HRESULT WINAPI networkconfig_AddLoggingUrl(IWMReaderNetworkConfig2 *iface, const WCHAR *url)
1344 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1345 FIXME("%p, %s\n", This, debugstr_w(url));
1346 return E_NOTIMPL;
1349 static HRESULT WINAPI networkconfig_GetLoggingUrl(IWMReaderNetworkConfig2 *iface, DWORD index, WCHAR *url,
1350 DWORD *size)
1352 struct async_reader *reader = impl_from_IWMReaderNetworkConfig2(iface);
1354 FIXME("reader %p, index %lu, url %p, size %p, stub!\n", reader, index, url, size);
1356 return E_NOTIMPL;
1359 static HRESULT WINAPI networkconfig_GetLoggingUrlCount(IWMReaderNetworkConfig2 *iface, DWORD *count)
1361 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1362 FIXME("%p, %p\n", This, count);
1363 return E_NOTIMPL;
1366 static HRESULT WINAPI networkconfig_ResetLoggingUrlList(IWMReaderNetworkConfig2 *iface)
1368 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1369 FIXME("%p\n", This);
1370 return E_NOTIMPL;
1373 static HRESULT WINAPI networkconfig_GetEnableContentCaching(IWMReaderNetworkConfig2 *iface, BOOL *enable)
1375 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1376 FIXME("%p, %p\n", This, enable);
1377 return E_NOTIMPL;
1380 static HRESULT WINAPI networkconfig_SetEnableContentCaching(IWMReaderNetworkConfig2 *iface, BOOL enable)
1382 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1383 FIXME("%p, %d\n", This, enable);
1384 return E_NOTIMPL;
1387 static HRESULT WINAPI networkconfig_GetEnableFastCache(IWMReaderNetworkConfig2 *iface, BOOL *enable)
1389 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1390 FIXME("%p, %p\n", This, enable);
1391 return E_NOTIMPL;
1394 static HRESULT WINAPI networkconfig_SetEnableFastCache(IWMReaderNetworkConfig2 *iface, BOOL enable)
1396 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1397 FIXME("%p, %d\n", This, enable);
1398 return E_NOTIMPL;
1401 static HRESULT WINAPI networkconfig_GetAcceleratedStreamingDuration(IWMReaderNetworkConfig2 *iface,
1402 QWORD *duration)
1404 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1405 FIXME("%p, %p\n", This, duration);
1406 return E_NOTIMPL;
1409 static HRESULT WINAPI networkconfig_SetAcceleratedStreamingDuration(IWMReaderNetworkConfig2 *iface,
1410 QWORD duration)
1412 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1413 FIXME("%p, %s\n", This, wine_dbgstr_longlong(duration));
1414 return E_NOTIMPL;
1417 static HRESULT WINAPI networkconfig_GetAutoReconnectLimit(IWMReaderNetworkConfig2 *iface, DWORD *limit)
1419 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1420 FIXME("%p, %p\n", This, limit);
1421 return E_NOTIMPL;
1424 static HRESULT WINAPI networkconfig_SetAutoReconnectLimit(IWMReaderNetworkConfig2 *iface, DWORD limit)
1426 struct async_reader *reader = impl_from_IWMReaderNetworkConfig2(iface);
1428 FIXME("reader %p, limit %lu, stub!\n", reader, limit);
1430 return E_NOTIMPL;
1433 static HRESULT WINAPI networkconfig_GetEnableResends(IWMReaderNetworkConfig2 *iface, BOOL *enable)
1435 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1436 FIXME("%p, %p\n", This, enable);
1437 return E_NOTIMPL;
1440 static HRESULT WINAPI networkconfig_SetEnableResends(IWMReaderNetworkConfig2 *iface, BOOL enable)
1442 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1443 FIXME("%p, %u\n", This, enable);
1444 return E_NOTIMPL;
1447 static HRESULT WINAPI networkconfig_GetEnableThinning(IWMReaderNetworkConfig2 *iface, BOOL *enable)
1449 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1450 FIXME("%p, %p\n", This, enable);
1451 return E_NOTIMPL;
1454 static HRESULT WINAPI networkconfig_SetEnableThinning(IWMReaderNetworkConfig2 *iface, BOOL enable)
1456 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1457 FIXME("%p, %u\n", This, enable);
1458 return E_NOTIMPL;
1461 static HRESULT WINAPI networkconfig_GetMaxNetPacketSize(IWMReaderNetworkConfig2 *iface, DWORD *packet_size)
1463 struct async_reader *This = impl_from_IWMReaderNetworkConfig2(iface);
1464 FIXME("%p, %p\n", This, packet_size);
1465 return E_NOTIMPL;
1468 static const IWMReaderNetworkConfig2Vtbl WMReaderNetworkConfig2Vtbl =
1470 networkconfig_QueryInterface,
1471 networkconfig_AddRef,
1472 networkconfig_Release,
1473 networkconfig_GetBufferingTime,
1474 networkconfig_SetBufferingTime,
1475 networkconfig_GetUDPPortRanges,
1476 networkconfig_SetUDPPortRanges,
1477 networkconfig_GetProxySettings,
1478 networkconfig_SetProxySettings,
1479 networkconfig_GetProxyHostName,
1480 networkconfig_SetProxyHostName,
1481 networkconfig_GetProxyPort,
1482 networkconfig_SetProxyPort,
1483 networkconfig_GetProxyExceptionList,
1484 networkconfig_SetProxyExceptionList,
1485 networkconfig_GetProxyBypassForLocal,
1486 networkconfig_SetProxyBypassForLocal,
1487 networkconfig_GetForceRerunAutoProxyDetection,
1488 networkconfig_SetForceRerunAutoProxyDetection,
1489 networkconfig_GetEnableMulticast,
1490 networkconfig_SetEnableMulticast,
1491 networkconfig_GetEnableHTTP,
1492 networkconfig_SetEnableHTTP,
1493 networkconfig_GetEnableUDP,
1494 networkconfig_SetEnableUDP,
1495 networkconfig_GetEnableTCP,
1496 networkconfig_SetEnableTCP,
1497 networkconfig_ResetProtocolRollover,
1498 networkconfig_GetConnectionBandwidth,
1499 networkconfig_SetConnectionBandwidth,
1500 networkconfig_GetNumProtocolsSupported,
1501 networkconfig_GetSupportedProtocolName,
1502 networkconfig_AddLoggingUrl,
1503 networkconfig_GetLoggingUrl,
1504 networkconfig_GetLoggingUrlCount,
1505 networkconfig_ResetLoggingUrlList,
1506 networkconfig_GetEnableContentCaching,
1507 networkconfig_SetEnableContentCaching,
1508 networkconfig_GetEnableFastCache,
1509 networkconfig_SetEnableFastCache,
1510 networkconfig_GetAcceleratedStreamingDuration,
1511 networkconfig_SetAcceleratedStreamingDuration,
1512 networkconfig_GetAutoReconnectLimit,
1513 networkconfig_SetAutoReconnectLimit,
1514 networkconfig_GetEnableResends,
1515 networkconfig_SetEnableResends,
1516 networkconfig_GetEnableThinning,
1517 networkconfig_SetEnableThinning,
1518 networkconfig_GetMaxNetPacketSize
1521 static struct async_reader *impl_from_IWMReaderStreamClock(IWMReaderStreamClock *iface)
1523 return CONTAINING_RECORD(iface, struct async_reader, IWMReaderStreamClock_iface);
1526 static HRESULT WINAPI readclock_QueryInterface(IWMReaderStreamClock *iface, REFIID riid, void **ppv)
1528 struct async_reader *This = impl_from_IWMReaderStreamClock(iface);
1529 return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv);
1532 static ULONG WINAPI readclock_AddRef(IWMReaderStreamClock *iface)
1534 struct async_reader *This = impl_from_IWMReaderStreamClock(iface);
1535 return IWMReader_AddRef(&This->IWMReader_iface);
1538 static ULONG WINAPI readclock_Release(IWMReaderStreamClock *iface)
1540 struct async_reader *This = impl_from_IWMReaderStreamClock(iface);
1541 return IWMReader_Release(&This->IWMReader_iface);
1544 static HRESULT WINAPI readclock_GetTime(IWMReaderStreamClock *iface, QWORD *now)
1546 struct async_reader *This = impl_from_IWMReaderStreamClock(iface);
1547 FIXME("%p, %p\n", This, now);
1548 return E_NOTIMPL;
1551 static HRESULT WINAPI readclock_SetTimer(IWMReaderStreamClock *iface, QWORD when, void *param, DWORD *id)
1553 struct async_reader *This = impl_from_IWMReaderStreamClock(iface);
1554 FIXME("%p, %s, %p, %p\n", This, wine_dbgstr_longlong(when), param, id);
1555 return E_NOTIMPL;
1558 static HRESULT WINAPI readclock_KillTimer(IWMReaderStreamClock *iface, DWORD id)
1560 struct async_reader *reader = impl_from_IWMReaderStreamClock(iface);
1562 FIXME("reader %p, id %lu, stub!\n", reader, id);
1564 return E_NOTIMPL;
1567 static const IWMReaderStreamClockVtbl WMReaderStreamClockVtbl =
1569 readclock_QueryInterface,
1570 readclock_AddRef,
1571 readclock_Release,
1572 readclock_GetTime,
1573 readclock_SetTimer,
1574 readclock_KillTimer
1577 static struct async_reader *impl_from_IWMReaderTypeNegotiation(IWMReaderTypeNegotiation *iface)
1579 return CONTAINING_RECORD(iface, struct async_reader, IWMReaderTypeNegotiation_iface);
1582 static HRESULT WINAPI negotiation_QueryInterface(IWMReaderTypeNegotiation *iface, REFIID riid, void **ppv)
1584 struct async_reader *This = impl_from_IWMReaderTypeNegotiation(iface);
1585 return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv);
1588 static ULONG WINAPI negotiation_AddRef(IWMReaderTypeNegotiation *iface)
1590 struct async_reader *This = impl_from_IWMReaderTypeNegotiation(iface);
1591 return IWMReader_AddRef(&This->IWMReader_iface);
1594 static ULONG WINAPI negotiation_Release(IWMReaderTypeNegotiation *iface)
1596 struct async_reader *This = impl_from_IWMReaderTypeNegotiation(iface);
1597 return IWMReader_Release(&This->IWMReader_iface);
1600 static HRESULT WINAPI negotiation_TryOutputProps(IWMReaderTypeNegotiation *iface, DWORD output, IWMOutputMediaProps *props)
1602 struct async_reader *reader = impl_from_IWMReaderTypeNegotiation(iface);
1604 FIXME("reader %p, output %lu, props %p, stub!\n", reader, output, props);
1606 return E_NOTIMPL;
1609 static const IWMReaderTypeNegotiationVtbl WMReaderTypeNegotiationVtbl =
1611 negotiation_QueryInterface,
1612 negotiation_AddRef,
1613 negotiation_Release,
1614 negotiation_TryOutputProps
1617 static struct async_reader *impl_from_IReferenceClock(IReferenceClock *iface)
1619 return CONTAINING_RECORD(iface, struct async_reader, IReferenceClock_iface);
1622 static HRESULT WINAPI refclock_QueryInterface(IReferenceClock *iface, REFIID riid, void **ppv)
1624 struct async_reader *This = impl_from_IReferenceClock(iface);
1625 return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv);
1628 static ULONG WINAPI refclock_AddRef(IReferenceClock *iface)
1630 struct async_reader *This = impl_from_IReferenceClock(iface);
1631 return IWMReader_AddRef(&This->IWMReader_iface);
1634 static ULONG WINAPI refclock_Release(IReferenceClock *iface)
1636 struct async_reader *This = impl_from_IReferenceClock(iface);
1637 return IWMReader_Release(&This->IWMReader_iface);
1640 static HRESULT WINAPI refclock_GetTime(IReferenceClock *iface, REFERENCE_TIME *time)
1642 struct async_reader *This = impl_from_IReferenceClock(iface);
1643 FIXME("%p, %p\n", This, time);
1644 return E_NOTIMPL;
1647 static HRESULT WINAPI refclock_AdviseTime(IReferenceClock *iface, REFERENCE_TIME basetime,
1648 REFERENCE_TIME streamtime, HEVENT event, DWORD_PTR *cookie)
1650 struct async_reader *reader = impl_from_IReferenceClock(iface);
1652 FIXME("reader %p, basetime %s, streamtime %s, event %#Ix, cookie %p, stub!\n",
1653 reader, debugstr_time(basetime), debugstr_time(streamtime), event, cookie);
1655 return E_NOTIMPL;
1658 static HRESULT WINAPI refclock_AdvisePeriodic(IReferenceClock *iface, REFERENCE_TIME starttime,
1659 REFERENCE_TIME period, HSEMAPHORE semaphore, DWORD_PTR *cookie)
1661 struct async_reader *reader = impl_from_IReferenceClock(iface);
1663 FIXME("reader %p, starttime %s, period %s, semaphore %#Ix, cookie %p, stub!\n",
1664 reader, debugstr_time(starttime), debugstr_time(period), semaphore, cookie);
1666 return E_NOTIMPL;
1669 static HRESULT WINAPI refclock_Unadvise(IReferenceClock *iface, DWORD_PTR cookie)
1671 struct async_reader *reader = impl_from_IReferenceClock(iface);
1673 FIXME("reader %p, cookie %Iu, stub!\n", reader, cookie);
1675 return E_NOTIMPL;
1678 static const IReferenceClockVtbl ReferenceClockVtbl =
1680 refclock_QueryInterface,
1681 refclock_AddRef,
1682 refclock_Release,
1683 refclock_GetTime,
1684 refclock_AdviseTime,
1685 refclock_AdvisePeriodic,
1686 refclock_Unadvise
1689 static struct async_reader *impl_from_wm_reader(struct wm_reader *iface)
1691 return CONTAINING_RECORD(iface, struct async_reader, reader);
1694 static void *async_reader_query_interface(struct wm_reader *iface, REFIID iid)
1696 struct async_reader *reader = impl_from_wm_reader(iface);
1698 TRACE("reader %p, iid %s.\n", reader, debugstr_guid(iid));
1700 if (IsEqualIID(iid, &IID_IReferenceClock))
1701 return &reader->IReferenceClock_iface;
1703 if (IsEqualIID(iid, &IID_IWMReader))
1704 return &reader->IWMReader_iface;
1706 if (IsEqualIID(iid, &IID_IWMReaderAccelerator))
1707 return &reader->IWMReaderAccelerator_iface;
1709 if (IsEqualIID(iid, &IID_IWMReaderAdvanced)
1710 || IsEqualIID(iid, &IID_IWMReaderAdvanced2)
1711 || IsEqualIID(iid, &IID_IWMReaderAdvanced3)
1712 || IsEqualIID(iid, &IID_IWMReaderAdvanced4)
1713 || IsEqualIID(iid, &IID_IWMReaderAdvanced5)
1714 || IsEqualIID(iid, &IID_IWMReaderAdvanced6))
1715 return &reader->IWMReaderAdvanced6_iface;
1717 if (IsEqualIID(iid, &IID_IWMReaderNetworkConfig)
1718 || IsEqualIID(iid, &IID_IWMReaderNetworkConfig2))
1719 return &reader->IWMReaderNetworkConfig2_iface;
1721 if (IsEqualIID(iid, &IID_IWMReaderStreamClock))
1722 return &reader->IWMReaderStreamClock_iface;
1724 if (IsEqualIID(iid, &IID_IWMReaderTypeNegotiation))
1725 return &reader->IWMReaderTypeNegotiation_iface;
1727 return NULL;
1730 static void async_reader_destroy(struct wm_reader *iface)
1732 struct async_reader *reader = impl_from_wm_reader(iface);
1734 TRACE("reader %p.\n", reader);
1736 EnterCriticalSection(&reader->callback_cs);
1737 reader->running = false;
1738 LeaveCriticalSection(&reader->callback_cs);
1739 WakeConditionVariable(&reader->callback_cv);
1741 async_reader_close(reader);
1743 reader->callback_cs.DebugInfo->Spare[0] = 0;
1744 DeleteCriticalSection(&reader->callback_cs);
1746 wm_reader_close(&reader->reader);
1748 wm_reader_cleanup(&reader->reader);
1749 free(reader);
1752 static const struct wm_reader_ops async_reader_ops =
1754 .query_interface = async_reader_query_interface,
1755 .destroy = async_reader_destroy,
1758 HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader)
1760 struct async_reader *object;
1762 TRACE("reader %p.\n", reader);
1764 if (!(object = calloc(1, sizeof(*object))))
1765 return E_OUTOFMEMORY;
1767 wm_reader_init(&object->reader, &async_reader_ops);
1769 object->IReferenceClock_iface.lpVtbl = &ReferenceClockVtbl;
1770 object->IWMReader_iface.lpVtbl = &WMReaderVtbl;
1771 object->IWMReaderAdvanced6_iface.lpVtbl = &WMReaderAdvanced6Vtbl;
1772 object->IWMReaderAccelerator_iface.lpVtbl = &WMReaderAcceleratorVtbl;
1773 object->IWMReaderNetworkConfig2_iface.lpVtbl = &WMReaderNetworkConfig2Vtbl;
1774 object->IWMReaderStreamClock_iface.lpVtbl = &WMReaderStreamClockVtbl;
1775 object->IWMReaderTypeNegotiation_iface.lpVtbl = &WMReaderTypeNegotiationVtbl;
1777 InitializeCriticalSection(&object->callback_cs);
1778 object->callback_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": async_reader.callback_cs");
1780 QueryPerformanceFrequency(&object->clock_frequency);
1781 list_init(&object->async_ops);
1783 TRACE("Created async reader %p.\n", object);
1784 *reader = (IWMReader *)&object->IWMReader_iface;
1785 return S_OK;