comparison loader/dshow/inputpin.c @ 22028:24dc4ec0d08d

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