Implement ResetDC and PHYSICALOFFSET[X|Y] devcaps.
[wine] / dlls / quartz / xform.h
1 /*
2  * Implements IBaseFilter for transform filters. (internal)
3  *
4  * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #ifndef WINE_DSHOW_XFORM_H
22 #define WINE_DSHOW_XFORM_H
23
24 #include "iunk.h"
25 #include "basefilt.h"
26 #include "seekpass.h"
27
28
29 typedef struct CTransformBaseImpl CTransformBaseImpl;
30 typedef struct CTransformBaseInPinImpl CTransformBaseInPinImpl;
31 typedef struct CTransformBaseOutPinImpl CTransformBaseOutPinImpl;
32 typedef struct TransformBaseHandlers    TransformBaseHandlers;
33
34 struct CTransformBaseImpl
35 {
36         QUARTZ_IUnkImpl unk;
37         CBaseFilterImpl basefilter;
38
39         CTransformBaseInPinImpl*        pInPin;
40         CTransformBaseOutPinImpl*       pOutPin;
41         CSeekingPassThru*       pSeekPass;
42
43         CRITICAL_SECTION        csReceive;
44         IMemAllocator*  m_pOutPinAllocator;
45         BOOL    m_bPreCopy; /* sample must be copied */
46         BOOL    m_bReuseSample; /* sample must be reused */
47         BOOL    m_bInFlush;
48         IMediaSample*   m_pSample;
49
50         BOOL    m_bFiltering;
51         const TransformBaseHandlers*    m_pHandler;
52         void*   m_pUserData;
53 };
54
55 struct CTransformBaseInPinImpl
56 {
57         QUARTZ_IUnkImpl unk;
58         CPinBaseImpl    pin;
59         CMemInputPinBaseImpl    meminput;
60
61         CTransformBaseImpl*     pFilter;
62 };
63
64 struct CTransformBaseOutPinImpl
65 {
66         QUARTZ_IUnkImpl unk;
67         CPinBaseImpl    pin;
68         CQualityControlPassThruImpl     qcontrol;
69         QUARTZ_IFDelegation     qiext;
70
71         CTransformBaseImpl*     pFilter;
72 };
73
74 struct TransformBaseHandlers
75 {
76         /* all methods must be implemented */
77
78         HRESULT (*pInit)( CTransformBaseImpl* pImpl );
79         HRESULT (*pCleanup)( CTransformBaseImpl* pImpl );
80
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 );
87
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 );
95 };
96
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)))
100
101
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 );
120
121
122 HRESULT QUARTZ_CreateAVIDec(IUnknown* punkOuter,void** ppobj);
123 HRESULT QUARTZ_CreateColour(IUnknown* punkOuter,void** ppobj);
124 HRESULT QUARTZ_CreateACMWrapper(IUnknown* punkOuter,void** ppobj);
125
126 #endif  /* WINE_DSHOW_XFORM_H */