2 * Implements IBaseFilter for transform filters. (internal)
4 * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef WINE_DSHOW_XFORM_H
22 #define WINE_DSHOW_XFORM_H
29 typedef struct CTransformBaseImpl CTransformBaseImpl;
30 typedef struct CTransformBaseInPinImpl CTransformBaseInPinImpl;
31 typedef struct CTransformBaseOutPinImpl CTransformBaseOutPinImpl;
32 typedef struct TransformBaseHandlers TransformBaseHandlers;
34 struct CTransformBaseImpl
37 CBaseFilterImpl basefilter;
39 CTransformBaseInPinImpl* pInPin;
40 CTransformBaseOutPinImpl* pOutPin;
41 CSeekingPassThru* pSeekPass;
43 CRITICAL_SECTION csReceive;
44 IMemAllocator* m_pOutPinAllocator;
45 BOOL m_bPreCopy; /* sample must be copied */
46 BOOL m_bReuseSample; /* sample must be reused */
48 IMediaSample* m_pSample;
51 const TransformBaseHandlers* m_pHandler;
55 struct CTransformBaseInPinImpl
59 CMemInputPinBaseImpl meminput;
61 CTransformBaseImpl* pFilter;
64 struct CTransformBaseOutPinImpl
68 CQualityControlPassThruImpl qcontrol;
69 QUARTZ_IFDelegation qiext;
71 CTransformBaseImpl* pFilter;
74 struct TransformBaseHandlers
76 /* all methods must be implemented */
78 HRESULT (*pInit)( CTransformBaseImpl* pImpl );
79 HRESULT (*pCleanup)( CTransformBaseImpl* pImpl );
81 /* pmtOut may be NULL */
82 HRESULT (*pCheckMediaType)( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut );
83 /* get output types */
84 HRESULT (*pGetOutputTypes)( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE** ppmtAcceptTypes, ULONG* pcAcceptTypes );
85 /* get allocator properties */
86 HRESULT (*pGetAllocProp)( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut, ALLOCATOR_PROPERTIES* pProp, BOOL* pbTransInPlace, BOOL* pbTryToReuseSample );
88 /* prepare the filter */
89 HRESULT (*pBeginTransform)( CTransformBaseImpl* pImpl, const AM_MEDIA_TYPE* pmtIn, const AM_MEDIA_TYPE* pmtOut, BOOL bReuseSample );
90 /* process a sample */
91 HRESULT (*pProcessReceive)( CTransformBaseImpl* pImpl, IMediaSample* pSampIn ); /* override Transform */
92 HRESULT (*pTransform)( CTransformBaseImpl* pImpl, IMediaSample* pSampIn, IMediaSample* pSampOut );
93 /* unprepare the filter */
94 HRESULT (*pEndTransform)( CTransformBaseImpl* pImpl );
97 #define CTransformBaseImpl_THIS(iface,member) CTransformBaseImpl* This = ((CTransformBaseImpl*)(((char*)iface)-offsetof(CTransformBaseImpl,member)))
98 #define CTransformBaseInPinImpl_THIS(iface,member) CTransformBaseInPinImpl* This = ((CTransformBaseInPinImpl*)(((char*)iface)-offsetof(CTransformBaseInPinImpl,member)))
99 #define CTransformBaseOutPinImpl_THIS(iface,member) CTransformBaseOutPinImpl* This = ((CTransformBaseOutPinImpl*)(((char*)iface)-offsetof(CTransformBaseOutPinImpl,member)))
102 HRESULT QUARTZ_CreateTransformBase(
103 IUnknown* punkOuter,void** ppobj,
104 const CLSID* pclsidTransformBase,
105 LPCWSTR pwszTransformBaseName,
106 LPCWSTR pwszInPinName,
107 LPCWSTR pwszOutPinName,
108 const TransformBaseHandlers* pHandler );
109 HRESULT QUARTZ_CreateTransformBaseInPin(
110 CTransformBaseImpl* pFilter,
111 CRITICAL_SECTION* pcsPin,
112 CRITICAL_SECTION* pcsPinReceive,
113 CTransformBaseInPinImpl** ppPin,
114 LPCWSTR pwszPinName );
115 HRESULT QUARTZ_CreateTransformBaseOutPin(
116 CTransformBaseImpl* pFilter,
117 CRITICAL_SECTION* pcsPin,
118 CTransformBaseOutPinImpl** ppPin,
119 LPCWSTR pwszPinName );
122 HRESULT QUARTZ_CreateAVIDec(IUnknown* punkOuter,void** ppobj);
123 HRESULT QUARTZ_CreateColour(IUnknown* punkOuter,void** ppobj);
124 HRESULT QUARTZ_CreateACMWrapper(IUnknown* punkOuter,void** ppobj);
126 #endif /* WINE_DSHOW_XFORM_H */