annotate loader/dshow/outputpin.c @ 25661:293aeec83153

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