annotate loader/dshow/inputpin.c @ 17614:673a0ce6cfb6

lavc exposes the reconstructed picture, so no need to decode it again
author lorenm
date Mon, 13 Feb 2006 07:00:37 +0000
parents f5537cc95b02
children 0783dd397f74
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15166
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 9964
diff changeset
1 /*
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 9964
diff changeset
2 * Modified for use with MPlayer, detailed CVS changelog at
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 9964
diff changeset
3 * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 9964
diff changeset
4 * $Id$
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 9964
diff changeset
5 */
f5537cc95b02 Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents: 9964
diff changeset
6
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
7 #include "inputpin.h"
2069
ce45cce7f7a5 sync with avifile
arpi
parents: 1545
diff changeset
8 #include "wine/winerror.h"
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
9 #include <string.h>
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
10 #include <stdio.h>
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
11 #include <stdlib.h>
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
12
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
13 static inline int unimplemented(const char* s, void* p)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
14 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
15 Debug printf("%s(%p) called (UNIMPLEMENTED)", s, p);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
16 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
17 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
18
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
19 /***********
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
20 * EnumPins
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
21 ***********/
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
22
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
23 typedef struct
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
24 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
25 IEnumPins_vt* vt;
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
26 DECLARE_IUNKNOWN();
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
27 IPin* pin1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
28 IPin* pin2;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
29 int counter;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
30 GUID interfaces[2];
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
31 } CEnumPins;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
32
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
33 static long STDCALL CEnumPins_Next(IEnumPins* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
34 /* [in] */ unsigned long cMediaTypes,
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
35 /* [size_is][out] */ IPin** ppMediaTypes,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
36 /* [out] */ unsigned long* pcFetched)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
37 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
38 CEnumPins* pin = (CEnumPins*)This;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
39
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
40 Debug printf("CEnumPins_Next(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
41 if (!ppMediaTypes)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
42 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
43 if (!pcFetched && (cMediaTypes!=1))
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
44 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
45 if (cMediaTypes<=0)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
46 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
47
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
48 //lcounter = ((CEnumPins*)This)->counter;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
49 //lpin1 = ((CEnumPins*)This)->pin1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
50 //lpin2 = ((CEnumPins*)This)->pin2;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
51 if (((pin->counter == 2) && pin->pin2)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
52 || ((pin->counter == 1) && !pin->pin2))
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
53 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
54 if (pcFetched)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
55 *pcFetched=0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
56 return 1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
57 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
58
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
59 if (pcFetched)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
60 *pcFetched=1;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
61 if (pin->counter==0)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
62 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
63 *ppMediaTypes = pin->pin1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
64 pin->pin1->vt->AddRef((IUnknown*)pin->pin1);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
65 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
66 else
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
67 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
68 *ppMediaTypes = pin->pin2;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
69 pin->pin2->vt->AddRef((IUnknown*)pin->pin2);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
70 }
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
71 pin->counter++;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
72 if (cMediaTypes == 1)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
73 return 0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
74 return 1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
75 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
76
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
77 static long STDCALL CEnumPins_Skip(IEnumPins* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
78 /* [in] */ unsigned long cMediaTypes)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
79 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
80 Debug unimplemented("CEnumPins_Skip", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
81 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
82 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
83
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
84 static long STDCALL CEnumPins_Reset(IEnumPins* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
85 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
86 Debug printf("CEnumPins_Reset(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
87 ((CEnumPins*)This)->counter = 0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
88 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
89 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
90
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
91 static long STDCALL CEnumPins_Clone(IEnumPins* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
92 /* [out] */ IEnumPins** ppEnum)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
93 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
94 Debug unimplemented("CEnumPins_Clone", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
95 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
96 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
97
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
98 static void CEnumPins_Destroy(CEnumPins* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
99 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
100 free(This->vt);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
101 free(This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
102 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
103
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
104 IMPLEMENT_IUNKNOWN(CEnumPins)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
105
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
106 static CEnumPins* CEnumPinsCreate(IPin* p, IPin* pp)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
107 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
108 CEnumPins* This = (CEnumPins*) malloc(sizeof(CEnumPins));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
109
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
110 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
111 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
112
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
113 This->refcount = 1;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
114 This->pin1 = p;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
115 This->pin2 = pp;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
116 This->counter = 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
117
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
118 This->vt = (IEnumPins_vt*) malloc(sizeof(IEnumPins_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
119 if (!This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
120 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
121 free(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
122 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
123 }
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
124 This->vt->QueryInterface = CEnumPins_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
125 This->vt->AddRef = CEnumPins_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
126 This->vt->Release = CEnumPins_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
127 This->vt->Next = CEnumPins_Next;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
128 This->vt->Skip = CEnumPins_Skip;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
129 This->vt->Reset = CEnumPins_Reset;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
130 This->vt->Clone = CEnumPins_Clone;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
131
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
132 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
133 This->interfaces[1] = IID_IEnumPins;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
134
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
135 return This;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
136 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
137
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
138
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
139
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
140 /***********
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
141 * InputPin
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
142 ***********/
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
143
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
144 static long STDCALL CInputPin_Connect(IPin* This,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
145 /* [in] */ IPin* pReceivePin,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
146 /* [in] */ AM_MEDIA_TYPE* pmt)
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
147 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
148 Debug unimplemented("CInputPin_Connect", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
149 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
150 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
151
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
152 static long STDCALL CInputPin_ReceiveConnection(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
153 /* [in] */ IPin* pConnector,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
154 /* [in] */ const AM_MEDIA_TYPE *pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
155 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
156 Debug unimplemented("CInputPin_ReceiveConnection", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
157 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
158 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
159
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
160 static long STDCALL CInputPin_Disconnect(IPin* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
161 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
162 Debug unimplemented("CInputPin_Disconnect", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
163 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
164 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
165
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
166 static long STDCALL CInputPin_ConnectedTo(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
167 /* [out] */ IPin** pPin)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
168 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
169 Debug unimplemented("CInputPin_ConnectedTo", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
170 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
171 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
172
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
173 static long STDCALL CInputPin_ConnectionMediaType(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
174 /* [out] */ AM_MEDIA_TYPE *pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
175 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
176 Debug printf("CInputPin_ConnectionMediaType(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
177 if (!pmt)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
178 return E_INVALIDARG;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
179 *pmt=((CInputPin*)This)->type;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
180 if (pmt->cbFormat > 0)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
181 {
9964
6454a2ba2e33 CoTaskMemAlloc/Free vs malloc/free cleanup
alex
parents: 7386
diff changeset
182 pmt->pbFormat=(char *)malloc(pmt->cbFormat);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
183 memcpy(pmt->pbFormat, ((CInputPin*)This)->type.pbFormat, pmt->cbFormat);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
184 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
185 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
186 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
187
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
188 static long STDCALL CInputPin_QueryPinInfo(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
189 /* [out] */ PIN_INFO *pInfo)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
190 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
191 CBaseFilter* lparent=((CInputPin*)This)->parent;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
192 Debug printf("CInputPin_QueryPinInfo(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
193 pInfo->dir = PINDIR_OUTPUT;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
194 pInfo->pFilter = (IBaseFilter*) lparent;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
195 lparent->vt->AddRef((IUnknown*)lparent);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
196 pInfo->achName[0] = 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
197 return 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
198 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
199
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
200 static long STDCALL CInputPin_QueryDirection(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
201 /* [out] */ PIN_DIRECTION *pPinDir)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
202 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
203 *pPinDir = PINDIR_OUTPUT;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
204 Debug printf("CInputPin_QueryDirection(%p) called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
205 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
206 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
207
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
208 static long STDCALL CInputPin_QueryId(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
209 /* [out] */ unsigned short* *Id)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
210 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
211 Debug unimplemented("CInputPin_QueryId", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
212 return E_NOTIMPL;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
213 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
214
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
215 static long STDCALL CInputPin_QueryAccept(IPin* This,
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
216 /* [in] */ const AM_MEDIA_TYPE* pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
217 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
218 Debug unimplemented("CInputPin_QueryAccept", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
219 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
220 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
221
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
222 static long STDCALL CInputPin_EnumMediaTypes(IPin* This,
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
223 /* [out] */ IEnumMediaTypes** ppEnum)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
224 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
225 Debug unimplemented("CInputPin_EnumMediaTypes", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
226 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
227 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
228
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
229 static long STDCALL CInputPin_QueryInternalConnections(IPin* This,
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
230 /* [out] */ IPin** apPin,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
231 /* [out][in] */ unsigned long *nPin)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
232 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
233 Debug unimplemented("CInputPin_QueryInternalConnections", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
234 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
235 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
236
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
237 static long STDCALL CInputPin_EndOfStream(IPin * This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
238 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
239 Debug unimplemented("CInputPin_EndOfStream", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
240 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
241 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
242
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
243
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
244 static long STDCALL CInputPin_BeginFlush(IPin * This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
245 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
246 Debug unimplemented("CInputPin_BeginFlush", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
247 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
248 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
249
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
250
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
251 static long STDCALL CInputPin_EndFlush(IPin* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
252 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
253 Debug unimplemented("CInputPin_EndFlush", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
254 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
255 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
256
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
257 static long STDCALL CInputPin_NewSegment(IPin* This,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
258 /* [in] */ REFERENCE_TIME tStart,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
259 /* [in] */ REFERENCE_TIME tStop,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
260 /* [in] */ double dRate)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
261 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
262 Debug unimplemented("CInputPin_NewSegment", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
263 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
264 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
265
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
266 static void CInputPin_Destroy(CInputPin* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
267 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
268 free(This->vt);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
269 free(This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
270 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
271
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
272 IMPLEMENT_IUNKNOWN(CInputPin)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
273
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
274 CInputPin* CInputPinCreate(CBaseFilter* p, const AM_MEDIA_TYPE* amt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
275 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
276 CInputPin* This = (CInputPin*) malloc(sizeof(CInputPin));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
277
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
278 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
279 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
280
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
281 This->refcount = 1;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
282 This->parent = p;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
283 This->type = *amt;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
284
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
285 This->vt= (IPin_vt*) malloc(sizeof(IPin_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
286
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
287 if (!This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
288 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
289 free(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
290 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
291 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
292
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
293 This->vt->QueryInterface = CInputPin_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
294 This->vt->AddRef = CInputPin_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
295 This->vt->Release = CInputPin_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
296 This->vt->Connect = CInputPin_Connect;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
297 This->vt->ReceiveConnection = CInputPin_ReceiveConnection;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
298 This->vt->Disconnect = CInputPin_Disconnect;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
299 This->vt->ConnectedTo = CInputPin_ConnectedTo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
300 This->vt->ConnectionMediaType = CInputPin_ConnectionMediaType;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
301 This->vt->QueryPinInfo = CInputPin_QueryPinInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
302 This->vt->QueryDirection = CInputPin_QueryDirection;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
303 This->vt->QueryId = CInputPin_QueryId;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
304 This->vt->QueryAccept = CInputPin_QueryAccept;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
305 This->vt->EnumMediaTypes = CInputPin_EnumMediaTypes;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
306 This->vt->QueryInternalConnections = CInputPin_QueryInternalConnections;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
307 This->vt->EndOfStream = CInputPin_EndOfStream;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
308 This->vt->BeginFlush = CInputPin_BeginFlush;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
309 This->vt->EndFlush = CInputPin_EndFlush;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
310 This->vt->NewSegment = CInputPin_NewSegment;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
311
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
312 This->interfaces[0]=IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
313
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
314 return This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
315 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
316
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
317
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
318 /*************
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
319 * BaseFilter
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
320 *************/
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
321
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
322 static long STDCALL CBaseFilter_GetClassID(IBaseFilter * This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
323 /* [out] */ CLSID *pClassID)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
324 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
325 Debug unimplemented("CBaseFilter_GetClassID", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
326 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
327 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
328
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
329 static long STDCALL CBaseFilter_Stop(IBaseFilter* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
330 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
331 Debug unimplemented("CBaseFilter_Stop", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
332 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
333 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
334
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
335 static long STDCALL CBaseFilter_Pause(IBaseFilter* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
336 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
337 Debug unimplemented("CBaseFilter_Pause", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
338 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
339 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
340
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
341 static long STDCALL CBaseFilter_Run(IBaseFilter* This, REFERENCE_TIME tStart)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
342 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
343 Debug unimplemented("CBaseFilter_Run", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
344 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
345 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
346
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
347 static long STDCALL CBaseFilter_GetState(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
348 /* [in] */ unsigned long dwMilliSecsTimeout,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
349 // /* [out] */ FILTER_STATE *State)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
350 void* State)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
351 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
352 Debug unimplemented("CBaseFilter_GetState", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
353 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
354 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
355
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
356 static long STDCALL CBaseFilter_SetSyncSource(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
357 /* [in] */ IReferenceClock *pClock)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
358 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
359 Debug unimplemented("CBaseFilter_SetSyncSource", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
360 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
361 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
362
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
363 static long STDCALL CBaseFilter_GetSyncSource(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
364 /* [out] */ IReferenceClock **pClock)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
365 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
366 Debug unimplemented("CBaseFilter_GetSyncSource", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
367 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
368 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
369
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
370
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
371 static long STDCALL CBaseFilter_EnumPins(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
372 /* [out] */ IEnumPins **ppEnum)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
373 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
374 Debug printf("CBaseFilter_EnumPins(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
375 *ppEnum = (IEnumPins*) CEnumPinsCreate(((CBaseFilter*)This)->pin, ((CBaseFilter*)This)->unused_pin);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
376 return 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
377 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
378
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
379 static long STDCALL CBaseFilter_FindPin(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
380 /* [string][in] */ const unsigned short* Id,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
381 /* [out] */ IPin **ppPin)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
382 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
383 Debug unimplemented("CBaseFilter_FindPin\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
384 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
385 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
386
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
387 static long STDCALL CBaseFilter_QueryFilterInfo(IBaseFilter* This,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
388 // /* [out] */ FILTER_INFO *pInfo)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
389 void* pInfo)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
390 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
391 Debug unimplemented("CBaseFilter_QueryFilterInfo", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
392 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
393 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
394
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
395 static long STDCALL CBaseFilter_JoinFilterGraph(IBaseFilter* This,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
396 /* [in] */ IFilterGraph* pGraph,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
397 /* [string][in] */ const unsigned short* pName)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
398 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
399 Debug unimplemented("CBaseFilter_JoinFilterGraph", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
400 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
401 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
402
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
403 static long STDCALL CBaseFilter_QueryVendorInfo(IBaseFilter* This,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
404 /* [string][out] */ unsigned short** pVendorInfo)
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
405 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
406 Debug unimplemented("CBaseFilter_QueryVendorInfo", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
407 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
408 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
409
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
410 static IPin* CBaseFilter_GetPin(CBaseFilter* This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
411 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
412 return This->pin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
413 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
414
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
415 static IPin* CBaseFilter_GetUnusedPin(CBaseFilter* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
416 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
417 return This->unused_pin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
418 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
419
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
420 static void CBaseFilter_Destroy(CBaseFilter* This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
421 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
422 if (This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
423 free(This->vt);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
424 if (This->pin)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
425 This->pin->vt->Release((IUnknown*)This->pin);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
426 if (This->unused_pin)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
427 This->unused_pin->vt->Release((IUnknown*)This->unused_pin);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
428 free(This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
429 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
430
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
431 IMPLEMENT_IUNKNOWN(CBaseFilter)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
432
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
433 CBaseFilter* CBaseFilterCreate(const AM_MEDIA_TYPE* type, CBaseFilter2* parent)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
434 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
435 CBaseFilter* This = (CBaseFilter*) malloc(sizeof(CBaseFilter));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
436 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
437 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
438
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
439 This->refcount = 1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
440
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
441 This->pin = (IPin*) CInputPinCreate(This, type);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
442 This->unused_pin = (IPin*) CRemotePinCreate(This, parent->GetPin(parent));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
443
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
444 This->vt = (IBaseFilter_vt*) malloc(sizeof(IBaseFilter_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
445 if (!This->vt || !This->pin || !This->unused_pin)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
446 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
447 CBaseFilter_Destroy(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
448 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
449 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
450
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
451 This->vt->QueryInterface = CBaseFilter_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
452 This->vt->AddRef = CBaseFilter_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
453 This->vt->Release = CBaseFilter_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
454 This->vt->GetClassID = CBaseFilter_GetClassID;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
455 This->vt->Stop = CBaseFilter_Stop;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
456 This->vt->Pause = CBaseFilter_Pause;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
457 This->vt->Run = CBaseFilter_Run;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
458 This->vt->GetState = CBaseFilter_GetState;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
459 This->vt->SetSyncSource = CBaseFilter_SetSyncSource;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
460 This->vt->GetSyncSource = CBaseFilter_GetSyncSource;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
461 This->vt->EnumPins = CBaseFilter_EnumPins;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
462 This->vt->FindPin = CBaseFilter_FindPin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
463 This->vt->QueryFilterInfo = CBaseFilter_QueryFilterInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
464 This->vt->JoinFilterGraph = CBaseFilter_JoinFilterGraph;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
465 This->vt->QueryVendorInfo = CBaseFilter_QueryVendorInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
466
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
467 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
468 This->interfaces[1] = IID_IBaseFilter;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
469
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
470 This->GetPin = CBaseFilter_GetPin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
471 This->GetUnusedPin = CBaseFilter_GetUnusedPin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
472
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
473 return This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
474 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
475
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
476
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
477 /**************
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
478 * BaseFilter2
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
479 **************/
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
480
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
481
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
482 static long STDCALL CBaseFilter2_GetClassID(IBaseFilter* This,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
483 /* [out] */ CLSID* pClassID)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
484 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
485 Debug unimplemented("CBaseFilter2_GetClassID", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
486 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
487 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
488
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
489 static long STDCALL CBaseFilter2_Stop(IBaseFilter* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
490 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
491 Debug unimplemented("CBaseFilter2_Stop", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
492 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
493 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
494
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
495 static long STDCALL CBaseFilter2_Pause(IBaseFilter* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
496 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
497 Debug unimplemented("CBaseFilter2_Pause", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
498 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
499 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
500
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
501 static long STDCALL CBaseFilter2_Run(IBaseFilter* This, REFERENCE_TIME tStart)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
502 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
503 Debug unimplemented("CBaseFilter2_Run", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
504 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
505 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
506
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
507
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
508 static long STDCALL CBaseFilter2_GetState(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
509 /* [in] */ unsigned long dwMilliSecsTimeout,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
510 // /* [out] */ FILTER_STATE *State)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
511 void* State)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
512 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
513 Debug unimplemented("CBaseFilter2_GetState", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
514 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
515 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
516
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
517 static long STDCALL CBaseFilter2_SetSyncSource(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
518 /* [in] */ IReferenceClock* pClock)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
519 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
520 Debug unimplemented("CBaseFilter2_SetSyncSource", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
521 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
522 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
523
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
524 static long STDCALL CBaseFilter2_GetSyncSource(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
525 /* [out] */ IReferenceClock** pClock)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
526 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
527 Debug unimplemented("CBaseFilter2_GetSyncSource", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
528 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
529 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
530
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
531 static long STDCALL CBaseFilter2_EnumPins(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
532 /* [out] */ IEnumPins** ppEnum)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
533 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
534 Debug printf("CBaseFilter2_EnumPins(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
535 *ppEnum = (IEnumPins*) CEnumPinsCreate(((CBaseFilter2*)This)->pin, 0);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
536 return 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
537 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
538
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
539 static long STDCALL CBaseFilter2_FindPin(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
540 /* [string][in] */ const unsigned short* Id,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
541 /* [out] */ IPin** ppPin)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
542 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
543 Debug unimplemented("CBaseFilter2_FindPin", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
544 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
545 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
546
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
547 static long STDCALL CBaseFilter2_QueryFilterInfo(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
548 // /* [out] */ FILTER_INFO *pInfo)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
549 void* pInfo)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
550 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
551 Debug unimplemented("CBaseFilter2_QueryFilterInfo", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
552 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
553 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
554
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
555 static long STDCALL CBaseFilter2_JoinFilterGraph(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
556 /* [in] */ IFilterGraph* pGraph,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
557 /* [string][in] */
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
558 const unsigned short* pName)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
559 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
560 Debug unimplemented("CBaseFilter2_JoinFilterGraph", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
561 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
562 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
563
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
564 static long STDCALL CBaseFilter2_QueryVendorInfo(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
565 /* [string][out] */
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
566 unsigned short** pVendorInfo)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
567 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
568 Debug unimplemented("CBaseFilter2_QueryVendorInfo", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
569 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
570 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
571
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
572 static IPin* CBaseFilter2_GetPin(CBaseFilter2* This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
573 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
574 return This->pin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
575 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
576
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
577 static void CBaseFilter2_Destroy(CBaseFilter2* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
578 {
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
579 Debug printf("CBaseFilter2_Destroy(%p) called\n", This);
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
580 if (This->pin)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
581 This->pin->vt->Release((IUnknown*) This->pin);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
582 if (This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
583 free(This->vt);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
584 free(This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
585 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
586
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
587 IMPLEMENT_IUNKNOWN(CBaseFilter2)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
588
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
589 static GUID CBaseFilter2_interf1 =
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
590 {0x76c61a30, 0xebe1, 0x11cf, {0x89, 0xf9, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb}};
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
591 static GUID CBaseFilter2_interf2 =
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
592 {0xaae7e4e2, 0x6388, 0x11d1, {0x8d, 0x93, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2}};
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
593 static GUID CBaseFilter2_interf3 =
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
594 {0x02ef04dd, 0x7580, 0x11d1, {0xbe, 0xce, 0x00, 0xc0, 0x4f, 0xb6, 0xe9, 0x37}};
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
595
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
596 CBaseFilter2* CBaseFilter2Create()
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
597 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
598 CBaseFilter2* This = (CBaseFilter2*) malloc(sizeof(CBaseFilter2));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
599
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
600 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
601 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
602
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
603 This->refcount = 1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
604 This->pin = (IPin*) CRemotePin2Create(This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
605
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
606 This->vt = (IBaseFilter_vt*) malloc(sizeof(IBaseFilter_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
607
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
608 if (!This->pin || !This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
609 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
610 CBaseFilter2_Destroy(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
611 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
612 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
613
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
614 memset(This->vt, 0, sizeof(IBaseFilter_vt));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
615 This->vt->QueryInterface = CBaseFilter2_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
616 This->vt->AddRef = CBaseFilter2_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
617 This->vt->Release = CBaseFilter2_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
618 This->vt->GetClassID = CBaseFilter2_GetClassID;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
619 This->vt->Stop = CBaseFilter2_Stop;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
620 This->vt->Pause = CBaseFilter2_Pause;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
621 This->vt->Run = CBaseFilter2_Run;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
622 This->vt->GetState = CBaseFilter2_GetState;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
623 This->vt->SetSyncSource = CBaseFilter2_SetSyncSource;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
624 This->vt->GetSyncSource = CBaseFilter2_GetSyncSource;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
625 This->vt->EnumPins = CBaseFilter2_EnumPins;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
626 This->vt->FindPin = CBaseFilter2_FindPin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
627 This->vt->QueryFilterInfo = CBaseFilter2_QueryFilterInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
628 This->vt->JoinFilterGraph = CBaseFilter2_JoinFilterGraph;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
629 This->vt->QueryVendorInfo = CBaseFilter2_QueryVendorInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
630
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
631 This->GetPin = CBaseFilter2_GetPin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
632
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
633 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
634 This->interfaces[1] = IID_IBaseFilter;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
635 This->interfaces[2] = CBaseFilter2_interf1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
636 This->interfaces[3] = CBaseFilter2_interf2;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
637 This->interfaces[4] = CBaseFilter2_interf3;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
638
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
639 return This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
640 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
641
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
642
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
643 /*************
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
644 * CRemotePin
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
645 *************/
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
646
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
647
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
648 static long STDCALL CRemotePin_ConnectedTo(IPin* This, /* [out] */ IPin** pPin)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
649 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
650 Debug printf("CRemotePin_ConnectedTo(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
651 if (!pPin)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
652 return E_INVALIDARG;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
653 *pPin = ((CRemotePin*)This)->remote_pin;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
654 (*pPin)->vt->AddRef((IUnknown*)(*pPin));
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
655 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
656 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
657
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
658 static long STDCALL CRemotePin_QueryDirection(IPin* This,
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
659 /* [out] */ PIN_DIRECTION* pPinDir)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
660 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
661 Debug printf("CRemotePin_QueryDirection(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
662 if (!pPinDir)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
663 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
664 *pPinDir=PINDIR_INPUT;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
665 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
666 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
667
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
668 static long STDCALL CRemotePin_ConnectionMediaType(IPin* This, /* [out] */ AM_MEDIA_TYPE* pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
669 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
670 Debug unimplemented("CRemotePin_ConnectionMediaType", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
671 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
672 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
673
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
674 static long STDCALL CRemotePin_QueryPinInfo(IPin* This, /* [out] */ PIN_INFO* pInfo)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
675 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
676 CBaseFilter* lparent = ((CRemotePin*)This)->parent;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
677 Debug printf("CRemotePin_QueryPinInfo(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
678 pInfo->dir= PINDIR_INPUT;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
679 pInfo->pFilter = (IBaseFilter*) lparent;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
680 lparent->vt->AddRef((IUnknown*)lparent);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
681 pInfo->achName[0]=0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
682 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
683 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
684
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
685 static void CRemotePin_Destroy(CRemotePin* This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
686 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
687 Debug printf("CRemotePin_Destroy(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
688 free(This->vt);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
689 free(This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
690 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
691
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
692 IMPLEMENT_IUNKNOWN(CRemotePin)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
693
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
694 CRemotePin* CRemotePinCreate(CBaseFilter* pt, IPin* rpin)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
695 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
696 CRemotePin* This = (CRemotePin*) malloc(sizeof(CRemotePin));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
697
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
698 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
699 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
700
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
701 Debug printf("CRemotePinCreate() called -> %p\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
702
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
703 This->parent = pt;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
704 This->remote_pin = rpin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
705 This->refcount = 1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
706
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
707 This->vt = (IPin_vt*) malloc(sizeof(IPin_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
708
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
709 if (!This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
710 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
711 free(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
712 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
713 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
714
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
715 memset(This->vt, 0, sizeof(IPin_vt));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
716 This->vt->QueryInterface = CRemotePin_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
717 This->vt->AddRef = CRemotePin_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
718 This->vt->Release = CRemotePin_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
719 This->vt->QueryDirection = CRemotePin_QueryDirection;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
720 This->vt->ConnectedTo = CRemotePin_ConnectedTo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
721 This->vt->ConnectionMediaType = CRemotePin_ConnectionMediaType;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
722 This->vt->QueryPinInfo = CRemotePin_QueryPinInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
723
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
724 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
725
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
726 return This;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
727 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
728
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
729
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
730 /*************
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
731 * CRemotePin2
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
732 *************/
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
733
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
734
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
735 static long STDCALL CRemotePin2_QueryPinInfo(IPin* This,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
736 /* [out] */ PIN_INFO* pInfo)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
737 {
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
738 CBaseFilter2* lparent=((CRemotePin2*)This)->parent;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
739 Debug printf("CRemotePin2_QueryPinInfo(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
740 pInfo->pFilter=(IBaseFilter*)lparent;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
741 lparent->vt->AddRef((IUnknown*)lparent);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
742 pInfo->dir=PINDIR_OUTPUT;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
743 pInfo->achName[0]=0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
744 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
745 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
746
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
747 // FIXME - not being released!
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
748 static void CRemotePin2_Destroy(CRemotePin2* This)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
749 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
750 Debug printf("CRemotePin2_Destroy(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
751 free(This->vt);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
752 free(This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
753 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
754
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
755 IMPLEMENT_IUNKNOWN(CRemotePin2)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
756
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
757 CRemotePin2* CRemotePin2Create(CBaseFilter2* p)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
758 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
759 CRemotePin2* This = (CRemotePin2*) malloc(sizeof(CRemotePin2));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
760
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
761 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
762 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
763
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
764 Debug printf("CRemotePin2Create() called -> %p\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
765
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
766 This->parent = p;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
767 This->refcount = 1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
768
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
769 This->vt = (IPin_vt*) malloc(sizeof(IPin_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
770
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
771 if (!This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
772 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
773 free(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
774 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
775 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
776
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
777 memset(This->vt, 0, sizeof(IPin_vt));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
778 This->vt->QueryInterface = CRemotePin2_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
779 This->vt->AddRef = CRemotePin2_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
780 This->vt->Release = CRemotePin2_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
781 This->vt->QueryPinInfo = CRemotePin2_QueryPinInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
782
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
783 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
784
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
785 return This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
786 }