ReactOS 0.4.15-dev-8093-g3285f69
vfwcapture.c
Go to the documentation of this file.
1/* Video For Windows Steering structure
2 *
3 * Copyright 2005 Maarten Lankhorst
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
21#define COBJMACROS
22
23#include "config.h"
24#include <stdarg.h>
25
26#include "windef.h"
27#include "winbase.h"
28#include "wtypes.h"
29#include "wingdi.h"
30#include "winuser.h"
31#include "dshow.h"
32
33#include "qcap_main.h"
34#include "wine/debug.h"
35
36#include "capture.h"
37#include "uuids.h"
38#include "vfwmsgs.h"
39#include "amvideo.h"
40#include "strmif.h"
41#include "ddraw.h"
42#include "ocidl.h"
43#include "oleauto.h"
44
46
47static const IBaseFilterVtbl VfwCapture_Vtbl;
48static const IAMStreamConfigVtbl IAMStreamConfig_VTable;
49static const IAMVideoProcAmpVtbl IAMVideoProcAmp_VTable;
50static const IPersistPropertyBagVtbl IPersistPropertyBag_VTable;
51static const IPinVtbl VfwPin_Vtbl;
52
54
55typedef struct VfwCapture
56{
59 IAMStreamConfig IAMStreamConfig_iface;
65
68
70{
71 return CONTAINING_RECORD(iface, VfwCapture, IUnknown_inner);
72}
73
75{
76 return CONTAINING_RECORD(iface, VfwCapture, filter);
77}
78
80{
81 return CONTAINING_RECORD(iface, VfwCapture, filter.IBaseFilter_iface);
82}
83
84static inline VfwCapture *impl_from_IAMStreamConfig(IAMStreamConfig *iface)
85{
86 return CONTAINING_RECORD(iface, VfwCapture, IAMStreamConfig_iface);
87}
88
90{
91 return CONTAINING_RECORD(iface, VfwCapture, IAMVideoProcAmp_iface);
92}
93
95{
96 return CONTAINING_RECORD(iface, VfwCapture, IPersistPropertyBag_iface);
97}
98
99/* VfwPin implementation */
100typedef struct VfwPinImpl
101{
106
107
108/* VfwCapture inner IUnknown */
110{
112
113 TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ret_iface);
114
115 *ret_iface = NULL;
116
118 *ret_iface = &This->IUnknown_inner;
119 else if (IsEqualIID(riid, &IID_IPersist) || IsEqualIID(riid, &IID_IMediaFilter) ||
121 *ret_iface = &This->filter.IBaseFilter_iface;
123 *ret_iface = &This->IPersistPropertyBag_iface;
124 else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags))
125 FIXME("IAMFilterMiscFlags not supported yet!\n");
127 FIXME("ISpecifyPropertyPages not supported yet!\n");
128 else if (IsEqualIID(riid, &IID_IAMVfwCaptureDialogs))
129 FIXME("IAMVfwCaptureDialogs not supported yet!\n");
130 else if (IsEqualIID(riid, &IID_IAMStreamConfig))
131 *ret_iface = &This->IAMStreamConfig_iface;
132 else if (IsEqualIID(riid, &IID_IAMVideoProcAmp))
133 *ret_iface = &This->IAMVideoProcAmp_iface;
134 else
135 WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ret_iface);
136
137 if (!*ret_iface)
138 return E_NOINTERFACE;
139
140 IUnknown_AddRef((IUnknown*)*ret_iface);
141 return S_OK;
142}
143
145{
147 ULONG ref = BaseFilterImpl_AddRef(&This->filter.IBaseFilter_iface);
148
149 TRACE("(%p) ref=%d\n", This, ref);
150
151 return ref;
152}
153
155{
157 ULONG ref = InterlockedDecrement(&This->filter.refCount);
158
159 TRACE("(%p) ref=%d\n", This, ref);
160
161 if (!ref)
162 {
163 IPin *conn = NULL;
164
165 TRACE("destroying everything\n");
166 if (This->init)
167 {
168 if (This->filter.state != State_Stopped)
169 qcap_driver_stop(This->driver_info, &This->filter.state);
170 qcap_driver_destroy(This->driver_info);
171 }
172 IPin_ConnectedTo(This->pOutputPin, &conn);
173 if (conn)
174 {
175 IPin_Disconnect(conn);
176 IPin_Disconnect(This->pOutputPin);
177 IPin_Release(conn);
178 }
179 IPin_Release(This->pOutputPin);
180 BaseFilter_Destroy(&This->filter);
183 }
184
185 return ref;
186}
187
188static const IUnknownVtbl unknown_inner_vtbl =
189{
193};
194
196{
198
199 if (pos >= 1 || pos < 0)
200 return NULL;
201
202 IPin_AddRef(This->pOutputPin);
203 return This->pOutputPin;
204}
205
207{
208 return 1;
209}
210
214};
215
217{
218 VfwCapture *pVfwCapture;
219 HRESULT hr;
220
221 TRACE("%p - %p\n", pUnkOuter, phr);
222
223 *phr = E_OUTOFMEMORY;
224 pVfwCapture = CoTaskMemAlloc( sizeof(VfwCapture) );
225 if (!pVfwCapture)
226 return NULL;
227
228 BaseFilter_Init(&pVfwCapture->filter, &VfwCapture_Vtbl, &CLSID_VfwCapture, (DWORD_PTR)(__FILE__ ": VfwCapture.csFilter"), &BaseFuncTable);
229
230 pVfwCapture->IUnknown_inner.lpVtbl = &unknown_inner_vtbl;
231 pVfwCapture->IAMStreamConfig_iface.lpVtbl = &IAMStreamConfig_VTable;
232 pVfwCapture->IAMVideoProcAmp_iface.lpVtbl = &IAMVideoProcAmp_VTable;
234 pVfwCapture->init = FALSE;
235
236 if (pUnkOuter)
237 pVfwCapture->outer_unk = pUnkOuter;
238 else
239 pVfwCapture->outer_unk = &pVfwCapture->IUnknown_inner;
240
242 &pVfwCapture->filter.csFilter, &pVfwCapture->pOutputPin);
243 if (FAILED(hr))
244 {
245 CoTaskMemFree(pVfwCapture);
246 return NULL;
247 }
248 TRACE("-- created at %p\n", pVfwCapture);
249
251 *phr = S_OK;
252 return &pVfwCapture->IUnknown_inner;
253}
254
256{
258
259 return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface);
260}
261
263{
265
266 return IUnknown_AddRef(This->outer_unk);
267}
268
270{
272
273 return IUnknown_Release(This->outer_unk);
274}
275
279{
281
282 TRACE("()\n");
283 return qcap_driver_stop(This->driver_info, &This->filter.state);
284}
285
287{
289
290 TRACE("()\n");
291 return qcap_driver_pause(This->driver_info, &This->filter.state);
292}
293
295{
297 TRACE("(%s)\n", wine_dbgstr_longlong(tStart));
298 return qcap_driver_run(This->driver_info, &This->filter.state);
299}
300
303{
304 FIXME("(%s, %p) - stub\n", debugstr_w(Id), ppPin);
305 return E_NOTIMPL;
306}
307
308static const IBaseFilterVtbl VfwCapture_Vtbl =
309{
325};
326
327/* AMStreamConfig interface, we only need to implement {G,S}etFormat */
329 void **ret_iface)
330{
332
333 return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface);
334}
335
336static ULONG WINAPI AMStreamConfig_AddRef( IAMStreamConfig * iface )
337{
339
340 return IUnknown_AddRef(This->outer_unk);
341}
342
343static ULONG WINAPI AMStreamConfig_Release( IAMStreamConfig * iface )
344{
346
347 return IUnknown_Release(This->outer_unk);
348}
349
350static HRESULT WINAPI
351AMStreamConfig_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *pmt)
352{
353 HRESULT hr;
355 BasePin *pin;
356
357 TRACE("(%p): %p->%p\n", iface, pmt, pmt ? pmt->pbFormat : NULL);
358
359 if (This->filter.state != State_Stopped)
360 {
361 TRACE("Returning not stopped error\n");
362 return VFW_E_NOT_STOPPED;
363 }
364
365 if (!pmt)
366 {
367 TRACE("pmt is NULL\n");
368 return E_POINTER;
369 }
370
372
373 pin = (BasePin *)This->pOutputPin;
374 if (pin->pConnectedTo != NULL)
375 {
376 hr = IPin_QueryAccept(pin->pConnectedTo, pmt);
377 TRACE("Would accept: %d\n", hr);
378 if (hr == S_FALSE)
380 }
381
382 hr = qcap_driver_set_format(This->driver_info, pmt);
383 if (SUCCEEDED(hr) && This->filter.filterInfo.pGraph && pin->pConnectedTo )
384 {
385 hr = IFilterGraph_Reconnect(This->filter.filterInfo.pGraph, This->pOutputPin);
386 if (SUCCEEDED(hr))
387 TRACE("Reconnection completed, with new media format..\n");
388 }
389 TRACE("Returning: %d\n", hr);
390 return hr;
391}
392
393static HRESULT WINAPI
394AMStreamConfig_GetFormat( IAMStreamConfig *iface, AM_MEDIA_TYPE **pmt )
395{
397
398 TRACE("%p -> (%p)\n", iface, pmt);
399 return qcap_driver_get_format(This->driver_info, pmt);
400}
401
402static HRESULT WINAPI
403AMStreamConfig_GetNumberOfCapabilities( IAMStreamConfig *iface, int *piCount,
404 int *piSize )
405{
406 FIXME("%p: %p %p - stub, intentional\n", iface, piCount, piSize);
407 *piCount = 0;
408 return E_NOTIMPL; /* Not implemented for this interface */
409}
410
411static HRESULT WINAPI
412AMStreamConfig_GetStreamCaps( IAMStreamConfig *iface, int iIndex,
413 AM_MEDIA_TYPE **pmt, BYTE *pSCC )
414{
415 FIXME("%p: %d %p %p - stub, intentional\n", iface, iIndex, pmt, pSCC);
416 return E_NOTIMPL; /* Not implemented for this interface */
417}
418
419static const IAMStreamConfigVtbl IAMStreamConfig_VTable =
420{
428};
429
431 void **ret_iface)
432{
434
435 return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface);
436}
437
439{
441
442 return IUnknown_AddRef(This->outer_unk);
443}
444
446{
448
449 return IUnknown_Release(This->outer_unk);
450}
451
452static HRESULT WINAPI
454 LONG *pMax, LONG *pSteppingDelta, LONG *pDefault, LONG *pCapsFlags )
455{
457
458 return qcap_driver_get_prop_range( This->driver_info, Property, pMin, pMax,
459 pSteppingDelta, pDefault, pCapsFlags );
460}
461
462static HRESULT WINAPI
464 LONG Flags )
465{
467
468 return qcap_driver_set_prop(This->driver_info, Property, lValue, Flags);
469}
470
471static HRESULT WINAPI
473 LONG *Flags )
474{
476
477 return qcap_driver_get_prop(This->driver_info, Property, lValue, Flags);
478}
479
480static const IAMVideoProcAmpVtbl IAMVideoProcAmp_VTable =
481{
488};
489
491{
493
494 return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface);
495}
496
498{
500
501 return IUnknown_AddRef(This->outer_unk);
502}
503
505{
507
508 return IUnknown_Release(This->outer_unk);
509}
510
511static HRESULT WINAPI
513{
515
516 FIXME("%p - stub\n", This);
517
518 return E_NOTIMPL;
519}
520
522{
524
525 FIXME("%p - stub\n", This);
526
527 return E_NOTIMPL;
528}
529
530static HRESULT WINAPI
532 IErrorLog *pErrorLog )
533{
535 HRESULT hr;
536 VARIANT var;
537 const OLECHAR VFWIndex[] = {'V','F','W','I','n','d','e','x',0};
538
539 TRACE("%p/%p-> (%p, %p)\n", iface, This, pPropBag, pErrorLog);
540
541 V_VT(&var) = VT_I4;
542 hr = IPropertyBag_Read(pPropBag, VFWIndex, &var, pErrorLog);
543
544 if (SUCCEEDED(hr))
545 {
547
548 This->driver_info = qcap_driver_init( This->pOutputPin,
549 var.__VARIANT_NAME_1.__VARIANT_NAME_2.__VARIANT_NAME_3.ulVal );
550 if (This->driver_info)
551 {
552 pin = (VfwPinImpl *)This->pOutputPin;
553 pin->parent = This;
554 This->init = TRUE;
555 hr = S_OK;
556 }
557 else
558 hr = E_FAIL;
559 }
560
561 return hr;
562}
563
564static HRESULT WINAPI
566 BOOL fClearDirty, BOOL fSaveAllProperties )
567{
569 FIXME("%p - stub\n", This);
570 return E_NOTIMPL;
571}
572
573static const IPersistPropertyBagVtbl IPersistPropertyBag_VTable =
574{
580 PPB_Load,
582};
583
584/* IKsPropertySet interface */
586{
587 return CONTAINING_RECORD(iface, VfwPinImpl, IKsPropertySet_iface);
588}
589
590static HRESULT WINAPI KSP_QueryInterface(IKsPropertySet * iface, REFIID riid, void **ret_iface)
591{
593
594 return IPin_QueryInterface(&This->pin.pin.IPin_iface, riid, ret_iface);
595}
596
598{
600
601 return IPin_AddRef(&This->pin.pin.IPin_iface);
602}
603
605{
607
608 return IPin_Release(&This->pin.pin.IPin_iface);
609}
610
611static HRESULT WINAPI
612KSP_Set( IKsPropertySet * iface, REFGUID guidPropSet, DWORD dwPropID,
613 LPVOID pInstanceData, DWORD cbInstanceData, LPVOID pPropData,
614 DWORD cbPropData )
615{
616 FIXME("%p: stub\n", iface);
617 return E_NOTIMPL;
618}
619
620static HRESULT WINAPI
621KSP_Get( IKsPropertySet * iface, REFGUID guidPropSet, DWORD dwPropID,
622 LPVOID pInstanceData, DWORD cbInstanceData, LPVOID pPropData,
623 DWORD cbPropData, DWORD *pcbReturned )
624{
625 LPGUID pGuid;
626
627 TRACE("()\n");
628
629 if (!IsEqualIID(guidPropSet, &AMPROPSETID_Pin))
631 if (pPropData == NULL && pcbReturned == NULL)
632 return E_POINTER;
633 if (pcbReturned)
634 *pcbReturned = sizeof(GUID);
635 if (pPropData == NULL)
636 return S_OK;
637 if (cbPropData < sizeof(GUID))
638 return E_UNEXPECTED;
639 pGuid = pPropData;
640 *pGuid = PIN_CATEGORY_CAPTURE;
641 FIXME("() Not adding a pin with PIN_CATEGORY_PREVIEW\n");
642 return S_OK;
643}
644
645static HRESULT WINAPI
647 DWORD dwPropID, DWORD *pTypeSupport )
648{
649 FIXME("%p: stub\n", iface);
650 return E_NOTIMPL;
651}
652
653static const IKsPropertySetVtbl IKsPropertySet_VTable =
654{
658 KSP_Set,
659 KSP_Get,
661};
662
664{
665 return CONTAINING_RECORD(pin, VfwPinImpl, pin.pin);
666}
667
669{
671 AM_MEDIA_TYPE *vfw_pmt;
672 HRESULT hr;
673
674 if (iPosition < 0)
675 return E_INVALIDARG;
676 if (iPosition > 0)
677 return VFW_S_NO_MORE_ITEMS;
678
679 hr = qcap_driver_get_format(This->parent->driver_info, &vfw_pmt);
680 if (SUCCEEDED(hr)) {
681 CopyMediaType(pmt, vfw_pmt);
682 DeleteMediaType(vfw_pmt);
683 }
684 return hr;
685}
686
688{
689 return 1;
690}
691
693{
695
696 /* What we put here doesn't matter, the
697 driver function should override it then commit */
698 if (!ppropInputRequest->cBuffers)
699 ppropInputRequest->cBuffers = 3;
700 if (!ppropInputRequest->cbBuffer)
701 ppropInputRequest->cbBuffer = 230400;
702 if (!ppropInputRequest->cbAlign)
703 ppropInputRequest->cbAlign = 1;
704
705 return IMemAllocator_SetProperties(pAlloc, ppropInputRequest, &actual);
706}
707
709 {
710 NULL,
714 },
718};
719
720static HRESULT
722 IPin ** ppPin )
723{
724 static const WCHAR wszOutputPinName[] = { 'O','u','t','p','u','t',0 };
725 PIN_INFO piOutput;
726 HRESULT hr;
727
728 *ppPin = NULL;
729
730 piOutput.dir = PINDIR_OUTPUT;
731 piOutput.pFilter = pBaseFilter;
732 lstrcpyW(piOutput.achName, wszOutputPinName);
733
734 hr = BaseOutputPin_Construct(&VfwPin_Vtbl, sizeof(VfwPinImpl), &piOutput, &output_BaseOutputFuncTable, pCritSec, ppPin);
735
736 if (SUCCEEDED(hr))
737 {
738 VfwPinImpl *pPinImpl = (VfwPinImpl*)*ppPin;
741 }
742
743 return hr;
744}
745
746static inline VfwPinImpl *impl_from_IPin(IPin *iface)
747{
748 return CONTAINING_RECORD(iface, VfwPinImpl, pin.pin.IPin_iface);
749}
750
752{
754
755 TRACE("%s %p\n", debugstr_guid(riid), ppv);
756
757 *ppv = NULL;
759 *ppv = This;
761 *ppv = &This->IKsPropertySet_iface;
762 else if (IsEqualIID(riid, &IID_IAMStreamConfig))
763 return IUnknown_QueryInterface((IUnknown *)This->parent, riid, ppv);
764
765 if (*ppv)
766 {
767 IUnknown_AddRef((IUnknown *)(*ppv));
768 return S_OK;
769 }
770
771 FIXME("No interface for %s!\n", debugstr_guid(riid));
772 return E_NOINTERFACE;
773}
774
775static ULONG WINAPI
777{
779 ULONG refCount = InterlockedDecrement(&This->pin.pin.refCount);
780
781 TRACE("() -> new refcount: %u\n", refCount);
782
783 if (!refCount)
784 {
787 }
788 return refCount;
789}
790
791static HRESULT WINAPI
793{
795 AM_MEDIA_TYPE *pmt;
796 HRESULT hr;
797
798 hr = qcap_driver_get_format(This->parent->driver_info, &pmt);
799 if (SUCCEEDED(hr)) {
800 hr = BasePinImpl_EnumMediaTypes(iface, ppEnum);
801 DeleteMediaType(pmt);
802 }
803 TRACE("%p -- %x\n", This, hr);
804 return hr;
805}
806
807static HRESULT WINAPI
809{
810 TRACE("(%p)->(%p, %p)\n", iface, apPin, cPin);
811 return E_NOTIMPL;
812}
813
814static const IPinVtbl VfwPin_Vtbl =
815{
834};
DWORD Id
#define InterlockedDecrement
Definition: armddk.h:52
@ PINDIR_OUTPUT
Definition: axcore.idl:42
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:114
#define WARN(fmt,...)
Definition: debug.h:115
HRESULT qcap_driver_set_prop(Capture *, VideoProcAmpProperty, LONG, LONG) DECLSPEC_HIDDEN
Definition: v4l.c:957
HRESULT qcap_driver_get_format(const Capture *, AM_MEDIA_TYPE **) DECLSPEC_HIDDEN
Definition: v4l.c:939
HRESULT qcap_driver_pause(Capture *, FILTER_STATE *) DECLSPEC_HIDDEN
Definition: v4l.c:968
HRESULT qcap_driver_set_format(Capture *, AM_MEDIA_TYPE *) DECLSPEC_HIDDEN
Definition: v4l.c:934
HRESULT qcap_driver_destroy(Capture *) DECLSPEC_HIDDEN
Definition: v4l.c:929
HRESULT qcap_driver_get_prop(Capture *, VideoProcAmpProperty, LONG *, LONG *) DECLSPEC_HIDDEN
Definition: v4l.c:951
HRESULT qcap_driver_stop(Capture *, FILTER_STATE *) DECLSPEC_HIDDEN
Definition: v4l.c:973
HRESULT qcap_driver_get_prop_range(Capture *, VideoProcAmpProperty, LONG *, LONG *, LONG *, LONG *, LONG *) DECLSPEC_HIDDEN
Definition: v4l.c:944
HRESULT qcap_driver_run(Capture *, FILTER_STATE *) DECLSPEC_HIDDEN
Definition: v4l.c:963
struct _Capture Capture
Definition: capture.h:24
Capture * qcap_driver_init(IPin *, USHORT) DECLSPEC_HIDDEN
Definition: v4l.c:916
const GUID IID_IKsPropertySet
Definition: controlnode.cpp:13
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
const GUID IID_IBaseFilter
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
WCHAR OLECHAR
Definition: compat.h:2292
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
#define lstrcpyW
Definition: compat.h:749
@ VT_I4
Definition: compat.h:2298
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
static const WCHAR wszOutputPinName[]
Definition: filesource.c:38
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
Definition: axcore.idl:92
#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 debugstr_w
Definition: kernel32.h:32
if(dx< 0)
Definition: linetemp.h:194
const char * var
Definition: shader.c:5666
static void DeleteMediaType(AM_MEDIA_TYPE *pMediaType)
Definition: filtergraph.c:741
static HRESULT CopyMediaType(AM_MEDIA_TYPE *pDest, const AM_MEDIA_TYPE *pSrc)
Definition: filtergraph.c:706
#define V_VT(A)
Definition: oleauto.h:211
long LONG
Definition: pedump.c:60
const GUID IID_IPin
Definition: pincontrol.cpp:15
const GUID IID_IPersist
Definition: proxy.cpp:14
const GUID IID_ISpecifyPropertyPages
Definition: proxy.cpp:12
const GUID IID_IPersistPropertyBag
Definition: proxy.cpp:11
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
void dump_AM_MEDIA_TYPE(const AM_MEDIA_TYPE *pmt)
Definition: enummedia.c:38
DWORD ObjectRefCount(BOOL increment)
Definition: qcap_main.c:193
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
Definition: pin.c:248
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *pClock)
Definition: filter.c:101
HRESULT WINAPI BaseOutputPinImpl_EndFlush(IPin *iface)
Definition: pin.c:545
HRESULT WINAPI BasePinImpl_ConnectedTo(IPin *iface, IPin **ppPin)
Definition: pin.c:222
HRESULT WINAPI BasePinImpl_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
Definition: pin.c:338
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter *iface, CLSID *pClsid)
Definition: filter.c:77
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
Definition: filter.c:145
HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, LPWSTR *Id)
Definition: pin.c:296
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin *This, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:712
HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *pInfo)
Definition: pin.c:273
HRESULT WINAPI BaseOutputPinImpl_EndOfStream(IPin *iface)
Definition: pin.c:527
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
Definition: filter.c:54
HRESULT WINAPI BaseFilter_Destroy(BaseFilter *This)
Definition: filter.c:214
HRESULT WINAPI BaseOutputPinImpl_BeginFlush(IPin *iface)
Definition: pin.c:536
HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc)
Definition: pin.c:683
HRESULT WINAPI BaseOutputPin_Destroy(BaseOutputPin *This)
Definition: pin.c:821
HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
Definition: filter.c:87
HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO *pPinInfo, const BaseOutputPinFuncTable *pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin **ppPin)
Definition: pin.c:791
HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum)
Definition: pin.c:318
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
Definition: filter.c:159
HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin *This)
Definition: pin.c:654
HRESULT WINAPI BaseOutputPinImpl_Connect(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:405
HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo)
Definition: filter.c:178
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
Definition: filter.c:119
HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *pPinDir)
Definition: pin.c:285
HRESULT WINAPI BasePinImpl_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:311
HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
Definition: pin.c:490
HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin *iface)
Definition: pin.c:497
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
Definition: filter.c:135
HRESULT WINAPI BaseFilter_Init(BaseFilter *This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable *pBaseFuncsTable)
Definition: filter.c:196
ULONG WINAPI BasePinImpl_AddRef(IPin *iface)
Definition: pin.c:187
IBaseFilter IBaseFilter_iface
Definition: strmbase.h:163
CRITICAL_SECTION csFilter
Definition: strmbase.h:165
IUnknown * outer_unk
Definition: vfwcapture.c:62
Capture * driver_info
Definition: vfwcapture.c:64
IAMStreamConfig IAMStreamConfig_iface
Definition: vfwcapture.c:59
IUnknown IUnknown_inner
Definition: vfwcapture.c:57
BOOL init
Definition: vfwcapture.c:63
IPin * pOutputPin
Definition: vfwcapture.c:66
BaseFilter filter
Definition: vfwcapture.c:58
IAMVideoProcAmp IAMVideoProcAmp_iface
Definition: vfwcapture.c:60
IPersistPropertyBag IPersistPropertyBag_iface
Definition: vfwcapture.c:61
VfwCapture * parent
Definition: vfwcapture.c:104
BaseOutputPin pin
Definition: vfwcapture.c:102
IKsPropertySet IKsPropertySet_iface
Definition: vfwcapture.c:103
Definition: scsiwmi.h:51
Definition: regsvr.c:104
Definition: send.c:48
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
static ULONG WINAPI VfwCapture_Release(IBaseFilter *iface)
Definition: vfwcapture.c:269
static const IKsPropertySetVtbl IKsPropertySet_VTable
Definition: vfwcapture.c:653
static ULONG WINAPI AMVideoProcAmp_AddRef(IAMVideoProcAmp *iface)
Definition: vfwcapture.c:438
static HRESULT WINAPI PPB_InitNew(IPersistPropertyBag *iface)
Definition: vfwcapture.c:521
static VfwPinImpl * impl_from_IKsPropertySet(IKsPropertySet *iface)
Definition: vfwcapture.c:585
static VfwCapture * impl_from_IUnknown(IUnknown *iface)
Definition: vfwcapture.c:69
static IPin *WINAPI VfwCapture_GetPin(BaseFilter *iface, int pos)
Definition: vfwcapture.c:195
static HRESULT WINAPI VfwPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest)
Definition: vfwcapture.c:692
static HRESULT WINAPI VfwPin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum)
Definition: vfwcapture.c:792
static HRESULT WINAPI PPB_GetClassID(IPersistPropertyBag *iface, CLSID *pClassID)
Definition: vfwcapture.c:512
static HRESULT WINAPI PPB_QueryInterface(IPersistPropertyBag *iface, REFIID riid, void **ret_iface)
Definition: vfwcapture.c:490
static const IPersistPropertyBagVtbl IPersistPropertyBag_VTable
Definition: vfwcapture.c:50
IUnknown *WINAPI QCAP_createVFWCaptureFilter(IUnknown *pUnkOuter, HRESULT *phr)
Definition: vfwcapture.c:216
static HRESULT WINAPI PPB_Load(IPersistPropertyBag *iface, IPropertyBag *pPropBag, IErrorLog *pErrorLog)
Definition: vfwcapture.c:531
static const IPinVtbl VfwPin_Vtbl
Definition: vfwcapture.c:51
static HRESULT WINAPI KSP_Set(IKsPropertySet *iface, REFGUID guidPropSet, DWORD dwPropID, LPVOID pInstanceData, DWORD cbInstanceData, LPVOID pPropData, DWORD cbPropData)
Definition: vfwcapture.c:612
static ULONG WINAPI AMStreamConfig_AddRef(IAMStreamConfig *iface)
Definition: vfwcapture.c:336
static LONG WINAPI VfwCapture_GetPinCount(BaseFilter *iface)
Definition: vfwcapture.c:206
static HRESULT WINAPI AMVideoProcAmp_Set(IAMVideoProcAmp *iface, LONG Property, LONG lValue, LONG Flags)
Definition: vfwcapture.c:463
static HRESULT WINAPI VfwPin_QueryInterface(IPin *iface, REFIID riid, LPVOID *ppv)
Definition: vfwcapture.c:751
static HRESULT WINAPI VfwPin_QueryInternalConnections(IPin *iface, IPin **apPin, ULONG *cPin)
Definition: vfwcapture.c:808
static HRESULT WINAPI VfwCapture_QueryInterface(IBaseFilter *iface, REFIID riid, void **ret_iface)
Definition: vfwcapture.c:255
static HRESULT WINAPI VfwCapture_Pause(IBaseFilter *iface)
Definition: vfwcapture.c:286
static HRESULT WINAPI VfwCapture_Stop(IBaseFilter *iface)
Definition: vfwcapture.c:278
static const BaseOutputPinFuncTable output_BaseOutputFuncTable
Definition: vfwcapture.c:708
static HRESULT WINAPI AMVideoProcAmp_GetRange(IAMVideoProcAmp *iface, LONG Property, LONG *pMin, LONG *pMax, LONG *pSteppingDelta, LONG *pDefault, LONG *pCapsFlags)
Definition: vfwcapture.c:453
static HRESULT WINAPI AMStreamConfig_GetNumberOfCapabilities(IAMStreamConfig *iface, int *piCount, int *piSize)
Definition: vfwcapture.c:403
static HRESULT WINAPI AMStreamConfig_GetStreamCaps(IAMStreamConfig *iface, int iIndex, AM_MEDIA_TYPE **pmt, BYTE *pSCC)
Definition: vfwcapture.c:412
static HRESULT WINAPI AMStreamConfig_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *pmt)
Definition: vfwcapture.c:351
static ULONG WINAPI AMVideoProcAmp_Release(IAMVideoProcAmp *iface)
Definition: vfwcapture.c:445
static HRESULT WINAPI KSP_Get(IKsPropertySet *iface, REFGUID guidPropSet, DWORD dwPropID, LPVOID pInstanceData, DWORD cbInstanceData, LPVOID pPropData, DWORD cbPropData, DWORD *pcbReturned)
Definition: vfwcapture.c:621
static ULONG WINAPI unknown_inner_Release(IUnknown *iface)
Definition: vfwcapture.c:154
static VfwCapture * impl_from_IPersistPropertyBag(IPersistPropertyBag *iface)
Definition: vfwcapture.c:94
static ULONG WINAPI PPB_AddRef(IPersistPropertyBag *iface)
Definition: vfwcapture.c:497
static ULONG WINAPI AMStreamConfig_Release(IAMStreamConfig *iface)
Definition: vfwcapture.c:343
static VfwCapture * impl_from_IAMVideoProcAmp(IAMVideoProcAmp *iface)
Definition: vfwcapture.c:89
static VfwPinImpl * impl_from_IPin(IPin *iface)
Definition: vfwcapture.c:746
static const IAMStreamConfigVtbl IAMStreamConfig_VTable
Definition: vfwcapture.c:48
static ULONG WINAPI PPB_Release(IPersistPropertyBag *iface)
Definition: vfwcapture.c:504
static const IBaseFilterVtbl VfwCapture_Vtbl
Definition: vfwcapture.c:47
static HRESULT WINAPI AMStreamConfig_GetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE **pmt)
Definition: vfwcapture.c:394
static ULONG WINAPI KSP_Release(IKsPropertySet *iface)
Definition: vfwcapture.c:604
static const IUnknownVtbl unknown_inner_vtbl
Definition: vfwcapture.c:188
static const BaseFilterFuncTable BaseFuncTable
Definition: vfwcapture.c:211
static HRESULT WINAPI AMStreamConfig_QueryInterface(IAMStreamConfig *iface, REFIID riid, void **ret_iface)
Definition: vfwcapture.c:328
static HRESULT WINAPI AMVideoProcAmp_QueryInterface(IAMVideoProcAmp *iface, REFIID riid, void **ret_iface)
Definition: vfwcapture.c:430
static HRESULT VfwPin_Construct(IBaseFilter *, LPCRITICAL_SECTION, IPin **)
Definition: vfwcapture.c:721
static HRESULT WINAPI VfwCapture_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
Definition: vfwcapture.c:294
static ULONG WINAPI VfwCapture_AddRef(IBaseFilter *iface)
Definition: vfwcapture.c:262
static HRESULT WINAPI VfwCapture_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
Definition: vfwcapture.c:302
static ULONG WINAPI unknown_inner_AddRef(IUnknown *iface)
Definition: vfwcapture.c:144
static HRESULT WINAPI PPB_Save(IPersistPropertyBag *iface, IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
Definition: vfwcapture.c:565
static VfwCapture * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: vfwcapture.c:79
static VfwPinImpl * impl_from_BasePin(BasePin *pin)
Definition: vfwcapture.c:663
static ULONG WINAPI VfwPin_Release(IPin *iface)
Definition: vfwcapture.c:776
static LONG WINAPI VfwPin_GetMediaTypeVersion(BasePin *iface)
Definition: vfwcapture.c:687
static HRESULT WINAPI KSP_QueryInterface(IKsPropertySet *iface, REFIID riid, void **ret_iface)
Definition: vfwcapture.c:590
static const IAMVideoProcAmpVtbl IAMVideoProcAmp_VTable
Definition: vfwcapture.c:49
static HRESULT WINAPI AMVideoProcAmp_Get(IAMVideoProcAmp *iface, LONG Property, LONG *lValue, LONG *Flags)
Definition: vfwcapture.c:472
static HRESULT WINAPI unknown_inner_QueryInterface(IUnknown *iface, REFIID riid, void **ret_iface)
Definition: vfwcapture.c:109
static VfwCapture * impl_from_IAMStreamConfig(IAMStreamConfig *iface)
Definition: vfwcapture.c:84
static VfwCapture * impl_from_BaseFilter(BaseFilter *iface)
Definition: vfwcapture.c:74
static ULONG WINAPI KSP_AddRef(IKsPropertySet *iface)
Definition: vfwcapture.c:597
static HRESULT WINAPI KSP_QuerySupported(IKsPropertySet *iface, REFGUID guidPropSet, DWORD dwPropID, DWORD *pTypeSupport)
Definition: vfwcapture.c:646
static HRESULT WINAPI VfwPin_GetMediaType(BasePin *pin, int iPosition, AM_MEDIA_TYPE *pmt)
Definition: vfwcapture.c:668
#define VFW_E_INVALIDMEDIATYPE
Definition: vfwmsgs.h:39
#define E_PROP_SET_UNSUPPORTED
Definition: vfwmsgs.h:176
#define VFW_E_NOT_STOPPED
Definition: vfwmsgs.h:75
#define VFW_S_NO_MORE_ITEMS
Definition: vfwmsgs.h:19
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_UNEXPECTED
Definition: winerror.h:2456
#define E_POINTER
Definition: winerror.h:2365
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193