37 #define QueryFilterInfoReleaseGraph(fi) if ((fi).pGraph) (fi).pGraph->Release();
39 #define QueryPinInfoReleaseFilter(pi) if ((pi).pFilter) (pi).pFilter->Release();
76 __in_opt LPCTSTR
pName,
77 __inout_opt LPUNKNOWN pUnk,
92 STDMETHODIMP GetClassID(__out CLSID *pClsID);
96 STDMETHODIMP GetState(DWORD dwMSecs, __out FILTER_STATE *State);
98 STDMETHODIMP SetSyncSource(__inout_opt IReferenceClock *pClock);
100 STDMETHODIMP GetSyncSource(__deref_out_opt IReferenceClock **pClock);
108 STDMETHODIMP Pause();
114 STDMETHODIMP Run(REFERENCE_TIME tStart);
120 virtual HRESULT StreamTime(
CRefTime& rtStream);
125 return ((m_State == State_Paused) || (m_State == State_Running));
171 __in_opt LPCTSTR
pName,
172 __inout_opt LPUNKNOWN pUnk,
177 __in_opt LPCTSTR
pName,
178 __in_opt LPUNKNOWN pUnk,
181 __inout HRESULT *phr);
184 __in_opt LPCSTR
pName,
185 __in_opt LPUNKNOWN pUnk,
190 __in_opt LPCSTR
pName,
191 __in_opt LPUNKNOWN pUnk,
194 __inout HRESULT *phr);
210 STDMETHODIMP GetClassID(__out CLSID *pClsID);
214 STDMETHODIMP GetState(DWORD dwMSecs, __out FILTER_STATE *State);
216 STDMETHODIMP SetSyncSource(__in_opt IReferenceClock *pClock);
218 STDMETHODIMP GetSyncSource(__deref_out_opt IReferenceClock **pClock);
226 STDMETHODIMP Pause();
231 STDMETHODIMP
Run(REFERENCE_TIME tStart);
237 virtual HRESULT StreamTime(
CRefTime& rtStream);
242 return ((m_State == State_Paused) || (m_State == State_Running));
247 return (m_State == State_Stopped);
255 STDMETHODIMP EnumPins(
256 __deref_out IEnumPins ** ppEnum);
260 STDMETHODIMP FindPin(
262 __deref_out IPin ** ppPin
265 STDMETHODIMP QueryFilterInfo(
266 __out FILTER_INFO * pInfo);
268 STDMETHODIMP JoinFilterGraph(
269 __inout_opt IFilterGraph * pGraph,
270 __in_opt LPCWSTR
pName);
275 STDMETHODIMP QueryVendorInfo(
276 __deref_out LPWSTR* pVendorInfo
286 LONG_PTR EventParam1,
287 LONG_PTR EventParam2);
298 HRESULT ReconnectPin(IPin *pPin, __in_opt AM_MEDIA_TYPE
const *pmt);
301 virtual LONG GetPinVersion();
302 void IncrementPinVersion();
306 virtual int GetPinCount() PURE;
311 STDMETHODIMP Register();
312 STDMETHODIMP Unregister();
359 void DisplayPinInfo(IPin *pReceivePin);
360 void DisplayTypeInfo(IPin *pPin,
const CMediaType *pmt);
378 HRESULT TryMediaTypes(
381 IEnumMediaTypes *pEnum);
387 HRESULT AgreeMediaType(
394 __in_opt LPCTSTR pObjectName,
397 __inout HRESULT *phr,
398 __in_opt LPCWSTR
pName,
402 __in_opt LPCSTR pObjectName,
405 __inout HRESULT *phr,
406 __in_opt LPCWSTR
pName,
422 STDMETHODIMP Connect(
424 __in_opt
const AM_MEDIA_TYPE *pmt
428 STDMETHODIMP ReceiveConnection(
430 const AM_MEDIA_TYPE *pmt
433 STDMETHODIMP Disconnect();
435 STDMETHODIMP ConnectedTo(__deref_out IPin **pPin);
437 STDMETHODIMP ConnectionMediaType(__out AM_MEDIA_TYPE *pmt);
439 STDMETHODIMP QueryPinInfo(
440 __out PIN_INFO * pInfo
443 STDMETHODIMP QueryDirection(
444 __out PIN_DIRECTION * pPinDir
447 STDMETHODIMP QueryId(
448 __deref_out LPWSTR * Id
452 STDMETHODIMP QueryAccept(
453 const AM_MEDIA_TYPE *pmt
457 STDMETHODIMP EnumMediaTypes(
458 __deref_out IEnumMediaTypes **ppEnum
469 __out_ecount_part(*nPin,*nPin) IPin* *apPin,
472 ) {
return E_NOTIMPL; }
475 STDMETHODIMP EndOfStream(
void);
483 STDMETHODIMP NewSegment(
484 REFERENCE_TIME tStart,
485 REFERENCE_TIME tStop,
492 STDMETHODIMP Notify(IBaseFilter * pSender, Quality q);
494 STDMETHODIMP SetSink(IQualityControl * piqc);
505 return (m_pFilter->
m_State == State_Stopped);
509 virtual LONG GetMediaTypeVersion();
510 void IncrementTypeVersion();
514 virtual HRESULT Active(
void);
517 virtual HRESULT Inactive(
void);
520 virtual HRESULT Run(REFERENCE_TIME tStart);
523 virtual HRESULT CheckMediaType(
const CMediaType *) PURE;
526 virtual HRESULT SetMediaType(
const CMediaType *);
530 virtual HRESULT CheckConnect(IPin *);
533 virtual HRESULT BreakConnect();
534 virtual HRESULT CompleteConnect(IPin *pReceivePin);
537 virtual HRESULT GetMediaType(
int iPosition, __inout
CMediaType *pMediaType);
551 LPWSTR
Name() {
return m_pName; };
556 m_bCanReconnectWhenActive = bCanReconnect;
561 return m_bCanReconnectWhenActive;
565 STDMETHODIMP DisconnectInternal();
607 BOOL AreWeOutOfSync() {
608 return (m_pFilter->
GetPinVersion() == m_Version ? FALSE : TRUE);
614 STDMETHODIMP Refresh();
632 __out_ecount(cPins) IPin ** ppPins,
633 __out_opt
ULONG * pcFetched
637 STDMETHODIMP
Reset();
638 STDMETHODIMP
Clone(__deref_out IEnumPins **ppEnum);
668 BOOL AreWeOutOfSync() {
688 __out_ecount(cMediaTypes) AM_MEDIA_TYPE ** ppMediaTypes,
689 __out_opt
ULONG * pcFetched
693 STDMETHODIMP
Reset();
694 STDMETHODIMP
Clone(__deref_out IEnumMediaTypes **ppEnum);
724 __in_opt LPCTSTR pObjectName,
727 __inout HRESULT *phr,
728 __in_opt LPCWSTR
pName);
731 __in_opt LPCSTR pObjectName,
734 __inout HRESULT *phr,
735 __in_opt LPCWSTR
pName);
742 virtual HRESULT DecideAllocator(IMemInputPin * pPin, __deref_out IMemAllocator ** pAlloc);
749 virtual HRESULT DecideBufferSize(
750 IMemAllocator * pAlloc,
751 __inout ALLOCATOR_PROPERTIES * ppropInputRequest
755 virtual HRESULT GetDeliveryBuffer(__deref_out IMediaSample ** ppSample,
756 __in_opt REFERENCE_TIME * pStartTime,
757 __in_opt REFERENCE_TIME * pEndTime,
764 virtual HRESULT Deliver(IMediaSample *);
767 virtual HRESULT InitAllocator(__deref_out IMemAllocator **ppAlloc);
781 virtual HRESULT DeliverEndOfStream(
void);
786 STDMETHODIMP BeginFlush(
void);
787 STDMETHODIMP EndFlush(
void);
788 virtual HRESULT DeliverBeginFlush(
void);
789 virtual HRESULT DeliverEndFlush(
void);
793 virtual HRESULT DeliverNewSegment(
794 REFERENCE_TIME tStart,
795 REFERENCE_TIME tStop,
842 __in_opt LPCTSTR pObjectName,
845 __inout HRESULT *phr,
846 __in_opt LPCWSTR
pName);
849 __in_opt LPCSTR pObjectName,
852 __inout HRESULT *phr,
853 __in_opt LPCWSTR
pName);
864 STDMETHODIMP GetAllocator(__deref_out IMemAllocator ** ppAllocator);
868 STDMETHODIMP NotifyAllocator(
869 IMemAllocator * pAllocator,
873 STDMETHODIMP Receive(IMediaSample *pSample);
876 STDMETHODIMP ReceiveMultiple (
877 __in_ecount(nSamples) IMediaSample **pSamples,
879 __out
long *nSamplesProcessed);
882 STDMETHODIMP ReceiveCanBlock();
888 STDMETHODIMP BeginFlush(
void);
895 STDMETHODIMP EndFlush(
void);
901 STDMETHODIMP GetAllocatorRequirements(__out ALLOCATOR_PROPERTIES*pProps);
918 virtual HRESULT CheckStreaming();
921 HRESULT PassNotify(Quality& q);
928 STDMETHODIMP
Notify(IBaseFilter * pSender, Quality q);
939 ASSERT(m_SampleProps.cbData != 0);
940 return &m_SampleProps;
950 public IPinFlowControl
955 __in_opt LPCSTR pObjectName,
958 __inout HRESULT *phr,
959 __in_opt LPCWSTR
pName);
963 __in_opt LPCTSTR pObjectName,
966 __inout HRESULT *phr,
967 __in_opt LPCWSTR
pName);
979 STDMETHODIMP
Block(DWORD dwBlockFlags,
HANDLE hEvent);
985 virtual HRESULT
Deliver(IMediaSample *pSample);
987 virtual HRESULT
DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop,
double dRate);
1003 const AM_MEDIA_TYPE *pmt,
1004 REFERENCE_TIME tSegmentStart,
1005 REFERENCE_TIME tSegmentStop,
1075 HRESULT Initialize(
void);
1076 HRESULT ChangeMediaTypeHelper(
const CMediaType *pmt);
1079 void AssertValid(
void);
1103 HRESULT
hr = pOutputPin->StartUsingOutputPin();
1110 m_pOutputPin = pOutputPin;
1115 if(
NULL != m_pOutputPin )
1234 __in_opt LPCTSTR
pName,
1236 __inout_opt HRESULT *phr,
1237 __in_bcount_opt(length) LPBYTE pBuffer =
NULL,
1241 __in_opt LPCSTR
pName,
1243 __inout_opt HRESULT *phr,
1244 __in_bcount_opt(length) LPBYTE pBuffer =
NULL,
1260 HRESULT
SetPointer(__in_bcount(cBytes) BYTE * ptr, LONG cBytes);
1263 STDMETHODIMP
GetPointer(__deref_out BYTE ** ppBuffer);
1269 __out REFERENCE_TIME * pTimeStart,
1270 __out REFERENCE_TIME * pTimeEnd
1275 __in_opt REFERENCE_TIME * pTimeStart,
1276 __in_opt REFERENCE_TIME * pTimeEnd
1288 STDMETHODIMP
GetMediaType(__deref_out AM_MEDIA_TYPE **ppMediaType);
1289 STDMETHODIMP
SetMediaType(__in_opt AM_MEDIA_TYPE *pMediaType);
1301 __out LONGLONG * pTimeStart,
1302 __out LONGLONG * pTimeEnd
1307 __in_opt LONGLONG * pTimeStart,
1308 __in_opt LONGLONG * pTimeEnd
1314 __out_bcount(cbProperties) BYTE * pbProperties
1319 __in_bcount(cbProperties)
const BYTE * pbProperties
1340 public IMemAllocatorCallbackTemp,
1365 int GetCount()
const {
return m_nOnList; };
1369 CBaseAllocator::NextSample(pSample) = m_List;
1376 if (pSample !=
NULL) {
1377 m_List = CBaseAllocator::NextSample(m_List);
1450 virtual void Free(
void) PURE;
1453 virtual HRESULT Alloc(
void);
1458 __in_opt LPCTSTR , __inout_opt LPUNKNOWN, __inout HRESULT *,
1459 BOOL bEvent = TRUE, BOOL fEnableReleaseCallback = FALSE);
1462 __in_opt LPCSTR , __inout_opt LPUNKNOWN, __inout HRESULT *,
1463 BOOL bEvent = TRUE, BOOL fEnableReleaseCallback = FALSE);
1472 STDMETHODIMP SetProperties(
1473 __in ALLOCATOR_PROPERTIES* pRequest,
1474 __out ALLOCATOR_PROPERTIES* pActual);
1477 STDMETHODIMP GetProperties(
1478 __out ALLOCATOR_PROPERTIES* pProps);
1482 STDMETHODIMP Commit();
1486 STDMETHODIMP Decommit();
1497 STDMETHODIMP GetBuffer(__deref_out IMediaSample **ppBuffer,
1498 __in_opt REFERENCE_TIME * pStartTime,
1499 __in_opt REFERENCE_TIME * pEndTime,
1503 STDMETHODIMP ReleaseBuffer(IMediaSample *pBuffer);
1506 STDMETHODIMP SetNotify(IMemAllocatorNotifyCallbackTemp *pNotify);
1508 STDMETHODIMP GetFreeCount(__out LONG *plBuffersFree);
1511 void NotifySample();
1553 HRESULT
Alloc(
void);
1560 __in ALLOCATOR_PROPERTIES* pRequest,
1561 __out ALLOCATOR_PROPERTIES* pActual);
1563 CMemAllocator(__in_opt LPCTSTR , __inout_opt LPUNKNOWN, __inout HRESULT *);
1565 CMemAllocator(__in_opt LPCSTR , __inout_opt LPUNKNOWN, __inout HRESULT *);
1573 , IFilterMapper * pIFM