annotate loader/dshow/inputpin.c @ 24909:55c96e871198

10l, priv->use_psm can be 1 only if the format is genmpeg2
author nicodvb
date Fri, 02 Nov 2007 19:52:22 +0000
parents 3d1b23cf3d08
children b70f5ac9c001
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 /*
18783
0783dd397f74 CVS --> Subversion in copyright notices
diego
parents: 15166
diff changeset
2 * Modified for use with MPlayer, detailed changelog at
0783dd397f74 CVS --> Subversion in copyright notices
diego
parents: 15166
diff changeset
3 * http://svn.mplayerhq.hu/mplayer/trunk/
15166
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"
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22028
diff changeset
8 #include "mediatype.h"
2069
ce45cce7f7a5 sync with avifile
arpi
parents: 1545
diff changeset
9 #include "wine/winerror.h"
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
10 #include <string.h>
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
11 #include <stdio.h>
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
12 #include <stdlib.h>
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
13
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
14 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
15 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
16 Debug printf("%s(%p) called (UNIMPLEMENTED)", s, p);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
17 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
18 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
19
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
20 /***********
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
21 * EnumPins
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
22 ***********/
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
23
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
24 typedef struct
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
25 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
26 IEnumPins_vt* vt;
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
27 DECLARE_IUNKNOWN();
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
28 IPin* pin1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
29 IPin* pin2;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
30 int counter;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
31 GUID interfaces[2];
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
32 } CEnumPins;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
33
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
34 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
35 * \brief IEnumPins:Next (retrives a specified number of pins )
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
36 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
37 * \param[in] This pointer to CEnumPins object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
38 * \param[in] cMediaTypes number of pins to retrive
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
39 * \param[out] ppMediaTypes array of IPin interface pointers of size cMediaTypes
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
40 * \param[out] pcFetched address of variables that receives number of returned pins
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
41 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
42 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
43 * \return S_FALSE - did not return as meny pins as requested
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
44 * \return E_INVALIDARG Invalid argument
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
45 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
46 * \return VFW_E_ENUM_OUT_OF_SYNC - filter's state has changed and is now inconsistent with enumerator
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
47 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
48 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
49 static long STDCALL CEnumPins_Next(IEnumPins* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
50 /* [in] */ unsigned long cMediaTypes,
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
51 /* [size_is][out] */ IPin** ppMediaTypes,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
52 /* [out] */ unsigned long* pcFetched)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
53 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
54 CEnumPins* pin = (CEnumPins*)This;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
55
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
56 Debug printf("CEnumPins_Next(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
57 if (!ppMediaTypes)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
58 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
59 if (!pcFetched && (cMediaTypes!=1))
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
60 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
61 if (cMediaTypes<=0)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
62 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
63
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
64 //lcounter = ((CEnumPins*)This)->counter;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
65 //lpin1 = ((CEnumPins*)This)->pin1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
66 //lpin2 = ((CEnumPins*)This)->pin2;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
67 if (((pin->counter == 2) && pin->pin2)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
68 || ((pin->counter == 1) && !pin->pin2))
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
69 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
70 if (pcFetched)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
71 *pcFetched=0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
72 return 1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
73 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
74
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
75 if (pcFetched)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
76 *pcFetched=1;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
77 if (pin->counter==0)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
78 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
79 *ppMediaTypes = pin->pin1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
80 pin->pin1->vt->AddRef((IUnknown*)pin->pin1);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
81 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
82 else
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
83 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
84 *ppMediaTypes = pin->pin2;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
85 pin->pin2->vt->AddRef((IUnknown*)pin->pin2);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
86 }
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
87 pin->counter++;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
88 if (cMediaTypes == 1)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
89 return 0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
90 return 1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
91 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
92
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
93 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
94 * \brief IEnumPins::Skip (skips over a specified number of pins)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
95 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
96 * \param[in] This pointer to CEnumPinss object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
97 * \param[in] cMediaTypes number of pins to skip
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
98 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
99 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
100 * \return S_FALSE - skipped past the end of the sequence
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
101 * \return VFW_E_ENUM_OUT_OF_SYNC - filter's state has changed and is now inconsistent with enumerator
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
102 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
103 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
104 static long STDCALL CEnumPins_Skip(IEnumPins* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
105 /* [in] */ unsigned long cMediaTypes)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
106 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
107 Debug unimplemented("CEnumPins_Skip", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
108 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
109 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
110
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
111 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
112 * \brief IEnumPins::Reset (resets enumeration sequence to beginning)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
113 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
114 * \param[in] This pointer to CEnumPins object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
115 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
116 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
117 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
118 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
119 static long STDCALL CEnumPins_Reset(IEnumPins* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
120 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
121 Debug printf("CEnumPins_Reset(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
122 ((CEnumPins*)This)->counter = 0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
123 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
124 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
125
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
126 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
127 * \brief IEnumPins::Clone (makes a copy of enumerator, returned object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
128 * starts at the same position as original)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
129 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
130 * \param[in] This pointer to CEnumPins object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
131 * \param[out] ppEnum address of variable that receives pointer to IEnumPins interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
132 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
133 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
134 * \return E_OUTOFMEMRY - Insufficient memory
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
135 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
136 * \return VFW_E_ENUM_OUT_OF_SYNC - filter's state has changed and is now inconsistent with enumerator
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
137 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
138 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
139 static long STDCALL CEnumPins_Clone(IEnumPins* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
140 /* [out] */ IEnumPins** ppEnum)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
141 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
142 Debug unimplemented("CEnumPins_Clone", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
143 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
144 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
145
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
146 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
147 * \brief CEnumPins destructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
148 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
149 * \param[in] This pointer to CEnumPins object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
150 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
151 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
152 static void CEnumPins_Destroy(CEnumPins* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
153 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
154 free(This->vt);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
155 free(This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
156 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
157
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
158 IMPLEMENT_IUNKNOWN(CEnumPins)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
159
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
160 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
161 * \brief CEnumPins constructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
162 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
163 * \param[in] p first pin for enumerator
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
164 * \param[in] pp second pin for enumerator
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
165 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
166 * \return pointer to CEnumPins object or NULL if error occured
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
167 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
168 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
169 static CEnumPins* CEnumPinsCreate(IPin* p, IPin* pp)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
170 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
171 CEnumPins* This = (CEnumPins*) malloc(sizeof(CEnumPins));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
172
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
173 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
174 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
175
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
176 This->refcount = 1;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
177 This->pin1 = p;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
178 This->pin2 = pp;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
179 This->counter = 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
180
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
181 This->vt = (IEnumPins_vt*) malloc(sizeof(IEnumPins_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
182 if (!This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
183 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
184 free(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
185 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
186 }
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
187 This->vt->QueryInterface = CEnumPins_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
188 This->vt->AddRef = CEnumPins_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
189 This->vt->Release = CEnumPins_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
190 This->vt->Next = CEnumPins_Next;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
191 This->vt->Skip = CEnumPins_Skip;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
192 This->vt->Reset = CEnumPins_Reset;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
193 This->vt->Clone = CEnumPins_Clone;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
194
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
195 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
196 This->interfaces[1] = IID_IEnumPins;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
197
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
198 return This;
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
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
201
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 /***********
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
204 * InputPin
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
205 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
206 * WARNING:
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
207 * This is implementation of OUTPUT pin in DirectShow's terms
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
208 *
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
209 ***********/
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
210
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
211 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
212 * \brief IPin::Connect (connects pin to another pin)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
213 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
214 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
215 * \param[in] pReceivePin pointer to IPin interface of remote pin
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
216 * \param[in] pmt suggested media type for link. Can be NULL (any media type)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
217 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
218 * \return S_OK - success.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
219 * \return VFW_E_ALREADY_CONNECTED - pin already connected
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
220 * \return VFW_E_NOT_STOPPED - filter is active
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
221 * \return VFW_E_TYPE_NOT_ACCEPT - type is not acceptable
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
222 * \return Apropriate error code otherwise.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
223 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
224 */
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
225 static long STDCALL CInputPin_Connect(IPin* This,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
226 /* [in] */ IPin* pReceivePin,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
227 /* [in] */ AM_MEDIA_TYPE* pmt)
3056
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 Debug unimplemented("CInputPin_Connect", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
230 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
231 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
232
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
233 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
234 * \brief IPin::ReceiveConnection (accepts a connection from another pin)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
235 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
236 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
237 * \param[in] pConnector connecting pin's IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
238 * \param[in] pmt suggested media type for connection
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
239 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
240 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
241 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
242 * \return VFW_E_ALREADY_CONNECTED - pin already connected
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
243 * \return VFW_E_NOT_STOPPED - filter is active
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
244 * \return VFW_E_TYPE_NOT_ACCEPT - type is not acceptable
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
245 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
246 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
247 * When returning S_OK method should also do the following:
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
248 * - store media type and return the same type in IPin::ConnectionMediaType
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
249 * - store pConnector and return it in IPin::ConnectedTo
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
250 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
251 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
252 static long STDCALL CInputPin_ReceiveConnection(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
253 /* [in] */ IPin* pConnector,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
254 /* [in] */ const AM_MEDIA_TYPE *pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
255 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
256 Debug unimplemented("CInputPin_ReceiveConnection", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
257 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
258 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
259
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
260 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
261 * \brief IPin::Disconnect (accepts a connection from another pin)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
262 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
263 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
264 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
265 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
266 * \return S_FALSE - pin was not connected
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
267 * \return VFW_E_NOT_STOPPED - filter is active
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
268 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
269 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
270 * To break connection you have to also call Disconnect on other pin
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
271 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
272 static long STDCALL CInputPin_Disconnect(IPin* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
273 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
274 Debug unimplemented("CInputPin_Disconnect", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
275 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
276 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
277
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
278 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
279 * \brief IPin::ConnectedTo (retrieves pointer to the connected pin, if such exist)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
280 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
281 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
282 * \param[out] pPin pointer to remote pin's IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
283 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
284 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
285 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
286 * \return VFW_E_NOT_CONNECTED - pin is not connected
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
287 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
288 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
289 * Caller must call Release on received IPin, when done
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
290 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
291 static long STDCALL CInputPin_ConnectedTo(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
292 /* [out] */ IPin** pPin)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
293 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
294 Debug unimplemented("CInputPin_ConnectedTo", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
295 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
296 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
297
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
298 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
299 * \brief IPin::ConnectionMediaType (retrieves media type for connection, if such exist)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
300 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
301 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
302 * \param[out] pmt pointer to AM_MEDIA_TYPE, that receives connection media type
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
303 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
304 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
305 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
306 * \return VFW_E_NOT_CONNECTED - pin is not connected
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
307 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
308 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
309 static long STDCALL CInputPin_ConnectionMediaType(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
310 /* [out] */ AM_MEDIA_TYPE *pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
311 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
312 Debug printf("CInputPin_ConnectionMediaType(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
313 if (!pmt)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
314 return E_INVALIDARG;
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22028
diff changeset
315 CopyMediaType(pmt,&(((CInputPin*)This)->type));
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
316 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
317 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
318
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
319 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
320 * \brief IPin::QueryPinInfo (retrieves information about the pin)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
321 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
322 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
323 * \param[out] pInfo pointer to PIN_INFO structure, that receives pin info
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
324 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
325 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
326 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
327 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
328 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
329 * If pInfo->pFilter is not NULL, then caller must call Release on pInfo->pFilter when done
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
330 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
331 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
332 static long STDCALL CInputPin_QueryPinInfo(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
333 /* [out] */ PIN_INFO *pInfo)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
334 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
335 CBaseFilter* lparent=((CInputPin*)This)->parent;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
336 Debug printf("CInputPin_QueryPinInfo(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
337 pInfo->dir = PINDIR_OUTPUT;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
338 pInfo->pFilter = (IBaseFilter*) lparent;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
339 lparent->vt->AddRef((IUnknown*)lparent);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
340 pInfo->achName[0] = 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
341 return 0;
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
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
344 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
345 * \brief IPin::QueryDirection (retrieves pin direction)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
346 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
347 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
348 * \param[out] pPinDir pointer to variable, that receives pin direction (PINDIR_INPUT,PINDIR_OUTPUT)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
349 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
350 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
351 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
352 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
353 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
354 static long STDCALL CInputPin_QueryDirection(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
355 /* [out] */ PIN_DIRECTION *pPinDir)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
356 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
357 *pPinDir = PINDIR_OUTPUT;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
358 Debug printf("CInputPin_QueryDirection(%p) called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
359 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
360 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
361
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
362 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
363 * \brief IPin::QueryId (retrieves pin identificator)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
364 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
365 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
366 * \param[out] Id adress of variable, that receives string with pin's Id.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
367 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
368 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
369 * \return E_OUTOFMEMORY - Insufficient memory
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
370 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
371 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
372 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
373 * Pin's Id is not the same as pin's name
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
374 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
375 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
376 static long STDCALL CInputPin_QueryId(IPin* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
377 /* [out] */ unsigned short* *Id)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
378 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
379 Debug unimplemented("CInputPin_QueryId", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
380 return E_NOTIMPL;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
381 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
382
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
383 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
384 * \brief IPin::QueryAccept (determines can media type be accepted or not)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
385 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
386 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
387 * \param[in] pmt Media type to check
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
388 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
389 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
390 * \return S_FALSE - pin rejects media type
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
391 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
392 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
393 static long STDCALL CInputPin_QueryAccept(IPin* This,
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
394 /* [in] */ const AM_MEDIA_TYPE* pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
395 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
396 Debug unimplemented("CInputPin_QueryAccept", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
397 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
398 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
399
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
400 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
401 * \brief IPin::EnumMediaTypes (enumerates the pin's preferred media types)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
402 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
403 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
404 * \param[out] ppEnum adress of variable that receives pointer to IEnumMEdiaTypes interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
405 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
406 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
407 * \return E_OUTOFMEMORY - Insufficient memory
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
408 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
409 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
410 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
411 * Caller must call Release on received interface when done
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
412 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
413 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
414 static long STDCALL CInputPin_EnumMediaTypes(IPin* This,
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
415 /* [out] */ IEnumMediaTypes** ppEnum)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
416 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
417 Debug unimplemented("CInputPin_EnumMediaTypes", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
418 return E_NOTIMPL;
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
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
421 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
422 * \brief IPin::QueryInternalConnections (retries pin's internal connections)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
423 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
424 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
425 * \param[out] apPin Array that receives pins, internally connected to this
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
426 * \param[in,out] nPint Size of an array
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
427 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
428 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
429 * \return S_FALSE - pin rejects media type
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
430 * \return E_NOTIMPL - not implemented
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
431 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
432 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
433 static long STDCALL CInputPin_QueryInternalConnections(IPin* This,
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
434 /* [out] */ IPin** apPin,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
435 /* [out][in] */ unsigned long *nPin)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
436 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
437 Debug unimplemented("CInputPin_QueryInternalConnections", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
438 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
439 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
440
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
441 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
442 * \brief IPin::EndOfStream (notifies pin, that no data is expected, until new run command)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
443 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
444 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
445 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
446 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
447 * \return E_UNEXPECTED - The pin is output pin
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
448 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
449 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
450 * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream,
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
451 * IMemAllocator::GetBuffer runs in different (streaming) thread then other
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
452 * methods (application thread).
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
453 * IMemoryInputPin::NewSegment runs either in streaming or application thread.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
454 * Developer must use critical sections for thread-safing work.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
455 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
456 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
457 static long STDCALL CInputPin_EndOfStream(IPin * This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
458 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
459 Debug unimplemented("CInputPin_EndOfStream", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
460 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
461 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
462
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
463
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
464 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
465 * \brief IPin::BeginFlush (begins a flush operation)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
466 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
467 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
468 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
469 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
470 * \return E_UNEXPECTED - The pin is output pin
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
471 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
472 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
473 static long STDCALL CInputPin_BeginFlush(IPin * This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
474 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
475 Debug unimplemented("CInputPin_BeginFlush", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
476 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
477 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
478
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
479
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
480 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
481 * \brief IPin::EndFlush (ends a flush operation)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
482 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
483 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
484 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
485 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
486 * \return E_UNEXPECTED - The pin is output pin
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
487 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
488 */
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
489 static long STDCALL CInputPin_EndFlush(IPin* 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("CInputPin_EndFlush", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
492 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
493 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
494
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
495 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
496 * \brief IPin::NewSegment (media sample received after this call grouped as segment with common
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
497 * start,stop time and rate)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
498 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
499 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
500 * \param[in] tStart start time of new segment
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
501 * \param[in] tStop end time of new segment
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
502 * \param[in] dRate rate at wich segment should be processed
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
503 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
504 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
505 * \return E_UNEXPECTED - The pin is output pin
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
506 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
507 */
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
508 static long STDCALL CInputPin_NewSegment(IPin* This,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
509 /* [in] */ REFERENCE_TIME tStart,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
510 /* [in] */ REFERENCE_TIME tStop,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
511 /* [in] */ double dRate)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
512 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
513 Debug unimplemented("CInputPin_NewSegment", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
514 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
515 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
516
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
517 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
518 * \brief CInputPin destructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
519 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
520 * \param[in] This pointer to CInputPin class
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
521 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
522 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
523 static void CInputPin_Destroy(CInputPin* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
524 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
525 free(This->vt);
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22028
diff changeset
526 FreeMediaType(&(This->type));
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
527 free(This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
528 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
529
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
530 IMPLEMENT_IUNKNOWN(CInputPin)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
531
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
532 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
533 * \brief CInputPin constructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
534 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
535 * \param[in] amt media type for pin
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
536 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
537 * \return pointer to CInputPin if success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
538 * \return NULL if error occured
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
539 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
540 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
541 CInputPin* CInputPinCreate(CBaseFilter* p, const AM_MEDIA_TYPE* amt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
542 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
543 CInputPin* This = (CInputPin*) malloc(sizeof(CInputPin));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
544
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
545 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
546 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
547
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
548 This->refcount = 1;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
549 This->parent = p;
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22028
diff changeset
550 CopyMediaType(&(This->type),amt);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
551
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
552 This->vt= (IPin_vt*) malloc(sizeof(IPin_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
553
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
554 if (!This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
555 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
556 free(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
557 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
558 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
559
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
560 This->vt->QueryInterface = CInputPin_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
561 This->vt->AddRef = CInputPin_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
562 This->vt->Release = CInputPin_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
563 This->vt->Connect = CInputPin_Connect;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
564 This->vt->ReceiveConnection = CInputPin_ReceiveConnection;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
565 This->vt->Disconnect = CInputPin_Disconnect;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
566 This->vt->ConnectedTo = CInputPin_ConnectedTo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
567 This->vt->ConnectionMediaType = CInputPin_ConnectionMediaType;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
568 This->vt->QueryPinInfo = CInputPin_QueryPinInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
569 This->vt->QueryDirection = CInputPin_QueryDirection;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
570 This->vt->QueryId = CInputPin_QueryId;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
571 This->vt->QueryAccept = CInputPin_QueryAccept;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
572 This->vt->EnumMediaTypes = CInputPin_EnumMediaTypes;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
573 This->vt->QueryInternalConnections = CInputPin_QueryInternalConnections;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
574 This->vt->EndOfStream = CInputPin_EndOfStream;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
575 This->vt->BeginFlush = CInputPin_BeginFlush;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
576 This->vt->EndFlush = CInputPin_EndFlush;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
577 This->vt->NewSegment = CInputPin_NewSegment;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
578
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
579 This->interfaces[0]=IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
580
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
581 return This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
582 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
583
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
584
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
585 /*************
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
586 * BaseFilter
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
587 *************/
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
588
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
589 static long STDCALL CBaseFilter_GetClassID(IBaseFilter * This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
590 /* [out] */ CLSID *pClassID)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
591 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
592 Debug unimplemented("CBaseFilter_GetClassID", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
593 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
594 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
595
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
596 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
597 * \brief IMediaFilter::Stop (stops the filter)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
598 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
599 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
600 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
601 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
602 * \return S_FALSE transition is not complete
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
603 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
604 * \remarks
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
605 * When filter is stopped it does onot deliver or process any samples and rejects any samples
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
606 * from upstream filter.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
607 * Transition may be asynchronous. In this case method should return S_FALSE.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
608 * Method always sets filter's state to State_Stopped even if error occured.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
609 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
610 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
611 static long STDCALL CBaseFilter_Stop(IBaseFilter* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
612 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
613 Debug unimplemented("CBaseFilter_Stop", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
614 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
615 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
616
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
617 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
618 * \brief IMediaFilter::Pause (pauses filter)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
619 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
620 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
621 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
622 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
623 * \return S_FALSE transition is not complete
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
624 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
625 * \remarks
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
626 * When filter is paused it can receive, process and deliver samples.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
627 * Live source filters do not deliver any samples while paused.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
628 * Transition may be asynchronous. In this case method should return S_FALSE.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
629 * Method always sets filter's state to State_Stopped even if error occured.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
630 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
631 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
632 static long STDCALL CBaseFilter_Pause(IBaseFilter* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
633 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
634 Debug unimplemented("CBaseFilter_Pause", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
635 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
636 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
637
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
638 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
639 * \brief IMediaFilter::Run (runs the filter)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
640 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
641 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
642 * \param[in] tStart Reference time corresponding to stream time 0.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
643 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
644 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
645 * \return S_FALSE transition is not complete
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
646 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
647 * \remarks
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
648 * When filter is running it can receive, process and deliver samples. Source filters
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
649 * generatesnew samples, and renderers renders them.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
650 * Stream time is calculated as the current reference time minus tStart.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
651 * Graph Manager sets tStart slightly in the future according to graph latency.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
652 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
653 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
654 static long STDCALL CBaseFilter_Run(IBaseFilter* This, REFERENCE_TIME tStart)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
655 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
656 Debug unimplemented("CBaseFilter_Run", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
657 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
658 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
659
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
660 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
661 * \brief IMediaFilter::GetState (retrieves the filter's state (running, stopped or paused))
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
662 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
663 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
664 * \param[in] dwMilliSecsTimeout Timeout interval in milliseconds. To block indifinitely pass
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
665 * INFINITE.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
666 * \param[out] State pointer to variable that receives a member of FILTER_STATE enumeration.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
667 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
668 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
669 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
670 * \return VFW_S_STATE_INTERMEDATE Intermediate state
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
671 * \return VFW_S_CANT_CUE The filter is active, but cannot deliver data.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
672 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
673 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
674 static long STDCALL CBaseFilter_GetState(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
675 /* [in] */ unsigned long dwMilliSecsTimeout,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
676 // /* [out] */ FILTER_STATE *State)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
677 void* State)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
678 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
679 Debug unimplemented("CBaseFilter_GetState", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
680 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
681 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
682
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
683 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
684 * \brief IMediaFilter::SetSyncSource (sets the reference clock)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
685 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
686 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
687 * \param[in] pClock IReferenceClock interface of reference clock
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
688 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
689 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
690 * \return apripriate error otherwise
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
691 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
692 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
693 static long STDCALL CBaseFilter_SetSyncSource(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
694 /* [in] */ IReferenceClock *pClock)
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 Debug unimplemented("CBaseFilter_SetSyncSource", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
697 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
698 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
699
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
700 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
701 * \brief IMediafilter::GetSyncSource (gets current reference clock)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
702 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
703 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
704 * \param[out] pClock address of variable that receives pointer to clock's
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
705 * IReferenceClock interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
706 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
707 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
708 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
709 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
710 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
711 static long STDCALL CBaseFilter_GetSyncSource(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
712 /* [out] */ IReferenceClock **pClock)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
713 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
714 Debug unimplemented("CBaseFilter_GetSyncSource", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
715 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
716 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
717
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
718
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
719 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
720 * \brief IBaseFilter::EnumPins (enumerates the pins of this filter)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
721 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
722 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
723 * \param[out] ppEnum address of variable that receives pointer to IEnumPins interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
724 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
725 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
726 * \return E_OUTOFMEMORY Insufficient memory
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
727 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
728 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
729 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
730 static long STDCALL CBaseFilter_EnumPins(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
731 /* [out] */ IEnumPins **ppEnum)
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 Debug printf("CBaseFilter_EnumPins(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
734 *ppEnum = (IEnumPins*) CEnumPinsCreate(((CBaseFilter*)This)->pin, ((CBaseFilter*)This)->unused_pin);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
735 return 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
736 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
737
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
738 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
739 * \brief IBaseFilter::FindPin (retrieves the pin with specified id)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
740 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
741 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
742 * \param[in] Id constant wide string, containing pin id
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
743 * \param[out] ppPin address of variable that receives pointer to pin's IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
744 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
745 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
746 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
747 * \return VFW_E_NOT_FOUND Could not find a pin with specified id
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
748 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
749 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
750 * Be sure to release the interface after use.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
751 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
752 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
753 static long STDCALL CBaseFilter_FindPin(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
754 /* [string][in] */ const unsigned short* Id,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
755 /* [out] */ IPin **ppPin)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
756 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
757 Debug unimplemented("CBaseFilter_FindPin\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
758 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
759 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
760
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
761 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
762 * \brief IBaseFilter::QueryFilterInfo (retrieves information aboud the filter)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
763 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
764 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
765 * \param[out] pInfo pointer to FILTER_INFO structure
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
766 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
767 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
768 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
769 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
770 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
771 * If pGraph member of FILTER_INFO is not NULL, be sure to release IFilterGraph interface after use.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
772 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
773 */
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
774 static long STDCALL CBaseFilter_QueryFilterInfo(IBaseFilter* This,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
775 // /* [out] */ FILTER_INFO *pInfo)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
776 void* pInfo)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
777 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
778 Debug unimplemented("CBaseFilter_QueryFilterInfo", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
779 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
780 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
781
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
782 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
783 * \brief IBaseFilter::JoinFilterGraph (notifies the filter that it has joined of left filter graph)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
784 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
785 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
786 * \param[in] pInfo pointer to graph's IFilterGraph interface or NULL if filter is leaving graph
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
787 * \param[in] pName pointer to wide character string that specifies a name for the filter
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
788 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
789 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
790 * \return apropriate error code otherwise
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
791 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
792 * \remarks
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
793 * Filter should not call to graph's AddRef method.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
794 * The IFilterGraph is guaranteed to be valid until graph manager calls this method again with
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
795 * the value NULL.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
796 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
797 */
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
798 static long STDCALL CBaseFilter_JoinFilterGraph(IBaseFilter* This,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
799 /* [in] */ IFilterGraph* pGraph,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
800 /* [string][in] */ const unsigned short* pName)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
801 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
802 Debug unimplemented("CBaseFilter_JoinFilterGraph", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
803 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
804 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
805
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
806 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
807 * \brief IBaseFilter::QueryVendorInfo (retrieves a string containing vendor info)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
808 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
809 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
810 * \param[out] address of variable that receives pointer to a string containing vendor info
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
811 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
812 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
813 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
814 * \return E_NOTIMPL Not implemented
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
815 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
816 * \remarks
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
817 * Call to CoTaskMemFree to free memory allocated for string
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
818 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
819 */
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
820 static long STDCALL CBaseFilter_QueryVendorInfo(IBaseFilter* This,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
821 /* [string][out] */ unsigned short** pVendorInfo)
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
822 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
823 Debug unimplemented("CBaseFilter_QueryVendorInfo", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
824 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
825 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
826
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
827 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
828 * \brief CBaseFilter::GetPin (gets used pin)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
829 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
830 * \param[in] This pointer to CBaseFilter object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
831 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
832 * \return pointer to used pin's IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
833 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
834 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
835 static IPin* CBaseFilter_GetPin(CBaseFilter* This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
836 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
837 return This->pin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
838 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
839
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
840 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
841 * \brief CBaseFilter::GetUnusedPin (gets used pin)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
842 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
843 * \param[in] This pointer to CBaseFilter object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
844 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
845 * \return pointer to unused pin's IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
846 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
847 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
848 static IPin* CBaseFilter_GetUnusedPin(CBaseFilter* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
849 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
850 return This->unused_pin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
851 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
852
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
853 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
854 * \brief CBaseFilter destructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
855 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
856 * \param[in] This pointer to CBaseFilter object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
857 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
858 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
859 static void CBaseFilter_Destroy(CBaseFilter* This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
860 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
861 if (This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
862 free(This->vt);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
863 if (This->pin)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
864 This->pin->vt->Release((IUnknown*)This->pin);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
865 if (This->unused_pin)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
866 This->unused_pin->vt->Release((IUnknown*)This->unused_pin);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
867 free(This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
868 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
869
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
870 IMPLEMENT_IUNKNOWN(CBaseFilter)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
871
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
872 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
873 * \brief CBaseFilter constructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
874 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
875 * \param[in] type Pointer to media type for connection
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
876 * \param[in] parent Pointer to parent CBaseFilter2 object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
877 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
878 * \return pointer to CBaseFilter object or NULL if error occured
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
879 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
880 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
881 CBaseFilter* CBaseFilterCreate(const AM_MEDIA_TYPE* type, CBaseFilter2* parent)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
882 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
883 CBaseFilter* This = (CBaseFilter*) malloc(sizeof(CBaseFilter));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
884 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
885 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
886
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
887 This->refcount = 1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
888
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
889 This->pin = (IPin*) CInputPinCreate(This, type);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
890 This->unused_pin = (IPin*) CRemotePinCreate(This, parent->GetPin(parent));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
891
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
892 This->vt = (IBaseFilter_vt*) malloc(sizeof(IBaseFilter_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
893 if (!This->vt || !This->pin || !This->unused_pin)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
894 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
895 CBaseFilter_Destroy(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
896 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
897 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
898
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
899 This->vt->QueryInterface = CBaseFilter_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
900 This->vt->AddRef = CBaseFilter_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
901 This->vt->Release = CBaseFilter_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
902 This->vt->GetClassID = CBaseFilter_GetClassID;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
903 This->vt->Stop = CBaseFilter_Stop;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
904 This->vt->Pause = CBaseFilter_Pause;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
905 This->vt->Run = CBaseFilter_Run;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
906 This->vt->GetState = CBaseFilter_GetState;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
907 This->vt->SetSyncSource = CBaseFilter_SetSyncSource;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
908 This->vt->GetSyncSource = CBaseFilter_GetSyncSource;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
909 This->vt->EnumPins = CBaseFilter_EnumPins;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
910 This->vt->FindPin = CBaseFilter_FindPin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
911 This->vt->QueryFilterInfo = CBaseFilter_QueryFilterInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
912 This->vt->JoinFilterGraph = CBaseFilter_JoinFilterGraph;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
913 This->vt->QueryVendorInfo = CBaseFilter_QueryVendorInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
914
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
915 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
916 This->interfaces[1] = IID_IBaseFilter;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
917
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
918 This->GetPin = CBaseFilter_GetPin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
919 This->GetUnusedPin = CBaseFilter_GetUnusedPin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
920
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
921 return This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
922 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
923
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
924
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
925 /**************
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
926 * BaseFilter2
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
927 **************/
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
928
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
929
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
930 static long STDCALL CBaseFilter2_GetClassID(IBaseFilter* This,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
931 /* [out] */ CLSID* pClassID)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
932 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
933 Debug unimplemented("CBaseFilter2_GetClassID", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
934 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
935 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
936
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
937 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
938 * \brief IMediaFilter::Stop (stops the filter)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
939 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
940 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
941 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
942 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
943 * \return S_FALSE transition is not complete
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
944 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
945 * \remarks
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
946 * When filter is stopped it does onot deliver or process any samples and rejects any samples
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
947 * from upstream filter.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
948 * Transition may be asynchronous. In this case method should return S_FALSE.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
949 * Method always sets filter's state to State_Stopped even if error occured.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
950 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
951 */
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
952 static long STDCALL CBaseFilter2_Stop(IBaseFilter* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
953 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
954 Debug unimplemented("CBaseFilter2_Stop", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
955 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
956 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
957
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
958 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
959 * \brief IMediaFilter::Pause (pauses filter)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
960 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
961 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
962 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
963 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
964 * \return S_FALSE transition is not complete
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
965 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
966 * \remarks
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
967 * When filter is paused it can receive, process and deliver samples.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
968 * Live source filters do not deliver any samples while paused.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
969 * Transition may be asynchronous. In this case method should return S_FALSE.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
970 * Method always sets filter's state to State_Stopped even if error occured.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
971 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
972 */
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
973 static long STDCALL CBaseFilter2_Pause(IBaseFilter* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
974 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
975 Debug unimplemented("CBaseFilter2_Pause", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
976 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
977 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
978
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
979 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
980 * \brief IMediaFilter::Run (runs the filter)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
981 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
982 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
983 * \param[in] tStart Reference time corresponding to stream time 0.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
984 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
985 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
986 * \return S_FALSE transition is not complete
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
987 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
988 * \remarks
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
989 * When filter is running it can receive, process and deliver samples. Source filters
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
990 * generatesnew samples, and renderers renders them.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
991 * Stream time is calculated as the current reference time minus tStart.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
992 * Graph Manager sets tStart slightly in the future according to graph latency.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
993 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
994 */
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
995 static long STDCALL CBaseFilter2_Run(IBaseFilter* This, REFERENCE_TIME tStart)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
996 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
997 Debug unimplemented("CBaseFilter2_Run", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
998 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
999 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1000
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1001
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1002 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1003 * \brief IMediaFilter::GetState (retrieves the filter's state (running, stopped or paused))
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1004 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1005 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1006 * \param[in] dwMilliSecsTimeout Timeout interval in milliseconds. To block indifinitely pass
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1007 * INFINITE.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1008 * \param[out] State pointer to variable that receives a member of FILTER_STATE enumeration.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1009 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1010 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1011 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1012 * \return VFW_S_STATE_INTERMEDATE Intermediate state
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1013 * \return VFW_S_CANT_CUE The filter is active, but cannot deliver data.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1014 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1015 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1016 static long STDCALL CBaseFilter2_GetState(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1017 /* [in] */ unsigned long dwMilliSecsTimeout,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1018 // /* [out] */ FILTER_STATE *State)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1019 void* State)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1020 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1021 Debug unimplemented("CBaseFilter2_GetState", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1022 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1023 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1024
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1025 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1026 * \brief IMediaFilter::SetSyncSource (sets the reference clock)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1027 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1028 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1029 * \param[in] pClock IReferenceClock interface of reference clock
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1030 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1031 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1032 * \return apripriate error otherwise
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1033 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1034 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1035 static long STDCALL CBaseFilter2_SetSyncSource(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1036 /* [in] */ IReferenceClock* pClock)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1037 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1038 Debug unimplemented("CBaseFilter2_SetSyncSource", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1039 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1040 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1041
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1042 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1043 * \brief IMediafilter::GetSyncSource (gets current reference clock)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1044 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1045 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1046 * \param[out] pClock address of variable that receives pointer to clock's
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1047 * IReferenceClock interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1048 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1049 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1050 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1051 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1052 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1053 static long STDCALL CBaseFilter2_GetSyncSource(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1054 /* [out] */ IReferenceClock** pClock)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1055 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1056 Debug unimplemented("CBaseFilter2_GetSyncSource", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1057 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1058 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1059
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1060 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1061 * \brief IBaseFilter::EnumPins (enumerates the pins of this filter)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1062 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1063 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1064 * \param[out] ppEnum address of variable that receives pointer to IEnumPins interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1065 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1066 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1067 * \return E_OUTOFMEMORY Insufficient memory
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1068 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1069 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1070 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1071 static long STDCALL CBaseFilter2_EnumPins(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1072 /* [out] */ IEnumPins** ppEnum)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1073 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1074 Debug printf("CBaseFilter2_EnumPins(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1075 *ppEnum = (IEnumPins*) CEnumPinsCreate(((CBaseFilter2*)This)->pin, 0);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1076 return 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1077 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1078
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1079 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1080 * \brief IBaseFilter::FindPin (retrieves the pin with specified id)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1081 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1082 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1083 * \param[in] Id constant wide string, containing pin id
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1084 * \param[out] ppPin address of variable that receives pointer to pin's IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1085 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1086 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1087 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1088 * \return VFW_E_NOT_FOUND Could not find a pin with specified id
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1089 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1090 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1091 * Be sure to release the interface after use.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1092 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1093 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1094 static long STDCALL CBaseFilter2_FindPin(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1095 /* [string][in] */ const unsigned short* Id,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1096 /* [out] */ IPin** ppPin)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1097 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1098 Debug unimplemented("CBaseFilter2_FindPin", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1099 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1100 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1101
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1102 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1103 * \brief IBaseFilter::QueryFilterInfo (retrieves information aboud the filter)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1104 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1105 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1106 * \param[out] pInfo pointer to FILTER_INFO structure
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1107 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1108 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1109 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1110 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1111 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1112 * If pGraph member of FILTER_INFO is not NULL, be sure to release IFilterGraph interface after use.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1113 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1114 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1115 static long STDCALL CBaseFilter2_QueryFilterInfo(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1116 // /* [out] */ FILTER_INFO *pInfo)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1117 void* pInfo)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1118 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1119 Debug unimplemented("CBaseFilter2_QueryFilterInfo", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1120 return E_NOTIMPL;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1121 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1122
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1123 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1124 * \brief IBaseFilter::JoinFilterGraph (notifies the filter that it has joined of left filter graph)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1125 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1126 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1127 * \param[in] pInfo pointer to graph's IFilterGraph interface or NULL if filter is leaving graph
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1128 * \param[in] pName pointer to wide character string that specifies a name for the filter
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1129 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1130 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1131 * \return apropriate error code otherwise
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1132 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1133 * \remarks
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1134 * Filter should not call to graph's AddRef method.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1135 * The IFilterGraph is guaranteed to be valid until graph manager calls this method again with
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1136 * the value NULL.
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1137 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1138 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1139 static long STDCALL CBaseFilter2_JoinFilterGraph(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1140 /* [in] */ IFilterGraph* pGraph,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1141 /* [string][in] */
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1142 const unsigned short* pName)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1143 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1144 Debug unimplemented("CBaseFilter2_JoinFilterGraph", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1145 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1146 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1147
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1148 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1149 * \brief IBaseFilter::QueryVendorInfo (retrieves a string containing vendor info)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1150 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1151 * \param[in] This pointer to IBaseFilter interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1152 * \param[out] address of variable that receives pointer to a string containing vendor info
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1153 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1154 * \return S_OK success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1155 * \return E_POINTER Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1156 * \return E_NOTIMPL Not implemented
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1157 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1158 * \remarks
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1159 * Call to CoTaskMemFree to free memory allocated for string
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1160 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1161 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1162 static long STDCALL CBaseFilter2_QueryVendorInfo(IBaseFilter* This,
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1163 /* [string][out] */
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1164 unsigned short** pVendorInfo)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1165 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1166 Debug unimplemented("CBaseFilter2_QueryVendorInfo", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1167 return E_NOTIMPL;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1168 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1169
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1170 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1171 * \brief CBaseFilter2::GetPin (gets used pin)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1172 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1173 * \param[in] This pointer to CBaseFilter2 object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1174 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1175 * \return pointer to used pin's IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1176 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1177 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1178 static IPin* CBaseFilter2_GetPin(CBaseFilter2* This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1179 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1180 return This->pin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1181 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1182
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1183 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1184 * \brief CBaseFilter2 destructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1185 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1186 * \param[in] This pointer to CBaseFilter2 object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1187 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1188 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1189 static void CBaseFilter2_Destroy(CBaseFilter2* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1190 {
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
1191 Debug printf("CBaseFilter2_Destroy(%p) called\n", This);
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1192 if (This->pin)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1193 This->pin->vt->Release((IUnknown*) This->pin);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1194 if (This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1195 free(This->vt);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1196 free(This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1197 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1198
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1199 IMPLEMENT_IUNKNOWN(CBaseFilter2)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1200
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1201 static GUID CBaseFilter2_interf1 =
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1202 {0x76c61a30, 0xebe1, 0x11cf, {0x89, 0xf9, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb}};
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1203 /// IID_IAMNetShowPreroll
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1204 static GUID CBaseFilter2_interf2 =
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1205 {0xaae7e4e2, 0x6388, 0x11d1, {0x8d, 0x93, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2}};
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1206 /// IID_IAMRebuild
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1207 static GUID CBaseFilter2_interf3 =
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1208 {0x02ef04dd, 0x7580, 0x11d1, {0xbe, 0xce, 0x00, 0xc0, 0x4f, 0xb6, 0xe9, 0x37}};
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1209
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1210 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1211 * \brief CBaseFilter2 constructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1212 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1213 * \return pointer to CBaseFilter2 object or NULL if error occured
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1214 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1215 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1216 CBaseFilter2* CBaseFilter2Create()
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1217 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1218 CBaseFilter2* This = (CBaseFilter2*) malloc(sizeof(CBaseFilter2));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1219
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1220 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1221 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1222
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1223 This->refcount = 1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1224 This->pin = (IPin*) CRemotePin2Create(This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1225
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1226 This->vt = (IBaseFilter_vt*) malloc(sizeof(IBaseFilter_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1227
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1228 if (!This->pin || !This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1229 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1230 CBaseFilter2_Destroy(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1231 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1232 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1233
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1234 memset(This->vt, 0, sizeof(IBaseFilter_vt));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1235 This->vt->QueryInterface = CBaseFilter2_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1236 This->vt->AddRef = CBaseFilter2_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1237 This->vt->Release = CBaseFilter2_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1238 This->vt->GetClassID = CBaseFilter2_GetClassID;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1239 This->vt->Stop = CBaseFilter2_Stop;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1240 This->vt->Pause = CBaseFilter2_Pause;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1241 This->vt->Run = CBaseFilter2_Run;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1242 This->vt->GetState = CBaseFilter2_GetState;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1243 This->vt->SetSyncSource = CBaseFilter2_SetSyncSource;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1244 This->vt->GetSyncSource = CBaseFilter2_GetSyncSource;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1245 This->vt->EnumPins = CBaseFilter2_EnumPins;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1246 This->vt->FindPin = CBaseFilter2_FindPin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1247 This->vt->QueryFilterInfo = CBaseFilter2_QueryFilterInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1248 This->vt->JoinFilterGraph = CBaseFilter2_JoinFilterGraph;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1249 This->vt->QueryVendorInfo = CBaseFilter2_QueryVendorInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1250
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1251 This->GetPin = CBaseFilter2_GetPin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1252
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1253 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1254 This->interfaces[1] = IID_IBaseFilter;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1255 This->interfaces[2] = CBaseFilter2_interf1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1256 This->interfaces[3] = CBaseFilter2_interf2;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1257 This->interfaces[4] = CBaseFilter2_interf3;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1258
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1259 return This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1260 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1261
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1262
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1263 /*************
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1264 * CRemotePin
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1265 *************/
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1266
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1267
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1268 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1269 * \brief IPin::ConnectedTo (retrieves pointer to the connected pin, if such exist)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1270 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1271 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1272 * \param[out] pPin pointer to remote pin's IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1273 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1274 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1275 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1276 * \return VFW_E_NOT_CONNECTED - pin is not connected
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1277 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1278 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1279 * Caller must call Release on received IPin, when done
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1280 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1281 static long STDCALL CRemotePin_ConnectedTo(IPin* This, /* [out] */ IPin** pPin)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1282 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1283 Debug printf("CRemotePin_ConnectedTo(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1284 if (!pPin)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1285 return E_INVALIDARG;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1286 *pPin = ((CRemotePin*)This)->remote_pin;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1287 (*pPin)->vt->AddRef((IUnknown*)(*pPin));
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1288 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1289 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1290
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1291 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1292 * \brief IPin::QueryDirection (retrieves pin direction)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1293 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1294 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1295 * \param[out] pPinDir pointer to variable, that receives pin direction (PINDIR_INPUT,PINDIR_OUTPUT)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1296 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1297 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1298 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1299 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1300 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1301 static long STDCALL CRemotePin_QueryDirection(IPin* This,
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
1302 /* [out] */ PIN_DIRECTION* pPinDir)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1303 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1304 Debug printf("CRemotePin_QueryDirection(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1305 if (!pPinDir)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1306 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1307 *pPinDir=PINDIR_INPUT;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1308 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1309 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1310
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1311 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1312 * \brief IPin::ConnectionMediaType (retrieves media type for connection, if such exist)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1313 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1314 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1315 * \param[out] pmt pointer to AM_MEDIA_TYPE, that receives connection media type
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1316 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1317 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1318 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1319 * \return VFW_E_NOT_CONNECTED - pin is not connected
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1320 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1321 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1322 static long STDCALL CRemotePin_ConnectionMediaType(IPin* This, /* [out] */ AM_MEDIA_TYPE* pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1323 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1324 Debug unimplemented("CRemotePin_ConnectionMediaType", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1325 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1326 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1327
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1328 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1329 * \brief IPin::QueryPinInfo (retrieves information about the pin)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1330 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1331 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1332 * \param[out] pInfo pointer to PIN_INFO structure, that receives pin info
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1333 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1334 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1335 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1336 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1337 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1338 * If pInfo->pFilter is not NULL, then caller must call Release on pInfo->pFilter when done
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1339 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1340 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1341 static long STDCALL CRemotePin_QueryPinInfo(IPin* This, /* [out] */ PIN_INFO* pInfo)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1342 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1343 CBaseFilter* lparent = ((CRemotePin*)This)->parent;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1344 Debug printf("CRemotePin_QueryPinInfo(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1345 pInfo->dir= PINDIR_INPUT;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1346 pInfo->pFilter = (IBaseFilter*) lparent;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1347 lparent->vt->AddRef((IUnknown*)lparent);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1348 pInfo->achName[0]=0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1349 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1350 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1351
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1352 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1353 * \brief CRemotePin destructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1354 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1355 * \param[in] This pointer to CRemotePin object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1356 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1357 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1358 static void CRemotePin_Destroy(CRemotePin* This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1359 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1360 Debug printf("CRemotePin_Destroy(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1361 free(This->vt);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1362 free(This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1363 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1364
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1365 IMPLEMENT_IUNKNOWN(CRemotePin)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1366
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1367 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1368 * \brief CRemotePin constructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1369 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1370 * \param[in] pt parent filter
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1371 * \param[in] rpin remote pin
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1372 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1373 * \return pointer to CRemotePin or NULL if error occured
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1374 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1375 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1376 CRemotePin* CRemotePinCreate(CBaseFilter* pt, IPin* rpin)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1377 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1378 CRemotePin* This = (CRemotePin*) malloc(sizeof(CRemotePin));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1379
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1380 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1381 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1382
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1383 Debug printf("CRemotePinCreate() called -> %p\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1384
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1385 This->parent = pt;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1386 This->remote_pin = rpin;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1387 This->refcount = 1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1388
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1389 This->vt = (IPin_vt*) malloc(sizeof(IPin_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1390
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1391 if (!This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1392 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1393 free(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1394 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1395 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1396
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1397 memset(This->vt, 0, sizeof(IPin_vt));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1398 This->vt->QueryInterface = CRemotePin_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1399 This->vt->AddRef = CRemotePin_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1400 This->vt->Release = CRemotePin_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1401 This->vt->QueryDirection = CRemotePin_QueryDirection;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1402 This->vt->ConnectedTo = CRemotePin_ConnectedTo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1403 This->vt->ConnectionMediaType = CRemotePin_ConnectionMediaType;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1404 This->vt->QueryPinInfo = CRemotePin_QueryPinInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1405
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1406 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1407
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1408 return This;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1409 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1410
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1411
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1412 /*************
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
1413 * CRemotePin2
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1414 *************/
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1415
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1416
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1417 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1418 * \brief IPin::QueryPinInfo (retrieves information about the pin)
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1419 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1420 * \param[in] This pointer to IPin interface
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1421 * \param[out] pInfo pointer to PIN_INFO structure, that receives pin info
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1422 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1423 * \return S_OK - success
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1424 * \return E_POINTER - Null pointer
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1425 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1426 * \note
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1427 * If pInfo->pFilter is not NULL, then caller must call Release on pInfo->pFilter when done
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1428 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1429 */
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
1430 static long STDCALL CRemotePin2_QueryPinInfo(IPin* This,
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
1431 /* [out] */ PIN_INFO* pInfo)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1432 {
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1433 CBaseFilter2* lparent=((CRemotePin2*)This)->parent;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1434 Debug printf("CRemotePin2_QueryPinInfo(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1435 pInfo->pFilter=(IBaseFilter*)lparent;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1436 lparent->vt->AddRef((IUnknown*)lparent);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1437 pInfo->dir=PINDIR_OUTPUT;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1438 pInfo->achName[0]=0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1439 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1440 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1441
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1442 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1443 * \brief CremotePin2 destructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1444 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1445 * \param This pointer to CRemotePin2 object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1446 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1447 * FIXME - not being released!
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1448 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1449 static void CRemotePin2_Destroy(CRemotePin2* This)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1450 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1451 Debug printf("CRemotePin2_Destroy(%p) called\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1452 free(This->vt);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1453 free(This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1454 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1455
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1456 IMPLEMENT_IUNKNOWN(CRemotePin2)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1457
22028
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1458 /**
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1459 * \brief CRemotePin2 contructor
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1460 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1461 * \param[in] p pointer to parent CBaseFilter2 object
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1462 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1463 * \return pointer to CRemotePin2 object or NULL if error occured
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1464 *
24dc4ec0d08d Doxygen comments for used DirectShow methods.
voroshil
parents: 18878
diff changeset
1465 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1466 CRemotePin2* CRemotePin2Create(CBaseFilter2* p)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1467 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1468 CRemotePin2* This = (CRemotePin2*) malloc(sizeof(CRemotePin2));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1469
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1470 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1471 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1472
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1473 Debug printf("CRemotePin2Create() called -> %p\n", This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1474
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1475 This->parent = p;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1476 This->refcount = 1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1477
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1478 This->vt = (IPin_vt*) malloc(sizeof(IPin_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1479
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1480 if (!This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1481 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1482 free(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1483 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1484 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
1485
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1486 memset(This->vt, 0, sizeof(IPin_vt));
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1487 This->vt->QueryInterface = CRemotePin2_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1488 This->vt->AddRef = CRemotePin2_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1489 This->vt->Release = CRemotePin2_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1490 This->vt->QueryPinInfo = CRemotePin2_QueryPinInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1491
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1492 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1493
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2069
diff changeset
1494 return This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 168
diff changeset
1495 }