123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- #ifndef __TRANSIP__
- #define __TRANSIP__
- class CTransInPlaceFilter;
- class CTransInPlaceInputPin : public CTransformInputPin
- {
- protected:
- CTransInPlaceFilter * const m_pTIPFilter;
- BOOL m_bReadOnly;
- public:
- CTransInPlaceInputPin(
- __in_opt LPCTSTR pObjectName,
- __inout CTransInPlaceFilter *pFilter,
- __inout HRESULT *phr,
- __in_opt LPCWSTR pName);
-
-
- STDMETHODIMP EnumMediaTypes( __deref_out IEnumMediaTypes **ppEnum );
-
- HRESULT CheckMediaType(const CMediaType* pmt);
-
- STDMETHODIMP GetAllocator(__deref_out IMemAllocator ** ppAllocator);
-
-
- STDMETHODIMP NotifyAllocator(IMemAllocator * pAllocator,
- BOOL bReadOnly);
-
-
- __out IMemAllocator * PeekAllocator() const
- { return m_pAllocator; }
-
- STDMETHODIMP GetAllocatorRequirements(__out ALLOCATOR_PROPERTIES *pProps);
- HRESULT CompleteConnect(IPin *pReceivePin);
- inline const BOOL ReadOnly() { return m_bReadOnly ; }
- };
- class CTransInPlaceOutputPin : public CTransformOutputPin
- {
- protected:
-
- CTransInPlaceFilter * const m_pTIPFilter;
- public:
- CTransInPlaceOutputPin(
- __in_opt LPCTSTR pObjectName,
- __inout CTransInPlaceFilter *pFilter,
- __inout HRESULT *phr,
- __in_opt LPCWSTR pName);
-
-
-
-
-
-
-
- STDMETHODIMP EnumMediaTypes( __deref_out IEnumMediaTypes **ppEnum );
-
- HRESULT CheckMediaType(const CMediaType* pmt);
-
-
- void SetAllocator(IMemAllocator * pAllocator);
- __out_opt IMemInputPin * ConnectedIMemInputPin()
- { return m_pInputPin; }
-
-
- __out IMemAllocator * PeekAllocator() const
- { return m_pAllocator; }
- HRESULT CompleteConnect(IPin *pReceivePin);
- };
- class AM_NOVTABLE CTransInPlaceFilter : public CTransformFilter
- {
- public:
-
-
- virtual CBasePin *GetPin(int n);
- public:
-
-
-
- CTransInPlaceFilter(__in_opt LPCTSTR, __inout_opt LPUNKNOWN, REFCLSID clsid, __inout HRESULT *,
- bool bModifiesData = true);
- #ifdef UNICODE
- CTransInPlaceFilter(__in_opt LPCSTR, __inout_opt LPUNKNOWN, REFCLSID clsid, __inout HRESULT *,
- bool bModifiesData = true);
- #endif
-
-
-
-
- HRESULT GetMediaType(int iPosition, __inout CMediaType *pMediaType)
- { DbgBreak("CTransInPlaceFilter::GetMediaType should never be called");
- return E_UNEXPECTED;
- }
-
- HRESULT DecideBufferSize(IMemAllocator*, __inout ALLOCATOR_PROPERTIES *);
-
-
-
-
- HRESULT CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut)
- {
- return S_OK;
- };
-
-
-
- HRESULT CompleteConnect(PIN_DIRECTION dir,IPin *pReceivePin);
-
- virtual HRESULT Receive(IMediaSample *pSample);
-
-
-
- virtual HRESULT Transform(IMediaSample *pSample) PURE;
-
-
- #ifdef PERF
-
-
- virtual void RegisterPerfId()
- {m_idTransInPlace = MSR_REGISTER(TEXT("TransInPlace"));}
- #endif
- protected:
- __out_opt IMediaSample * CTransInPlaceFilter::Copy(IMediaSample *pSource);
- #ifdef PERF
- int m_idTransInPlace;
- #endif
- bool m_bModifiesData;
-
- friend class CTransInPlaceInputPin;
- friend class CTransInPlaceOutputPin;
- __out CTransInPlaceInputPin *InputPin() const
- {
- return (CTransInPlaceInputPin *)m_pInput;
- };
- __out CTransInPlaceOutputPin *OutputPin() const
- {
- return (CTransInPlaceOutputPin *)m_pOutput;
- };
-
- BOOL TypesMatch()
- {
- return InputPin()->CurrentMediaType() ==
- OutputPin()->CurrentMediaType();
- }
-
- BOOL UsingDifferentAllocators() const
- {
- return InputPin()->PeekAllocator() != OutputPin()->PeekAllocator();
- }
- };
- #endif
|