annotate loader/dshow/inputpin.c @ 35410:1c991ec0e6da

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