annotate loader/dshow/outputpin.c @ 31511:13ca93203358

Factorize MPlayer/MEncoder version string handling. The string now resides in a central object file instead of being duplicated in every file that requires a version string.
author diego
date Mon, 28 Jun 2010 08:26:14 +0000
parents 008338d7679f
children 8fa2f43cb760
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 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
5
30170
008338d7679f Drop -Iloader from CPPFLAGS for the loader subdirectory.
diego
parents: 29263
diff changeset
6 #include "loader/wine/winerror.h"
008338d7679f Drop -Iloader from CPPFLAGS for the loader subdirectory.
diego
parents: 29263
diff changeset
7 #include "loader/wine/windef.h"
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
8 #include "outputpin.h"
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22017
diff changeset
9 #include "mediatype.h"
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
10 #include <stdio.h>
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
11 #include <string.h>
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
12 #include <stdlib.h>
713
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
13
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
14 static inline int output_unimplemented(const char* s, void* p)
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
15 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
16 Debug printf("%s(%p) called (UNIMPLEMENTED)", s, p);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
17 return E_NOTIMPL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
18 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
19
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
20 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
21 An object beyond interface IEnumMediaTypes.
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
22 Returned by COutputPin through call IPin::EnumMediaTypes().
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
23 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
24 typedef struct CEnumMediaTypes
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
25 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
26 IEnumMediaTypes_vt* vt;
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
27 DECLARE_IUNKNOWN();
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
28 AM_MEDIA_TYPE type;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
29 GUID interfaces[2];
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
30 } CEnumMediaTypes;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
31
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
32 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
33 IMemOutput interface implementation
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
34 */
25794
2c8cdb9123b8 Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents: 25774
diff changeset
35 struct COutputMemPin
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
36 {
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
37 IMemInputPin_vt* vt;
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
38 DECLARE_IUNKNOWN();
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
39 char** frame_pointer;
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
40 long* frame_size_pointer;
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
41 MemAllocator* pAllocator;
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
42 COutputPin* parent;
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
43 };
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
44
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
45 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
46 * \brief IEnumMediaTypes:Next (retrives a specified number of media types )
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
47 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
48 * \param[in] This pointer to CEnumMediaTypes object
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
49 * \param[in] cMediaTypes number of media types to retrive
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
50 * \param[out] ppMediaTypes array of AM_MEDIA_TYPE structure pointers of size cMediaTypes
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
51 * \param[out] pcFetched address of variables that receives number of returned media types
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
52 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
53 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
54 * \return S_FALSE - did not return as meny structures as requested
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
55 * \return E_INVALIDARG Invalid argument
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
56 * \return E_POINTER Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
57 * \return VFW_E_ENUM_OUT_OF_SYNC - pin's state has changed and is now inconsistent with enumerator
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
58 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
59 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
60 static HRESULT STDCALL CEnumMediaTypes_Next(IEnumMediaTypes * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
61 /* [in] */ ULONG cMediaTypes,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
62 /* [size_is][out] */ AM_MEDIA_TYPE **ppMediaTypes,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
63 /* [out] */ ULONG *pcFetched)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
64 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
65 AM_MEDIA_TYPE* type = &((CEnumMediaTypes*)This)->type;
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
66 Debug printf("CEnumMediaTypes::Next(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
67 if (!ppMediaTypes)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
68 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
69 if (!pcFetched && (cMediaTypes!=1))
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
70 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
71 if (cMediaTypes <= 0)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
72 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
73
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
74 if (pcFetched)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
75 *pcFetched=1;
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22017
diff changeset
76 ppMediaTypes[0] = CreateMediaType(type);
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22017
diff changeset
77
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
78 if (cMediaTypes == 1)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
79 return 0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
80 return 1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
81 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
82
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
83 /* I expect that these methods are unused. */
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
84
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
85 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
86 * \brief IEnumMediaTypes::Skip (skips over a specified number of media types)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
87 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
88 * \param[in] This pointer to CEnumMEdiaTypes object
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
89 * \param[in] cMediaTypes number of media types to skip
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
90 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
91 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
92 * \return S_FALSE - skipped past the end of the sequence
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
93 * \return VFW_E_ENUM_OUT_OF_SYNC - pin's state has changed and is now inconsistent with enumerator
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
94 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
95 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
96 static HRESULT STDCALL CEnumMediaTypes_Skip(IEnumMediaTypes * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
97 /* [in] */ ULONG cMediaTypes)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
98 {
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
99 return output_unimplemented("CEnumMediaTypes::Skip", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
100 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
101
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
102 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
103 * \brief IEnumMediaTypes::Reset (resets enumeration sequence to beginning)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
104 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
105 * \param[in] This pointer to CEnumMEdiaTypes object
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
106 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
107 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
108 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
109 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
110 static HRESULT STDCALL CEnumMediaTypes_Reset(IEnumMediaTypes * This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
111 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
112 Debug printf("CEnumMediaTypes::Reset(%p) called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
113 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
114 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
115
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
116 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
117 * \brief IEnumMediaTypes::Clone (makes a copy of enumerator, returned object
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
118 * starts at the same position as original)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
119 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
120 * \param[in] This pointer to CEnumMEdiaTypes object
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
121 * \param[out] ppEnum address of variable that receives pointer to IEnumMediaTypes interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
122 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
123 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
124 * \return E_OUTOFMEMRY - Insufficient memory
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
125 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
126 * \return VFW_E_ENUM_OUT_OF_SYNC - pin's state has changed and is now inconsistent with enumerator
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
127 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
128 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
129 static HRESULT STDCALL CEnumMediaTypes_Clone(IEnumMediaTypes * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
130 /* [out] */ IEnumMediaTypes **ppEnum)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
131 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
132 Debug printf("CEnumMediaTypes::Clone(%p) called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
133 return E_NOTIMPL;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
134 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
135
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
136 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
137 * \brief CEnumMediaTypes destructor
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
138 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
139 * \param[in] This pointer to CEnumMediaTypes object
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
140 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
141 */
8292
9533c26c0806 avifile sync (mostly cosmetics)
arpi
parents: 7386
diff changeset
142 static void CEnumMediaTypes_Destroy(CEnumMediaTypes* This)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
143 {
22306
e95af173a63b Free AM_MEDIA_TYPE structure content when CEnumMediaTypes object is destroyed
voroshil
parents: 22305
diff changeset
144 FreeMediaType(&(This->type));
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
145 free(This->vt);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
146 free(This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
147 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
148
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
149 // IEnumMediaTypes->IUnknown methods
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
150 IMPLEMENT_IUNKNOWN(CEnumMediaTypes)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
151
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
152 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
153 * \brief CEnumMediaTypes constructor
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
154 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
155 * \param[in] amt media type for enumerating
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
156 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
157 * \return pointer to CEnumMEdiaTypes object or NULL if error occured
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
158 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
159 */
8292
9533c26c0806 avifile sync (mostly cosmetics)
arpi
parents: 7386
diff changeset
160 static CEnumMediaTypes* CEnumMediaTypesCreate(const AM_MEDIA_TYPE* amt)
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
161 {
27836
bf7f14c6dfaa Avoid useless casts of malloc results.
reimar
parents: 25849
diff changeset
162 CEnumMediaTypes *This = malloc(sizeof(CEnumMediaTypes)) ;
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
163
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
164 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
165 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
166
27836
bf7f14c6dfaa Avoid useless casts of malloc results.
reimar
parents: 25849
diff changeset
167 This->vt = malloc(sizeof(IEnumMediaTypes_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
168 if (!This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
169 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
170 free(This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
171 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
172 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
173
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
174 This->refcount = 1;
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22017
diff changeset
175 CopyMediaType(&(This->type),amt);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
176
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
177 This->vt->QueryInterface = CEnumMediaTypes_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
178 This->vt->AddRef = CEnumMediaTypes_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
179 This->vt->Release = CEnumMediaTypes_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
180 This->vt->Next = CEnumMediaTypes_Next;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
181 This->vt->Skip = CEnumMediaTypes_Skip;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
182 This->vt->Reset = CEnumMediaTypes_Reset;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
183 This->vt->Clone = CEnumMediaTypes_Clone;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
184
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
185 This->interfaces[0] = IID_IUnknown;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
186 This->interfaces[1] = IID_IEnumMediaTypes;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
187
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
188 return This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
189 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
190
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
191
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
192 /*************
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
193 * COutputPin
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
194 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
195 * WARNING:
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
196 * This is implementation of INPUT pin in DirectShow's terms
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
197 *
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
198 *************/
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
199
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
200
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
201 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
202 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
203 * \brief IUnknown::QueryInterface (query object for interface)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
204 * \param[in] This pointer to IUnknown interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
205 * \param[in] iid GUID of requested interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
206 * \param[out] ppv receives pointer to interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
207 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
208 * \return S_OK - success (and *ppv contains valid pointer)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
209 * \return E_NOINTERFACE - interface not found (and *ppv was set NULL)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
210 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
211 * \note
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
212 * Make sure to call Release on received interface when you are done
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
213 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
214 */
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
215 static HRESULT STDCALL COutputPin_QueryInterface(IUnknown* This, const GUID* iid, void** ppv)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
216 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
217 COutputPin* p = (COutputPin*) This;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
218
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
219 Debug printf("COutputPin_QueryInterface(%p) called\n", This);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
220 if (!ppv)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
221 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
222
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
223 if (memcmp(iid, &IID_IUnknown, 16) == 0)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
224 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
225 *ppv = p;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
226 p->vt->AddRef(This);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
227 return 0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
228 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
229 if (memcmp(iid, &IID_IMemInputPin, 16) == 0)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
230 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
231 *ppv = p->mempin;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
232 p->mempin->vt->AddRef((IUnknown*)*ppv);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
233 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
234 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
235
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
236 Debug printf("Unknown interface : %08x-%04x-%04x-%02x%02x-"
713
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
237 "%02x%02x%02x%02x%02x%02x\n",
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
238 iid->f1, iid->f2, iid->f3,
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
239 (unsigned char)iid->f4[1], (unsigned char)iid->f4[0],
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
240 (unsigned char)iid->f4[2], (unsigned char)iid->f4[3],
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
241 (unsigned char)iid->f4[4], (unsigned char)iid->f4[5],
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
242 (unsigned char)iid->f4[6], (unsigned char)iid->f4[7]);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
243 return E_NOINTERFACE;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
244 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
245
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
246 // IPin methods
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
247
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
248 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
249 * \brief IPin::Connect (connects pin to another pin)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
250 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
251 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
252 * \param[in] pReceivePin pointer to IPin interface of remote pin
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
253 * \param[in] pmt suggested media type for link. Can be NULL (any media type)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
254 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
255 * \return S_OK - success.
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
256 * \return VFW_E_ALREADY_CONNECTED - pin already connected
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
257 * \return VFW_E_NOT_STOPPED - filter is active
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
258 * \return VFW_E_TYPE_NOT_ACCEPT - type is not acceptable
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
259 * \return Apropriate error code otherwise.
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
260 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
261 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
262 static HRESULT STDCALL COutputPin_Connect(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
263 /* [in] */ IPin *pReceivePin,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
264 /* [in] */ /* const */ AM_MEDIA_TYPE *pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
265 {
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
266 Debug printf("COutputPin_Connect(%p) called\n",This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
267 /*
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
268 *pmt=((COutputPin*)This)->type;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
269 if(pmt->cbFormat>0)
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
270 {
9964
6454a2ba2e33 CoTaskMemAlloc/Free vs malloc/free cleanup
alex
parents: 8292
diff changeset
271 pmt->pbFormat=malloc(pmt->cbFormat);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
272 memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
273 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
274 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
275 //return E_NOTIMPL;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
276 return 0;// XXXXXXXXXXXXX CHECKME XXXXXXXXXXXXXXX
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
277 // if I put return 0; here, it crashes
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
278 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
279
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
280 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
281 * \brief IPin::ReceiveConnection (accepts a connection from another pin)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
282 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
283 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
284 * \param[in] pConnector connecting pin's IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
285 * \param[in] pmt suggested media type for connection
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
286 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
287 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
288 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
289 * \return VFW_E_ALREADY_CONNECTED - pin already connected
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
290 * \return VFW_E_NOT_STOPPED - filter is active
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
291 * \return VFW_E_TYPE_NOT_ACCEPT - type is not acceptable
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
292 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
293 * \note
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
294 * When returning S_OK method should also do the following:
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
295 * - store media type and return the same type in IPin::ConnectionMediaType
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
296 * - store pConnector and return it in IPin::ConnectedTo
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
297 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
298 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
299 static HRESULT STDCALL COutputPin_ReceiveConnection(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
300 /* [in] */ IPin *pConnector,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
301 /* [in] */ const AM_MEDIA_TYPE *pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
302 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
303 Debug printf("COutputPin_ReceiveConnection(%p) called\n", This);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
304 ((COutputPin*)This)->remote = pConnector;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
305 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
306 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
307
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
308 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
309 * \brief IPin::Disconnect (accepts a connection from another pin)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
310 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
311 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
312 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
313 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
314 * \return S_FALSE - pin was not connected
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
315 * \return VFW_E_NOT_STOPPED - filter is active
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
316 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
317 * \note
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
318 * To break connection you have to also call Disconnect on other pin
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
319 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
320 static HRESULT STDCALL COutputPin_Disconnect(IPin * This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
321 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
322 Debug printf("COutputPin_Disconnect(%p) called\n", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
323 return 1;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
324 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
325
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
326 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
327 * \brief IPin::ConnectedTo (retrieves pointer to the connected pin, if such exist)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
328 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
329 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
330 * \param[out] pPin pointer to remote pin's IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
331 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
332 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
333 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
334 * \return VFW_E_NOT_CONNECTED - pin is not connected
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
335 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
336 * \note
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
337 * Caller must call Release on received IPin, when done
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
338 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
339 static HRESULT STDCALL COutputPin_ConnectedTo(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
340 /* [out] */ IPin **pPin)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
341 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
342 Debug printf("COutputPin_ConnectedTo(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
343 if (!pPin)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
344 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
345 *pPin = ((COutputPin*)This)->remote;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
346 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
347 }
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
348
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
349 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
350 * \brief IPin::ConnectionMediaType (retrieves media type for connection, if such exist)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
351 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
352 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
353 * \param[out] pmt pointer to AM_MEDIA_TYPE, that receives connection media type
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
354 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
355 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
356 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
357 * \return VFW_E_NOT_CONNECTED - pin is not connected
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
358 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
359 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
360 static HRESULT STDCALL COutputPin_ConnectionMediaType(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
361 /* [out] */ AM_MEDIA_TYPE *pmt)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
362 {
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
363 Debug printf("COutputPin_ConnectionMediaType(%p) called\n",This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
364 if (!pmt)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
365 return E_INVALIDARG;
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22017
diff changeset
366 CopyMediaType(pmt,&(((COutputPin*)This)->type));
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
367 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
368 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
369
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
370 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
371 * \brief IPin::QueryPinInfo (retrieves information about the pin)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
372 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
373 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
374 * \param[out] pInfo pointer to PIN_INFO structure, that receives pin info
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
375 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
376 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
377 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
378 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
379 * \note
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
380 * If pInfo->pFilter is not NULL, then caller must call Release on pInfo->pFilter when done
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
381 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
382 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
383 static HRESULT STDCALL COutputPin_QueryPinInfo(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
384 /* [out] */ PIN_INFO *pInfo)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
385 {
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
386 return output_unimplemented("COutputPin_QueryPinInfo", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
387 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
388
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
389 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
390 * \brief IPin::QueryDirection (retrieves pin direction)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
391 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
392 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
393 * \param[out] pPinDir pointer to variable, that receives pin direction (PINDIR_INPUT,PINDIR_OUTPUT)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
394 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
395 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
396 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
397 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
398 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
399 static HRESULT STDCALL COutputPin_QueryDirection(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
400 /* [out] */ PIN_DIRECTION *pPinDir)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
401 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
402 Debug printf("COutputPin_QueryDirection(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
403 if (!pPinDir)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
404 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
405 *pPinDir = PINDIR_INPUT;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
406 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
407 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
408
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
409 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
410 * \brief IPin::QueryId (retrieves pin identificator)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
411 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
412 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
413 * \param[out] Id adress of variable, that receives string with pin's Id.
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
414 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
415 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
416 * \return E_OUTOFMEMORY - Insufficient memory
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
417 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
418 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
419 * \note
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
420 * Pin's Id is not the same as pin's name
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
421 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
422 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
423 static HRESULT STDCALL COutputPin_QueryId(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
424 /* [out] */ LPWSTR *Id)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
425 {
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
426 return output_unimplemented("COutputPin_QueryId", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
427 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
428
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
429 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
430 * \brief IPin::QueryAccept (determines can media type be accepted or not)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
431 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
432 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
433 * \param[in] pmt Media type to check
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
434 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
435 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
436 * \return S_FALSE - pin rejects media type
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
437 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
438 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
439 static HRESULT STDCALL COutputPin_QueryAccept(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
440 /* [in] */ const AM_MEDIA_TYPE *pmt)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
441 {
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
442 return output_unimplemented("COutputPin_QueryAccept", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
443 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
444
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
445 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
446 * \brief IPin::EnumMediaTypes (enumerates the pin's preferred media types)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
447 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
448 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
449 * \param[out] ppEnum adress of variable that receives pointer to IEnumMEdiaTypes interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
450 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
451 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
452 * \return E_OUTOFMEMORY - Insufficient memory
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
453 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
454 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
455 * \note
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
456 * Caller must call Release on received interface when done
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
457 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
458 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
459 static HRESULT STDCALL COutputPin_EnumMediaTypes(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
460 /* [out] */ IEnumMediaTypes **ppEnum)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
461 {
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
462 Debug printf("COutputPin_EnumMediaTypes(%p) called\n",This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
463 if (!ppEnum)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
464 return E_INVALIDARG;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
465 *ppEnum = (IEnumMediaTypes*) CEnumMediaTypesCreate(&((COutputPin*)This)->type);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
466 return 0;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
467 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
468
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
469 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
470 * \brief IPin::QueryInternalConnections (retries pin's internal connections)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
471 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
472 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
473 * \param[out] apPin Array that receives pins, internally connected to this
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
474 * \param[in,out] nPint Size of an array
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
475 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
476 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
477 * \return S_FALSE - pin rejects media type
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
478 * \return E_NOTIMPL - not implemented
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
479 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
480 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
481 static HRESULT STDCALL COutputPin_QueryInternalConnections(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
482 /* [out] */ IPin **apPin,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
483 /* [out][in] */ ULONG *nPin)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
484 {
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
485 return output_unimplemented("COutputPin_QueryInternalConnections", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
486 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
487
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
488 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
489 * \brief IPin::EndOfStream (notifies pin, that no data is expected, until new run command)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
490 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
491 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
492 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
493 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
494 * \return E_UNEXPECTED - The pin is output pin
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
495 *
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27837
diff changeset
496 * \note
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27837
diff changeset
497 * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27837
diff changeset
498 * IMemAllocator::GetBuffer runs in different (streaming) thread then other
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
499 * methods (application thread).
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
500 * IMemoryInputPin::NewSegment runs either in streaming or application thread.
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
501 * Developer must use critical sections for thread-safing work.
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
502 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
503 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
504 static HRESULT STDCALL COutputPin_EndOfStream(IPin * This)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
505 {
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
506 return output_unimplemented("COutputPin_EndOfStream", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
507 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
508
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
509 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
510 * \brief IPin::BeginFlush (begins a flush operation)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
511 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
512 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
513 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
514 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
515 * \return E_UNEXPECTED - The pin is output pin
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
516 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
517 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
518 static HRESULT STDCALL COutputPin_BeginFlush(IPin * This)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
519 {
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
520 return output_unimplemented("COutputPin_BeginFlush", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
521 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
522
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
523 /**
22015
857cc6beb662 fix typos from previous commit
voroshil
parents: 22014
diff changeset
524 * \brief IPin::EndFlush (ends a flush operation)
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
525 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
526 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
527 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
528 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
529 * \return E_UNEXPECTED - The pin is output pin
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
530 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
531 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
532 static HRESULT STDCALL COutputPin_EndFlush(IPin * This)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
533 {
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 3467
diff changeset
534 return output_unimplemented("COutputPin_EndFlush", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
535 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
536
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
537 /**
22015
857cc6beb662 fix typos from previous commit
voroshil
parents: 22014
diff changeset
538 * \brief IPin::NewSegment (media sample received after this call grouped as segment with common
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
539 * start,stop time and rate)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
540 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
541 * \param[in] This pointer to IPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
542 * \param[in] tStart start time of new segment
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
543 * \param[in] tStop end time of new segment
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
544 * \param[in] dRate rate at wich segment should be processed
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
545 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
546 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
547 * \return E_UNEXPECTED - The pin is output pin
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
548 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
549 */
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
550 static HRESULT STDCALL COutputPin_NewSegment(IPin * This,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
551 /* [in] */ REFERENCE_TIME tStart,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
552 /* [in] */ REFERENCE_TIME tStop,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
553 /* [in] */ double dRate)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
554 {
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
555 Debug printf("COutputPin_NewSegment(%Ld,%Ld,%f) called\n",
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
556 tStart, tStop, dRate);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
557 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
558 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
559
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
560
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
561
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
562 // IMemInputPin->IUnknown methods
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
563
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
564 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
565 * \brief IUnknown::QueryInterface (query object for interface)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
566 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
567 * \param[in] This pointer to IUnknown interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
568 * \param[in] iid GUID of requested interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
569 * \param[out] ppv receives pointer to interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
570 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
571 * \return S_OK - success (and *ppv contains valid pointer)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
572 * \return E_NOINTERFACE - interface not found (and *ppv was set NULL)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
573 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
574 * \note
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
575 * Make sure to call Release on received interface when you are done
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
576 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
577 */
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
578 static HRESULT STDCALL COutputMemPin_QueryInterface(IUnknown* This, const GUID* iid, void** ppv)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
579 {
22334
1c7f753ef2c9 Fix wrong typecast, which can cause MPlayer crash
voroshil
parents: 22306
diff changeset
580 COutputMemPin* p = (COutputMemPin*)This;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
581
22017
0421ee482f38 fix overlooked debug message
voroshil
parents: 22016
diff changeset
582 Debug printf("COutputMemPin_QueryInterface(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
583 if (!ppv)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
584 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
585
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
586 if(!memcmp(iid, &IID_IUnknown, 16))
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
587 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
588 *ppv = p;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
589 p->vt->AddRef(This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
590 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
591 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
592 /*if(!memcmp(iid, &IID_IPin, 16))
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
593 {
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
594 COutputPin* ptr=(COutputPin*)(This-1);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
595 *ppv=(void*)ptr;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
596 AddRef((IUnknown*)ptr);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
597 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
598 }*/
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
599 if(!memcmp(iid, &IID_IMemInputPin, 16))
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
600 {
22334
1c7f753ef2c9 Fix wrong typecast, which can cause MPlayer crash
voroshil
parents: 22306
diff changeset
601 *ppv = p;
1c7f753ef2c9 Fix wrong typecast, which can cause MPlayer crash
voroshil
parents: 22306
diff changeset
602 p->vt->AddRef(This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
603 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
604 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
605 Debug printf("Unknown interface : %08x-%04x-%04x-%02x%02x-" \
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
606 "%02x%02x%02x%02x%02x%02x\n",
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
607 iid->f1, iid->f2, iid->f3,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
608 (unsigned char)iid->f4[1], (unsigned char)iid->f4[0],
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
609 (unsigned char)iid->f4[2], (unsigned char)iid->f4[3],
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
610 (unsigned char)iid->f4[4], (unsigned char)iid->f4[5],
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
611 (unsigned char)iid->f4[6], (unsigned char)iid->f4[7]);
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
612 return E_NOINTERFACE;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
613 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
614
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
615 // IMemInputPin methods
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
616
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
617 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
618 * \brief IMemInputPin::GetAllocator (retrives memory allocator, proposed by pin)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
619 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
620 * \param[in] This pointer to IMemInputPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
621 * \param[out] ppAllocator address of variable that receives allocator's IMemAllocator interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
622 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
623 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
624 * \return VFW_E_NO_ALLOCATOR - No allocator
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
625 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
626 * \note
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
627 * Make sure to call Release on received interface when you are done
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
628 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
629 */
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
630 static HRESULT STDCALL COutputMemPin_GetAllocator(IMemInputPin* This,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
631 /* [out] */ IMemAllocator** ppAllocator)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
632 {
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
633 Debug printf("COutputMemPin_GetAllocator(%p, %p) called\n", This->vt, ppAllocator);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
634 *ppAllocator = (IMemAllocator*) MemAllocatorCreate();
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
635 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
636 }
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
637
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
638 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
639 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
640 * \brief IMemInputPin::NotifyAllocator (specifies an allocator for the connection)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
641 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
642 * \param[in] This pointer to IMemInputPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
643 * \param[in] pAllocator allocator's IMemAllocator interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
644 * \param[in] bReadOnly specifies whether samples from allocator are readonly
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
645 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
646 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
647 * \return Apropriate error code otherwise
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
648 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
649 */
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
650 static HRESULT STDCALL COutputMemPin_NotifyAllocator(IMemInputPin* This,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
651 /* [in] */ IMemAllocator* pAllocator,
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
652 /* [in] */ int bReadOnly)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
653 {
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
654 Debug printf("COutputMemPin_NotifyAllocator(%p, %p) called\n", This, pAllocator);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
655 ((COutputMemPin*)This)->pAllocator = (MemAllocator*) pAllocator;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
656 return 0;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
657 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
658
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
659 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
660 * \brief IMemInputPin::GetAllocatorRequirements (retrieves allocator properties requested by
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
661 * input pin)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
662 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
663 * \param[in] This pointer to IMemInputPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
664 * \param[out] pProps pointer to a structure that receives allocator properties
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
665 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
666 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
667 * \return E_NOTIMPL - Not implemented
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
668 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
669 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
670 */
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
671 static HRESULT STDCALL COutputMemPin_GetAllocatorRequirements(IMemInputPin* This,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
672 /* [out] */ ALLOCATOR_PROPERTIES* pProps)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
673 {
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
674 return output_unimplemented("COutputMemPin_GetAllocatorRequirements", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
675 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
676
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
677 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
678 * \brief IMemInputPin::Receive (receives the next media sample int thre stream)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
679 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
680 * \param[in] This pointer to IMemInputPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
681 * \param[in] pSample pointer to sample's IMediaSample interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
682 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
683 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
684 * \return S_FALSE - The sample was rejected
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
685 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
686 * \return VFW_E_INVALIDMEDIATYPE - invalid media type
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
687 * \return VFW_E_RUNTIME_ERROR - run-time error occured
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
688 * \return VFW_E_WRONG_STATE - pin is stopped
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
689 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
690 * \remarks
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
691 * Method san do on of the following:
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
692 * - reject sample
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
693 * - accept sample and process it in another thread
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
694 * - accept sample and process it before returning
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
695 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
696 * In second case method should increase reference count for sample (through AddRef)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
697 * In the last case method might block indefinitely. If this might
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
698 * happen IMemInpuPin::ReceiveCAnBlock returns S_OK
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
699 *
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27837
diff changeset
700 * \note
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27837
diff changeset
701 * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27837
diff changeset
702 * IMemAllocator::GetBuffer runs in different (streaming) thread then other
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
703 * methods (application thread).
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
704 * IMemoryInputPin::NewSegment runs either in streaming or application thread.
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
705 * Developer must use critical sections for thread-safing work.
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
706 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
707 */
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
708 static HRESULT STDCALL COutputMemPin_Receive(IMemInputPin* This,
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
709 /* [in] */ IMediaSample* pSample)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
710 {
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
711 Debug printf("COutputMemPin_Receive(%p) called\n", This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
712 if (!pSample)
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
713 return E_INVALIDARG;
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
714
22398
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
715 if(((COutputMemPin*)This)->parent->SampleProc)
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
716 return ((COutputMemPin*)This)->parent->SampleProc(((COutputMemPin*)This)->parent->pUserData,pSample);
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
717 //reject sample
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
718 return S_FALSE;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
719 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
720
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
721 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
722 * \brief IMemInputPin::ReceiveMultiple (receives multiple samples in the stream)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
723 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
724 * \param[in] This pointer to IMemInputPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
725 * \param[in] pSamples pointer to array with samples
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
726 * \param[in] nSamples number of samples in array
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
727 * \param[out] nSamplesProcessed number of processed samples
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
728 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
729 * \return S_OK - success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
730 * \return S_FALSE - The sample was rejected
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
731 * \return E_POINTER - Null pointer
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
732 * \return VFW_E_INVALIDMEDIATYPE - invalid media type
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
733 * \return VFW_E_RUNTIME_ERROR - run-time error occured
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
734 * \return VFW_E_WRONG_STATE - pin is stopped
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
735 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
736 * \remarks
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
737 * This method behaves like IMemInputPin::Receive but for array of samples
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
738 *
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27837
diff changeset
739 * \note
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27837
diff changeset
740 * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27837
diff changeset
741 * IMemAllocator::GetBuffer runs in different (streaming) thread then other
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
742 * methods (application thread).
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
743 * IMemoryInputPin::NewSegment runs either in streaming or application thread.
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
744 * Developer must use critical sections for thread-safing work.
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
745 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
746 */
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
747 static HRESULT STDCALL COutputMemPin_ReceiveMultiple(IMemInputPin * This,
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
748 /* [size_is][in] */ IMediaSample **pSamples,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
749 /* [in] */ long nSamples,
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
750 /* [out] */ long *nSamplesProcessed)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
751 {
22398
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
752 HRESULT hr;
25774
ebd1ab1c5357 Use ld conversion specifier for long int argument, fixes the warning:
diego
parents: 22398
diff changeset
753 Debug printf("COutputMemPin_ReceiveMultiple(%p) %ld\n", This,nSamples);
22398
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
754 for(*nSamplesProcessed=0; *nSamplesProcessed < nSamples; *nSamplesProcessed++) {
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
755 hr = This->vt->Receive(This,pSamples[*nSamplesProcessed]);
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
756 if (hr != S_OK) break;
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
757 }
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
758 return hr;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
759 }
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
760
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
761 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
762 * \brief IMemInputPin::ReceiveCanBlock (determines whether IMemInputPin:::Receive might block)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
763 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
764 * \param[in] This pointer to IMemInputPin interface
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
765 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
766 * \return S_OK - the pin might block
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
767 * \return S_FALSE - the pin will not block
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
768 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
769 */
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
770 static HRESULT STDCALL COutputMemPin_ReceiveCanBlock(IMemInputPin * This)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
771 {
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
772 return output_unimplemented("COutputMemPin_ReceiveCanBlock", This);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
773 }
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
774
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
775 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
776 * \brief COutputPin::SetNewFormat(sets new media format for the pin)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
777 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
778 * \param[in] This pointer to COutputPin class
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
779 * \param[in] amt new media format
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
780 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
781 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
782 static void COutputPin_SetNewFormat(COutputPin* This, const AM_MEDIA_TYPE* amt)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
783 {
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22017
diff changeset
784 CopyMediaType(&(This->type),amt);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
785 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
786
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
787 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
788 * \brief COutputPin destructor
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
789 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
790 * \param[in] This pointer to COutputPin class
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
791 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
792 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
793 static void COutputPin_Destroy(COutputPin* This)
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
794 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
795 if (This->mempin->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
796 free(This->mempin->vt);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
797 if (This->mempin)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
798 free(This->mempin);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
799 if (This->vt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
800 free(This->vt);
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22017
diff changeset
801 FreeMediaType(&(This->type));
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
802 free(This);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
803 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
804
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
805 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
806 * \brief IUnknown::AddRef (increases reference counter for interface)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
807 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
808 * \param[in] This pointer to IUnknown class
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
809 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
810 * \return new value of reference counter
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
811 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
812 * \remarks
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
813 * Return value should be used only for debug purposes
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
814 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
815 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
816 static HRESULT STDCALL COutputPin_AddRef(IUnknown* This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
817 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
818 Debug printf("COutputPin_AddRef(%p) called (%d)\n", This, ((COutputPin*)This)->refcount);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
819 ((COutputPin*)This)->refcount++;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
820 return 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
821 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
822
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
823 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
824 * \brief IUnknown::Release (desreases reference counter for interface)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
825 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
826 * \param[in] This pointer to IUnknown class
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
827 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
828 * \return new value of reference counter
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
829 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
830 * \remarks
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
831 * When reference counter reaches zero calls destructor
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
832 * Return value should be used only for debug purposes
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
833 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
834 */
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
835 static HRESULT STDCALL COutputPin_Release(IUnknown* This)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
836 {
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
837 Debug printf("COutputPin_Release(%p) called (%d)\n", This, ((COutputPin*)This)->refcount);
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
838 if (--((COutputPin*)This)->refcount <= 0)
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
839 COutputPin_Destroy((COutputPin*)This);
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
840
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
841 return 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
842 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
843
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
844 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
845 * \brief IUnknown::AddRef (increases reference counter for interface)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
846 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
847 * \param[in] This pointer to IUnknown class
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
848 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
849 * \return new value of reference counter
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
850 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
851 * \remarks
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
852 * Return value should be used only for debug purposes
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
853 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
854 */
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
855 static HRESULT STDCALL COutputMemPin_AddRef(IUnknown* This)
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
856 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
857 COutputMemPin* p = (COutputMemPin*) This;
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
858 Debug printf("COutputMemPin_AddRef(%p) called (%p, %d)\n", p, p->parent, p->parent->refcount);
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
859 p->parent->refcount++;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
860 return 0;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
861 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
862
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
863 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
864 * \brief IUnknown::Release (desreases reference counter for interface)
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
865 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
866 * \param[in] This pointer to IUnknown class
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
867 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
868 * \return new value of reference counter
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
869 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
870 * \remarks
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
871 * When reference counter reaches zero calls destructor
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
872 * Return value should be used only for debug purposes
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
873 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
874 */
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
875 static HRESULT STDCALL COutputMemPin_Release(IUnknown* This)
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
876 {
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
877 COutputMemPin* p = (COutputMemPin*) This;
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
878 Debug printf("COutputMemPin_Release(%p) called (%p, %d)\n",
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
879 p, p->parent, p->parent->refcount);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
880 if (--p->parent->refcount <= 0)
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
881 COutputPin_Destroy(p->parent);
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
882 return 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
883 }
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
884
22014
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
885 /**
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
886 * \brief COutputPin constructor
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
887 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
888 * \param[in] amt media type for pin
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
889 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
890 * \return pointer to COutputPin if success
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
891 * \return NULL if error occured
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
892 *
9472dc33de99 Cosmetics. Doxygen comments.
voroshil
parents: 18878
diff changeset
893 */
22398
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
894 COutputPin* COutputPinCreate(const AM_MEDIA_TYPE* amt,SAMPLEPROC SampleProc,void* pUserData)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
895 {
27836
bf7f14c6dfaa Avoid useless casts of malloc results.
reimar
parents: 25849
diff changeset
896 COutputPin* This = malloc(sizeof(COutputPin));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
897 IMemInputPin_vt* ivt;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
898
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
899 if (!This)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
900 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
901
27836
bf7f14c6dfaa Avoid useless casts of malloc results.
reimar
parents: 25849
diff changeset
902 This->vt = malloc(sizeof(IPin_vt));
bf7f14c6dfaa Avoid useless casts of malloc results.
reimar
parents: 25849
diff changeset
903 This->mempin = malloc(sizeof(COutputMemPin));
bf7f14c6dfaa Avoid useless casts of malloc results.
reimar
parents: 25849
diff changeset
904 ivt = malloc(sizeof(IMemInputPin_vt));
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
905
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
906 if (!This->vt || !This->mempin || !ivt)
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
907 {
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
908 COutputPin_Destroy(This);
27837
2a36db2f583d Missing free in malloc error case in COutputPinCreate.
reimar
parents: 27836
diff changeset
909 free(ivt);
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
910 return NULL;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
911 }
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
912
22398
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
913 This->SampleProc=SampleProc;
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
914 This->pUserData=pUserData;
49f01f8fbd60 Rework of copying samples from directshow codecs.
voroshil
parents: 22334
diff changeset
915
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
916 This->mempin->vt = ivt;
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
917
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
918 This->refcount = 1;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
919 This->remote = 0;
22305
3d1b23cf3d08 Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
voroshil
parents: 22017
diff changeset
920 CopyMediaType(&(This->type),amt);
3467
e3bbf44dbab2 avifile sync
arpi
parents: 3130
diff changeset
921
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
922 This->vt->QueryInterface = COutputPin_QueryInterface;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
923 This->vt->AddRef = COutputPin_AddRef;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
924 This->vt->Release = COutputPin_Release;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
925 This->vt->Connect = COutputPin_Connect;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
926 This->vt->ReceiveConnection = COutputPin_ReceiveConnection;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
927 This->vt->Disconnect = COutputPin_Disconnect;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
928 This->vt->ConnectedTo = COutputPin_ConnectedTo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
929 This->vt->ConnectionMediaType = COutputPin_ConnectionMediaType;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
930 This->vt->QueryPinInfo = COutputPin_QueryPinInfo;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
931 This->vt->QueryDirection = COutputPin_QueryDirection;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
932 This->vt->QueryId = COutputPin_QueryId;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
933 This->vt->QueryAccept = COutputPin_QueryAccept;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
934 This->vt->EnumMediaTypes = COutputPin_EnumMediaTypes;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
935 This->vt->QueryInternalConnections = COutputPin_QueryInternalConnections;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
936 This->vt->EndOfStream = COutputPin_EndOfStream;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
937 This->vt->BeginFlush = COutputPin_BeginFlush;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
938 This->vt->EndFlush = COutputPin_EndFlush;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
939 This->vt->NewSegment = COutputPin_NewSegment;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
940
22016
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
941 This->mempin->vt->QueryInterface = COutputMemPin_QueryInterface;
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
942 This->mempin->vt->AddRef = COutputMemPin_AddRef;
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
943 This->mempin->vt->Release = COutputMemPin_Release;
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
944 This->mempin->vt->GetAllocator = COutputMemPin_GetAllocator;
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
945 This->mempin->vt->NotifyAllocator = COutputMemPin_NotifyAllocator;
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
946 This->mempin->vt->GetAllocatorRequirements = COutputMemPin_GetAllocatorRequirements;
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
947 This->mempin->vt->Receive = COutputMemPin_Receive;
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
948 This->mempin->vt->ReceiveMultiple = COutputMemPin_ReceiveMultiple;
4479e6a1a140 Changing debug messages and renaming method names according to their
voroshil
parents: 22015
diff changeset
949 This->mempin->vt->ReceiveCanBlock = COutputMemPin_ReceiveCanBlock;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
950
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
951 This->mempin->frame_size_pointer = 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
952 This->mempin->frame_pointer = 0;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
953 This->mempin->pAllocator = 0;
3130
623cdb771e97 avifile sync. seems to some bugs fixed...
arpi
parents: 3056
diff changeset
954 This->mempin->refcount = 1;
3056
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
955 This->mempin->parent = This;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
956
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
957 This->SetNewFormat = COutputPin_SetNewFormat;
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
958
213b35f84cf3 C++ -> C (import from avifile cvs)
arpi
parents: 2072
diff changeset
959 return This;
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 1063
diff changeset
960 }