ReactOS 0.4.17-dev-966-gf06eace
main.c
Go to the documentation of this file.
1/* DirectShow Base Functions (QUARTZ.DLL)
2 *
3 * Copyright 2002 Lionel Ulmer
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include "wine/debug.h"
21
22#include "quartz_private.h"
23
25
30
31bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
32{
33 unsigned int new_capacity, max_capacity;
34 void *new_elements;
35
36 if (count <= *capacity)
37 return true;
38
39 max_capacity = ~(size_t)0 / size;
40 if (count > max_capacity)
41 return false;
42
43 new_capacity = max(4, *capacity);
44 while (new_capacity < count && new_capacity <= max_capacity / 2)
45 new_capacity *= 2;
46 if (new_capacity < count)
47 new_capacity = max_capacity;
48
49 if (!(new_elements = realloc(*elements, new_capacity * size)))
50 return false;
51
52 *elements = new_elements;
53 *capacity = new_capacity;
54
55 return true;
56}
57
59{
61 {
64 }
66}
67
68/******************************************************************************
69 * DirectShow ClassFactory
70 */
71typedef struct {
72 IClassFactory IClassFactory_iface;
73 LONG ref;
76
78{
79 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
80}
81
83{
84 const CLSID *clsid;
86};
87
89{
90 { &CLSID_ACMWrapper, acm_wrapper_create },
91 { &CLSID_AllocPresenter, vmr7_presenter_create },
92 { &CLSID_AsyncReader, async_reader_create },
93 { &CLSID_AudioRender, dsound_render_create },
94 { &CLSID_AVIDec, avi_dec_create },
95 { &CLSID_AviSplitter, avi_splitter_create },
96 { &CLSID_CMpegAudioCodec, mpeg_audio_codec_create },
97 { &CLSID_CMpegVideoCodec, mpeg_video_codec_create },
98 { &CLSID_DSoundRender, dsound_render_create },
99 { &CLSID_FilterGraph, filter_graph_create },
100 { &CLSID_FilterGraphNoThread, filter_graph_no_thread_create },
101 { &CLSID_FilterMapper, filter_mapper_create },
102 { &CLSID_FilterMapper2, filter_mapper_create },
103 { &CLSID_MemoryAllocator, mem_allocator_create },
104 { &CLSID_MPEG1Splitter, mpeg1_splitter_create },
105 { &CLSID_SeekingPassThru, seeking_passthrough_create },
106 { &CLSID_SystemClock, system_clock_create },
107 { &CLSID_VideoRenderer, video_renderer_create },
108 { &CLSID_VideoMixingRenderer, vmr7_create },
109 { &CLSID_VideoMixingRenderer9, vmr9_create },
110 { &CLSID_VideoRendererDefault, video_renderer_default_create },
111 { &CLSID_WAVEParser, wave_parser_create },
112};
113
115{
118 {
119 IClassFactory_AddRef(iface);
120 *ppobj = iface;
121 return S_OK;
122 }
123
124 *ppobj = NULL;
125 WARN("(%p)->(%s,%p), not found\n", iface, debugstr_guid(riid), ppobj);
126 return E_NOINTERFACE;
127}
128
130{
132 return InterlockedIncrement(&This->ref);
133}
134
136{
139
140 if (ref == 0)
142
143 return ref;
144}
145
146
148 REFIID riid, void **ppobj)
149{
153
154 TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
155
156 *ppobj = NULL;
157 if(pOuter && !IsEqualGUID(&IID_IUnknown, riid))
158 return E_NOINTERFACE;
159
160 if (SUCCEEDED(hres = This->create_instance(pOuter, &punk)))
161 {
162 hres = IUnknown_QueryInterface(punk, riid, ppobj);
163 IUnknown_Release(punk);
164 }
165 return hres;
166}
167
169{
170 FIXME("iface %p, lock %d, stub!\n", iface, lock);
171 return S_OK;
172}
173
174static const IClassFactoryVtbl DSCF_Vtbl =
175{
181};
182
183/*******************************************************************************
184 * DllGetClassObject [QUARTZ.@]
185 * Retrieves class object from a DLL object
186 *
187 * NOTES
188 * Docs say returns STDAPI
189 *
190 * PARAMS
191 * rclsid [I] CLSID for the class object
192 * riid [I] Reference to identifier of interface for class object
193 * ppv [O] Address of variable to receive interface pointer for riid
194 *
195 * RETURNS
196 * Success: S_OK
197 * Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG,
198 * E_UNEXPECTED
199 */
201{
202 unsigned int i;
203
204 TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
205
207 {
208 for (i = 0; i < ARRAY_SIZE(object_creation); i++)
209 {
210 if (IsEqualGUID(object_creation[i].clsid, rclsid))
211 {
213 if (factory == NULL) return E_OUTOFMEMORY;
214
216 factory->ref = 1;
217
218 factory->create_instance = object_creation[i].create_instance;
219
221 return S_OK;
222 }
223 }
224 }
225 return QUARTZ_DllGetClassObject( rclsid, riid, ppv );
226}
227
228/***********************************************************************
229 * DllRegisterServer (QUARTZ.@)
230 */
232{
233 static const REGPINTYPES video_renderer_inputs[] =
234 {
235 {&MEDIATYPE_Video, &GUID_NULL},
236 };
237 static const REGFILTERPINS2 video_renderer_pins[] =
238 {
239 {
240 .nMediaTypes = ARRAY_SIZE(video_renderer_inputs),
241 .lpMediaType = video_renderer_inputs,
242 .dwFlags = REG_PINFLAG_B_RENDERER,
243 },
244 };
245 static const REGFILTER2 video_renderer_default_reg =
246 {
247 .dwVersion = 2,
248 .dwMerit = MERIT_PREFERRED + 1,
249 .cPins2 = ARRAY_SIZE(video_renderer_pins),
250 .rgPins2 = video_renderer_pins,
251 };
252 static const REGFILTER2 video_renderer_reg =
253 {
254 .dwVersion = 2,
255 .dwMerit = MERIT_PREFERRED,
256 .cPins2 = ARRAY_SIZE(video_renderer_pins),
257 .rgPins2 = video_renderer_pins,
258 };
259
260 static const REGPINTYPES vmr9_filter_inputs[] =
261 {
262 {&MEDIATYPE_Video, &GUID_NULL},
263 };
264 static const REGFILTERPINS2 vmr9_filter_pins[] =
265 {
266 {
267 .nMediaTypes = ARRAY_SIZE(vmr9_filter_inputs),
268 .lpMediaType = vmr9_filter_inputs,
269 .dwFlags = REG_PINFLAG_B_RENDERER,
270 },
271 };
272 static const REGFILTER2 vmr9_filter_reg =
273 {
274 .dwVersion = 2,
275 .dwMerit = MERIT_DO_NOT_USE,
276 .cPins2 = ARRAY_SIZE(vmr9_filter_pins),
277 .rgPins2 = vmr9_filter_pins,
278 };
279
280 static const REGPINTYPES avi_decompressor_inputs[] =
281 {
282 {&MEDIATYPE_Video, &GUID_NULL},
283 };
284 static const REGPINTYPES avi_decompressor_outputs[] =
285 {
286 {&MEDIATYPE_Video, &GUID_NULL},
287 };
288 static const REGFILTERPINS2 avi_decompressor_pins[] =
289 {
290 {
291 .nMediaTypes = ARRAY_SIZE(avi_decompressor_inputs),
292 .lpMediaType = avi_decompressor_inputs,
293 },
294 {
295 .nMediaTypes = ARRAY_SIZE(avi_decompressor_outputs),
296 .lpMediaType = avi_decompressor_outputs,
297 .dwFlags = REG_PINFLAG_B_OUTPUT,
298 },
299 };
300 static const REGFILTER2 avi_decompressor_reg =
301 {
302 .dwVersion = 2,
303 .dwMerit = MERIT_NORMAL - 16,
304 .cPins2 = ARRAY_SIZE(avi_decompressor_pins),
305 .rgPins2 = avi_decompressor_pins,
306 };
307
308 static const REGPINTYPES async_reader_outputs[] =
309 {
310 {&MEDIATYPE_Stream, &GUID_NULL},
311 };
312 static const REGFILTERPINS2 async_reader_pins[] =
313 {
314 {
315 .nMediaTypes = ARRAY_SIZE(async_reader_outputs),
316 .lpMediaType = async_reader_outputs,
317 .dwFlags = REG_PINFLAG_B_OUTPUT,
318 },
319 };
320 static const REGFILTER2 async_reader_reg =
321 {
322 .dwVersion = 2,
323 .dwMerit = MERIT_UNLIKELY,
324 .cPins2 = ARRAY_SIZE(async_reader_pins),
325 .rgPins2 = async_reader_pins,
326 };
327
328 static const REGPINTYPES acm_wrapper_inputs[] =
329 {
330 {&MEDIATYPE_Audio, &GUID_NULL},
331 };
332 static const REGPINTYPES acm_wrapper_outputs[] =
333 {
334 {&MEDIATYPE_Audio, &GUID_NULL},
335 };
336 static const REGFILTERPINS2 acm_wrapper_pins[] =
337 {
338 {
339 .nMediaTypes = ARRAY_SIZE(acm_wrapper_inputs),
340 .lpMediaType = acm_wrapper_inputs,
341 },
342 {
343 .nMediaTypes = ARRAY_SIZE(acm_wrapper_outputs),
344 .lpMediaType = acm_wrapper_outputs,
345 .dwFlags = REG_PINFLAG_B_OUTPUT,
346 },
347 };
348 static const REGFILTER2 acm_wrapper_reg =
349 {
350 .dwVersion = 2,
351 .dwMerit = MERIT_NORMAL - 16,
352 .cPins2 = ARRAY_SIZE(acm_wrapper_pins),
353 .rgPins2 = acm_wrapper_pins,
354 };
355
356 static const REGPINTYPES mpeg_splitter_inputs[] =
357 {
358 {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1Audio},
359 {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1Video},
360 {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1System},
361 {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1VideoCD},
362 };
363 static const REGPINTYPES mpeg_splitter_audio_outputs[] =
364 {
365 {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Packet},
366 {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1AudioPayload},
367 };
368 static const REGPINTYPES mpeg_splitter_video_outputs[] =
369 {
370 {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Packet},
371 {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Payload},
372 };
373 static const REGFILTERPINS2 mpeg_splitter_pins[] =
374 {
375 {
376 .nMediaTypes = ARRAY_SIZE(mpeg_splitter_inputs),
377 .lpMediaType = mpeg_splitter_inputs,
378 },
379 {
381 .nMediaTypes = ARRAY_SIZE(mpeg_splitter_audio_outputs),
382 .lpMediaType = mpeg_splitter_audio_outputs,
383 },
384 {
386 .nMediaTypes = ARRAY_SIZE(mpeg_splitter_video_outputs),
387 .lpMediaType = mpeg_splitter_video_outputs,
388 },
389 };
390 static const REGFILTER2 mpeg_splitter_reg =
391 {
392 .dwVersion = 2,
393 .dwMerit = MERIT_NORMAL,
394 .cPins2 = ARRAY_SIZE(mpeg_splitter_pins),
395 .rgPins2 = mpeg_splitter_pins,
396 };
397
398 static const REGPINTYPES avi_splitter_inputs[] =
399 {
400 {&MEDIATYPE_Stream, &MEDIASUBTYPE_Avi},
401 };
402 static const REGPINTYPES avi_splitter_outputs[] =
403 {
404 {&MEDIATYPE_Video, &GUID_NULL},
405 };
406 static const REGFILTERPINS2 avi_splitter_pins[] =
407 {
408 {
409 .nMediaTypes = ARRAY_SIZE(avi_splitter_inputs),
410 .lpMediaType = avi_splitter_inputs,
411 },
412 {
413 .dwFlags = REG_PINFLAG_B_OUTPUT,
414 .nMediaTypes = ARRAY_SIZE(avi_splitter_outputs),
415 .lpMediaType = avi_splitter_outputs,
416 },
417 };
418 static const REGFILTER2 avi_splitter_reg =
419 {
420 .dwVersion = 2,
421 .dwMerit = MERIT_NORMAL,
422 .cPins2 = ARRAY_SIZE(avi_splitter_pins),
423 .rgPins2 = avi_splitter_pins,
424 };
425
426 static const REGPINTYPES wave_parser_inputs[] =
427 {
428 {&MEDIATYPE_Stream, &MEDIASUBTYPE_WAVE},
429 {&MEDIATYPE_Stream, &MEDIASUBTYPE_AU},
430 {&MEDIATYPE_Stream, &MEDIASUBTYPE_AIFF},
431 };
432 static const REGPINTYPES wave_parser_outputs[] =
433 {
434 {&MEDIATYPE_Audio, &GUID_NULL},
435 };
436 static const REGFILTERPINS2 wave_parser_pins[] =
437 {
438 {
439 .nMediaTypes = ARRAY_SIZE(wave_parser_inputs),
440 .lpMediaType = wave_parser_inputs,
441 },
442 {
443 .dwFlags = REG_PINFLAG_B_OUTPUT,
444 .nMediaTypes = ARRAY_SIZE(wave_parser_outputs),
445 .lpMediaType = wave_parser_outputs,
446 },
447 };
448 static const REGFILTER2 wave_parser_reg =
449 {
450 .dwVersion = 2,
451 .dwMerit = MERIT_UNLIKELY,
452 .cPins2 = ARRAY_SIZE(wave_parser_pins),
453 .rgPins2 = wave_parser_pins,
454 };
455
456 static const REGPINTYPES mpeg_audio_codec_inputs[] =
457 {
458 {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Packet},
459 {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Payload},
460 {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1AudioPayload},
461 };
462 static const REGPINTYPES mpeg_audio_codec_outputs[] =
463 {
464 {&MEDIATYPE_Audio, &MEDIASUBTYPE_PCM},
465 };
466 static const REGFILTERPINS2 mpeg_audio_codec_pins[] =
467 {
468 {
469 .nMediaTypes = ARRAY_SIZE(mpeg_audio_codec_inputs),
470 .lpMediaType = mpeg_audio_codec_inputs,
471 },
472 {
473 .dwFlags = REG_PINFLAG_B_OUTPUT,
474 .nMediaTypes = ARRAY_SIZE(mpeg_audio_codec_outputs),
475 .lpMediaType = mpeg_audio_codec_outputs,
476 },
477 };
478 static const REGFILTER2 mpeg_audio_codec_reg =
479 {
480 .dwVersion = 2,
481 .dwMerit = 0x03680001,
482 .cPins2 = ARRAY_SIZE(mpeg_audio_codec_pins),
483 .rgPins2 = mpeg_audio_codec_pins,
484 };
485
486 static const REGPINTYPES mpeg_video_codec_inputs[] =
487 {
488 {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Packet},
489 {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Payload},
490 };
491 static const REGPINTYPES mpeg_video_codec_outputs[] =
492 {
493 {&MEDIATYPE_Video, &GUID_NULL},
494 };
495 static const REGFILTERPINS2 mpeg_video_codec_pins[] =
496 {
497 {
498 .nMediaTypes = ARRAY_SIZE(mpeg_video_codec_inputs),
499 .lpMediaType = mpeg_video_codec_inputs,
500 },
501 {
502 .dwFlags = REG_PINFLAG_B_OUTPUT,
503 .nMediaTypes = ARRAY_SIZE(mpeg_video_codec_outputs),
504 .lpMediaType = mpeg_video_codec_outputs,
505 },
506 };
507 static const REGFILTER2 mpeg_video_codec_reg =
508 {
509 .dwVersion = 2,
510 .dwMerit = 0x40000001,
511 .cPins2 = ARRAY_SIZE(mpeg_video_codec_pins),
512 .rgPins2 = mpeg_video_codec_pins,
513 };
514
515 IFilterMapper2 *mapper;
516 HRESULT hr;
517
518 TRACE("\n");
519
521 return hr;
522
523 if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
524 &IID_IFilterMapper2, (void **)&mapper)))
525 return hr;
526
527 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoRenderer, L"Video Renderer", NULL,
528 &CLSID_LegacyAmFilterCategory, NULL, &video_renderer_reg)))
529 goto done;
530 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoRendererDefault, L"Video Renderer", NULL,
531 &CLSID_LegacyAmFilterCategory, NULL, &video_renderer_default_reg)))
532 goto done;
533 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoMixingRenderer9, L"Video Mixing Renderer 9", NULL,
534 &CLSID_LegacyAmFilterCategory, NULL, &vmr9_filter_reg)))
535 goto done;
536 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_AVIDec, L"AVI Decompressor", NULL,
537 &CLSID_LegacyAmFilterCategory, NULL, &avi_decompressor_reg)))
538 goto done;
539 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_AsyncReader, L"File Source (Async.)", NULL,
540 &CLSID_LegacyAmFilterCategory, NULL, &async_reader_reg)))
541 goto done;
542 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_ACMWrapper, L"ACM Wrapper", NULL,
543 &CLSID_LegacyAmFilterCategory, NULL, &acm_wrapper_reg)))
544 goto done;
545 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_AviSplitter, L"AVI Splitter", NULL,
546 NULL, NULL, &avi_splitter_reg)))
547 goto done;
548 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_MPEG1Splitter, L"MPEG-I Stream Splitter", NULL,
549 NULL, NULL, &mpeg_splitter_reg)))
550 goto done;
551 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_WAVEParser, L"Wave Parser", NULL,
552 NULL, NULL, &wave_parser_reg)))
553 goto done;
554 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_CMpegAudioCodec, L"MPEG Audio Decoder", NULL,
555 NULL, NULL, &mpeg_audio_codec_reg)))
556 goto done;
557 if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_CMpegVideoCodec, L"MPEG Video Decoder", NULL,
558 NULL, NULL, &mpeg_video_codec_reg)))
559 goto done;
560
561done:
562 IFilterMapper2_Release(mapper);
563 return hr;
564}
565
566/***********************************************************************
567 * DllUnregisterServer (QUARTZ.@)
568 */
570{
571 IFilterMapper2 *mapper;
572 HRESULT hr;
573
574 TRACE("\n");
575
576 if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
577 &IID_IFilterMapper2, (void **)&mapper)))
578 return hr;
579
580 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoRenderer)))
581 goto done;
582 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoRendererDefault)))
583 goto done;
584 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoMixingRenderer9)))
585 goto done;
586 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_AVIDec)))
587 goto done;
588 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_AsyncReader)))
589 goto done;
590 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_ACMWrapper)))
591 goto done;
592 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_AviSplitter)))
593 goto done;
594 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_MPEG1Splitter)))
595 goto done;
596 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_WAVEParser)))
597 goto done;
598 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegAudioCodec)))
599 goto done;
600 if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegVideoCodec)))
601 goto done;
602
603done:
604 IFilterMapper2_Release(mapper);
605 if (SUCCEEDED(hr))
607
608 return hr;
609}
610
611#define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
612 { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } , #name },
613
614static const struct {
615 const GUID riid;
616 const char *name;
617} InterfaceDesc[] =
618{
619#include "uuids.h"
620 { { 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0} }, NULL }
622
623/***********************************************************************
624 * proxies
625 */
627 const GUID *pCategory,
628 IBaseFilter *pf,
629 REFIID riid,
630 void **ppint )
631{
632 return ICaptureGraphBuilder_RemoteFindInterface_Proxy( This, pCategory, pf,
633 riid, (IUnknown **)ppint );
634}
635
637 const GUID *pCategory,
638 IBaseFilter *pf,
639 REFIID riid,
640 IUnknown **ppint )
641{
642 return ICaptureGraphBuilder_FindInterface( This, pCategory, pf, riid, (void **)ppint );
643}
644
646 const GUID *pCategory,
647 const GUID *pType,
648 IBaseFilter *pf,
649 REFIID riid,
650 void **ppint )
651{
652 return ICaptureGraphBuilder2_RemoteFindInterface_Proxy( This, pCategory, pType,
653 pf, riid, (IUnknown **)ppint );
654}
655
657 const GUID *pCategory,
658 const GUID *pType,
659 IBaseFilter *pf,
660 REFIID riid,
661 IUnknown **ppint )
662{
663 return ICaptureGraphBuilder2_FindInterface( This, pCategory, pType, pf, riid, (void **)ppint );
664}
665
666/***********************************************************************
667 * qzdebugstr_guid (internal)
668 *
669 * Gives a text version of DirectShow GUIDs
670 */
671const char * qzdebugstr_guid( const GUID * id )
672{
673 int i;
674
675 for (i=0; InterfaceDesc[i].name; i++)
676 if (IsEqualGUID(&InterfaceDesc[i].riid, id)) return InterfaceDesc[i].name;
677
678 return debugstr_guid(id);
679}
680
681int WINAPI AmpFactorToDB(int ampfactor)
682{
683 FIXME("(%d) Stub!\n", ampfactor);
684 return 0;
685}
686
688{
689 FIXME("(%d) Stub!\n", db);
690 /* Avoid divide by zero (probably during range computation) in Windows Media Player 6.4 */
691 if (db < -1000)
692 return 0;
693 return 100;
694}
695
696/***********************************************************************
697 * AMGetErrorTextA (QUARTZ.@)
698 */
700{
701 DWORD res;
703
704 TRACE("hr %#lx, buffer %p, maxlen %lu.\n", hr, buffer, maxlen);
705
706 if (!buffer)
707 return 0;
708
710 if (!res)
711 return 0;
712
713 res = WideCharToMultiByte(CP_ACP, 0, errorW, -1, NULL, 0, 0, 0);
714 if (res > maxlen || !res)
715 return 0;
716 return WideCharToMultiByte(CP_ACP, 0, errorW, -1, buffer, maxlen, 0, 0) - 1;
717}
718
719/***********************************************************************
720 * AMGetErrorTextW (QUARTZ.@)
721 */
723{
724 unsigned int len;
726
727 TRACE("hr %#lx, buffer %p, maxlen %lu.\n", hr, buffer, maxlen);
728
729 if (!buffer) return 0;
730 swprintf(error, ARRAY_SIZE(error), L"Error: 0x%lx", hr);
731 if ((len = wcslen(error)) >= maxlen)
732 return 0;
734 return len;
735}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
REGPINTYPES
Definition: axextend.idl:194
@ REG_PINFLAG_B_RENDERER
Definition: axextend.idl:219
@ REG_PINFLAG_B_OUTPUT
Definition: axextend.idl:221
@ REG_PINFLAG_B_ZERO
Definition: axextend.idl:218
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
BOOL NTAPI DllMain(_In_ HINSTANCE hDll, _In_ ULONG dwReason, _In_opt_ PVOID pReserved)
Definition: main.c:33
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
const GUID IID_IClassFactory
HRESULT create_instance(const CLSID *clsid, const IID *iid, void **ppv)
Definition: clsfactory.c:212
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define realloc
Definition: debug_ros.c:6
HRESULT hr
Definition: delayimp.cpp:582
static LPVOID LPUNKNOWN
Definition: dinput.c:53
HRESULT mpeg_video_codec_create(IUnknown *outer, IUnknown **out)
Definition: decoder.c:27
HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out)
Definition: decoder.c:21
#define NULL
Definition: types.h:112
static const struct object_creation_info object_creation[]
Definition: main.c:60
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: main.c:153
static const IClassFactoryVtbl DSCF_Vtbl
Definition: main.c:127
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:49
static HINSTANCE instance
Definition: main.c:35
HRESULT WINAPI DllRegisterServer(void)
Definition: main.c:235
static ULONG WINAPI DSCF_AddRef(IClassFactory *iface)
Definition: main.c:84
static ULONG WINAPI DSCF_Release(IClassFactory *iface)
Definition: main.c:90
HRESULT WINAPI DllUnregisterServer(void)
Definition: main.c:259
static HRESULT WINAPI DSCF_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:122
static HRESULT WINAPI DSCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
Definition: main.c:69
static HRESULT WINAPI DSCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj)
Definition: main.c:101
HRESULT acm_wrapper_create(IUnknown *outer, IUnknown **out)
Definition: acmwrapper.c:513
HRESULT avi_dec_create(IUnknown *outer, IUnknown **out)
Definition: avidec.c:613
HRESULT dsound_render_create(IUnknown *outer, IUnknown **out)
HRESULT async_reader_create(IUnknown *outer, IUnknown **out)
Definition: filesource.c:430
HRESULT filter_graph_no_thread_create(IUnknown *outer, IUnknown **out)
Definition: filtergraph.c:5757
HRESULT filter_graph_create(IUnknown *outer, IUnknown **out)
Definition: filtergraph.c:5752
HRESULT filter_mapper_create(IUnknown *pUnkOuter, IUnknown **out)
HRESULT __RPC_STUB ICaptureGraphBuilder_FindInterface_Stub(ICaptureGraphBuilder *This, const GUID *pCategory, IBaseFilter *pf, REFIID riid, IUnknown **ppint)
Definition: main.c:636
const char * qzdebugstr_guid(const GUID *id)
Definition: main.c:671
HRESULT WINAPI QUARTZ_DllUnregisterServer(void)
HRESULT WINAPI QUARTZ_DllGetClassObject(REFCLSID, REFIID, LPVOID *)
DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR buffer, DWORD maxlen)
Definition: main.c:699
DWORD WINAPI AMGetErrorTextW(HRESULT hr, LPWSTR buffer, DWORD maxlen)
Definition: main.c:722
HRESULT WINAPI QUARTZ_DllRegisterServer(void)
HRESULT __RPC_STUB ICaptureGraphBuilder2_FindInterface_Stub(ICaptureGraphBuilder2 *This, const GUID *pCategory, const GUID *pType, IBaseFilter *pf, REFIID riid, IUnknown **ppint)
Definition: main.c:656
int WINAPI AmpFactorToDB(int ampfactor)
Definition: main.c:681
HRESULT CALLBACK ICaptureGraphBuilder_FindInterface_Proxy(ICaptureGraphBuilder *This, const GUID *pCategory, IBaseFilter *pf, REFIID riid, void **ppint)
Definition: main.c:626
static const struct @330 InterfaceDesc[]
BOOL WINAPI QUARTZ_DllMain(HINSTANCE, DWORD, LPVOID)
HRESULT CALLBACK ICaptureGraphBuilder2_FindInterface_Proxy(ICaptureGraphBuilder2 *This, const GUID *pCategory, const GUID *pType, IBaseFilter *pf, REFIID riid, void **ppint)
Definition: main.c:645
int WINAPI DBToAmpFactor(int db)
Definition: main.c:687
bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
Definition: main.c:31
HRESULT mem_allocator_create(IUnknown *lpUnkOuter, IUnknown **out)
Definition: memallocator.c:912
HRESULT mpeg1_splitter_create(IUnknown *outer, IUnknown **out)
Definition: parser.c:27
HRESULT wave_parser_create(IUnknown *outer, IUnknown **out)
Definition: parser.c:33
HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out)
Definition: parser.c:21
HRESULT seeking_passthrough_create(IUnknown *outer, IUnknown **out)
Definition: passthrough.c:94
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1971
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define CP_ACP
Definition: compat.h:109
#define CALLBACK
Definition: compat.h:35
#define WideCharToMultiByte
Definition: compat.h:111
unsigned int size_t
Definition: corecrt.h:203
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
#define swprintf
Definition: precomp.h:40
#define L(x)
Definition: resources.c:13
r reserved
Definition: btrfs.c:3006
#define MERIT_DO_NOT_USE
Definition: precomp.h:18
#define MAX_ERROR_TEXT_LEN
Definition: errors.h:29
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const WCHAR errorW[]
Definition: htmlevent.c:61
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define GUID_NULL
Definition: ks.h:106
#define error(str)
Definition: mkdosfs.c:1605
HRESULT hres
Definition: protocol.c:432
static IUnknown * outer
Definition: compobj.c:82
const CLSID * clsid
Definition: msctf.cpp:50
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158
HRESULT vmr9_create(IUnknown *outer, IUnknown **out)
Definition: vmr9.c:2169
HRESULT video_renderer_create(IUnknown *outer, IUnknown **out)
HRESULT vmr7_create(IUnknown *outer, IUnknown **out)
Definition: vmr7.c:1553
HRESULT video_renderer_default_create(IUnknown *outer, IUnknown **out)
void video_window_unregister_class(void)
Definition: window.c:1269
HRESULT vmr7_presenter_create(IUnknown *outer, IUnknown **out)
HRESULT system_clock_create(IUnknown *outer, IUnknown **out)
Definition: systemclock.c:327
#define __RPC_STUB
Definition: rpc.h:62
wcscpy
#define TRACE(s)
Definition: solgame.cpp:4
void strmbase_release_typelibs(void)
Definition: dispatch.c:72
DWORD dwVersion
Definition: axextend.idl:238
Definition: main.c:439
IClassFactory IClassFactory_iface
Definition: main.c:440
Definition: name.c:39
HRESULT(* create_instance)(IUnknown *outer, IUnknown **out)
Definition: main.c:58
const CLSID * clsid
Definition: main.c:56
Definition: send.c:48
#define max(a, b)
Definition: svc.c:63
rwlock_t lock
Definition: tcpcore.h:0
uint16_t * LPWSTR
Definition: typedefs.h:56
char * LPSTR
Definition: typedefs.h:51
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479