2 * Implements IBaseFilter for transform filters. (internal)
4 * hidenori@a2.ctktv.ne.jp
7 #ifndef WINE_DSHOW_XFORM_H
8 #define WINE_DSHOW_XFORM_H
15 typedef struct CTransformBaseImpl CTransformBaseImpl;
16 typedef struct CTransformBaseInPinImpl CTransformBaseInPinImpl;
17 typedef struct CTransformBaseOutPinImpl CTransformBaseOutPinImpl;
18 typedef struct TransformBaseHandlers TransformBaseHandlers;
20 struct CTransformBaseImpl
23 CBaseFilterImpl basefilter;
25 CTransformBaseInPinImpl* pInPin;
26 CTransformBaseOutPinImpl* pOutPin;
27 CSeekingPassThru* pSeekPass;
29 CRITICAL_SECTION csReceive;
30 IMemAllocator* m_pOutPinAllocator;
31 BOOL m_bPreCopy; /* sample must be copied */
32 BOOL m_bReuseSample; /* sample must be reused */
34 IMediaSample* m_pSample;
37 const TransformBaseHandlers* m_pHandler;
41 struct CTransformBaseInPinImpl
45 CMemInputPinBaseImpl meminput;
47 CTransformBaseImpl* pFilter;
50 struct CTransformBaseOutPinImpl
54 CQualityControlPassThruImpl qcontrol;
55 QUARTZ_IFDelegation qiext;
57 CTransformBaseImpl* pFilter;
60 struct TransformBaseHandlers
62 /* all methods must be implemented */
64 HRESULT (*pInit)( CTransformBaseImpl* pImpl );
65 HRESULT (*pCleanup)( CTransformBaseImpl* pImpl );
67 /* pmtOut may be NULL */
68 HRESULT (*pCheckMediaType)( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut );
69 /* get output types */
70 HRESULT (*pGetOutputTypes)( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE** ppmtAcceptTypes, ULONG* pcAcceptTypes );
71 /* get allocator properties */
72 HRESULT (*pGetAllocProp)( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut, ALLOCATOR_PROPERTIES* pProp, BOOL* pbTransInPlace, BOOL* pbTryToReuseSample );
74 /* prepare the filter */
75 HRESULT (*pBeginTransform)( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut, BOOL bReuseSample );
76 /* process a sample */
77 HRESULT (*pTransform)( CTransformBaseImpl* pImpl, IMediaSample* pSampIn, IMediaSample* pSampOut );
78 /* unprepare the filter */
79 HRESULT (*pEndTransform)( CTransformBaseImpl* pImpl );
82 #define CTransformBaseImpl_THIS(iface,member) CTransformBaseImpl* This = ((CTransformBaseImpl*)(((char*)iface)-offsetof(CTransformBaseImpl,member)))
83 #define CTransformBaseInPinImpl_THIS(iface,member) CTransformBaseInPinImpl* This = ((CTransformBaseInPinImpl*)(((char*)iface)-offsetof(CTransformBaseInPinImpl,member)))
84 #define CTransformBaseOutPinImpl_THIS(iface,member) CTransformBaseOutPinImpl* This = ((CTransformBaseOutPinImpl*)(((char*)iface)-offsetof(CTransformBaseOutPinImpl,member)))
87 HRESULT QUARTZ_CreateTransformBase(
88 IUnknown* punkOuter,void** ppobj,
89 const CLSID* pclsidTransformBase,
90 LPCWSTR pwszTransformBaseName,
91 LPCWSTR pwszInPinName,
92 LPCWSTR pwszOutPinName,
93 const TransformBaseHandlers* pHandler );
94 HRESULT QUARTZ_CreateTransformBaseInPin(
95 CTransformBaseImpl* pFilter,
96 CRITICAL_SECTION* pcsPin,
97 CRITICAL_SECTION* pcsPinReceive,
98 CTransformBaseInPinImpl** ppPin,
99 LPCWSTR pwszPinName );
100 HRESULT QUARTZ_CreateTransformBaseOutPin(
101 CTransformBaseImpl* pFilter,
102 CRITICAL_SECTION* pcsPin,
103 CTransformBaseOutPinImpl** ppPin,
104 LPCWSTR pwszPinName );
107 HRESULT QUARTZ_CreateAVIDec(IUnknown* punkOuter,void** ppobj);
108 HRESULT QUARTZ_CreateColour(IUnknown* punkOuter,void** ppobj);
110 #endif /* WINE_DSHOW_XFORM_H */