| 1 | #ifndef WINE_DSHOW_BASEFILT_H
|
|---|
| 2 | #define WINE_DSHOW_BASEFILT_H
|
|---|
| 3 |
|
|---|
| 4 | /*
|
|---|
| 5 | * The following interfaces must be used as a part of aggregation.
|
|---|
| 6 | * The punkControl must not be NULL since all IUnknown methods are
|
|---|
| 7 | * implemented only for aggregation.
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 | /*
|
|---|
| 11 | * implements IBaseFilter (internal)
|
|---|
| 12 | *
|
|---|
| 13 | * a base class for implementing IBaseFilter.
|
|---|
| 14 | */
|
|---|
| 15 |
|
|---|
| 16 | #include "complist.h"
|
|---|
| 17 | #include "mtype.h"
|
|---|
| 18 |
|
|---|
| 19 | typedef struct CBaseFilterHandlers CBaseFilterHandlers;
|
|---|
| 20 | typedef struct CBasePinHandlers CBasePinHandlers;
|
|---|
| 21 |
|
|---|
| 22 | typedef struct CBaseFilterImpl
|
|---|
| 23 | {
|
|---|
| 24 | /* IPersist - IMediaFilter - IBaseFilter */
|
|---|
| 25 | ICOM_VFIELD(IBaseFilter);
|
|---|
| 26 |
|
|---|
| 27 | /* IUnknown fields */
|
|---|
| 28 | IUnknown* punkControl;
|
|---|
| 29 | /* IBaseFilter fields */
|
|---|
| 30 | const CBaseFilterHandlers* pHandlers;
|
|---|
| 31 | CRITICAL_SECTION csFilter;
|
|---|
| 32 | const CLSID* pclsidFilter;
|
|---|
| 33 | QUARTZ_CompList* pInPins; /* a list of IPin-s. */
|
|---|
| 34 | QUARTZ_CompList* pOutPins; /* a list of IPin-s. */
|
|---|
| 35 | IFilterGraph* pfg;
|
|---|
| 36 | DWORD cbNameGraph;
|
|---|
| 37 | WCHAR* pwszNameGraph;
|
|---|
| 38 | IReferenceClock* pClock;
|
|---|
| 39 | REFERENCE_TIME rtStart;
|
|---|
| 40 | FILTER_STATE fstate;
|
|---|
| 41 | } CBaseFilterImpl;
|
|---|
| 42 |
|
|---|
| 43 | struct CBaseFilterHandlers
|
|---|
| 44 | {
|
|---|
| 45 | HRESULT (*pOnActive)( CBaseFilterImpl* pImpl );
|
|---|
| 46 | HRESULT (*pOnInactive)( CBaseFilterImpl* pImpl );
|
|---|
| 47 | };
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | HRESULT CBaseFilterImpl_InitIBaseFilter(
|
|---|
| 51 | CBaseFilterImpl* This, IUnknown* punkControl,
|
|---|
| 52 | const CLSID* pclsidFilter, LPCWSTR lpwszNameGraph,
|
|---|
| 53 | const CBaseFilterHandlers* pHandlers );
|
|---|
| 54 | void CBaseFilterImpl_UninitIBaseFilter( CBaseFilterImpl* This );
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 | /*
|
|---|
| 58 | * Implements IPin, IMemInputPin, and IQualityControl. (internal)
|
|---|
| 59 | *
|
|---|
| 60 | * a base class for implementing IPin.
|
|---|
| 61 | */
|
|---|
| 62 |
|
|---|
| 63 | typedef struct CPinBaseImpl
|
|---|
| 64 | {
|
|---|
| 65 | /* IPin */
|
|---|
| 66 | ICOM_VFIELD(IPin);
|
|---|
| 67 |
|
|---|
| 68 | /* IUnknown fields */
|
|---|
| 69 | IUnknown* punkControl;
|
|---|
| 70 | /* IPin fields */
|
|---|
| 71 | const CBasePinHandlers* pHandlers;
|
|---|
| 72 | DWORD cbIdLen;
|
|---|
| 73 | WCHAR* pwszId;
|
|---|
| 74 | BOOL bOutput;
|
|---|
| 75 |
|
|---|
| 76 | /* you can change AcceptTypes while pcsPin has been hold */
|
|---|
| 77 | const AM_MEDIA_TYPE* pmtAcceptTypes;
|
|---|
| 78 | ULONG cAcceptTypes;
|
|---|
| 79 |
|
|---|
| 80 | CRITICAL_SECTION* pcsPin;
|
|---|
| 81 | CBaseFilterImpl* pFilter;
|
|---|
| 82 | IPin* pPinConnectedTo;
|
|---|
| 83 | AM_MEDIA_TYPE* pmtConn;
|
|---|
| 84 | } CPinBaseImpl;
|
|---|
| 85 |
|
|---|
| 86 | typedef struct CMemInputPinBaseImpl
|
|---|
| 87 | {
|
|---|
| 88 | /* IMemInputPin */
|
|---|
| 89 | ICOM_VFIELD(IMemInputPin);
|
|---|
| 90 |
|
|---|
| 91 | /* IUnknown fields */
|
|---|
| 92 | IUnknown* punkControl;
|
|---|
| 93 | /* IMemInputPin fields */
|
|---|
| 94 | CPinBaseImpl* pPin;
|
|---|
| 95 | IMemAllocator* pAllocator;
|
|---|
| 96 | BOOL bReadonly;
|
|---|
| 97 | } CMemInputPinBaseImpl;
|
|---|
| 98 |
|
|---|
| 99 | typedef struct CQualityControlPassThruImpl
|
|---|
| 100 | {
|
|---|
| 101 | /* IQualityControl */
|
|---|
| 102 | ICOM_VFIELD(IQualityControl);
|
|---|
| 103 |
|
|---|
| 104 | /* IUnknown fields */
|
|---|
| 105 | IUnknown* punkControl;
|
|---|
| 106 | /* IQualityControl fields */
|
|---|
| 107 | CPinBaseImpl* pPin;
|
|---|
| 108 | IQualityControl* pControl;
|
|---|
| 109 | } CQualityControlPassThruImpl;
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 | struct CBasePinHandlers
|
|---|
| 113 | {
|
|---|
| 114 | HRESULT (*pCheckMediaType)( CPinBaseImpl* pImpl, const AM_MEDIA_TYPE* pmt );
|
|---|
| 115 | HRESULT (*pQualityNotify)( CPinBaseImpl* pImpl, IBaseFilter* pFilter, Quality q );
|
|---|
| 116 | HRESULT (*pReceive)( CPinBaseImpl* pImpl, IMediaSample* pSample );
|
|---|
| 117 | HRESULT (*pReceiveCanBlock)( CPinBaseImpl* pImpl );
|
|---|
| 118 | HRESULT (*pEndOfStream)( CPinBaseImpl* pImpl );
|
|---|
| 119 | HRESULT (*pBeginFlush)( CPinBaseImpl* pImpl );
|
|---|
| 120 | HRESULT (*pEndFlush)( CPinBaseImpl* pImpl );
|
|---|
| 121 | HRESULT (*pNewSegment)( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
|
|---|
| 122 | };
|
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 | HRESULT CPinBaseImpl_InitIPin(
|
|---|
| 127 | CPinBaseImpl* This, IUnknown* punkControl,
|
|---|
| 128 | CRITICAL_SECTION* pcsPin,
|
|---|
| 129 | CBaseFilterImpl* pFilter, LPCWSTR pwszId,
|
|---|
| 130 | BOOL bOutput,
|
|---|
| 131 | const CBasePinHandlers* pHandlers );
|
|---|
| 132 | void CPinBaseImpl_UninitIPin( CPinBaseImpl* This );
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 | HRESULT CMemInputPinBaseImpl_InitIMemInputPin(
|
|---|
| 136 | CMemInputPinBaseImpl* This, IUnknown* punkControl,
|
|---|
| 137 | CPinBaseImpl* pPin );
|
|---|
| 138 | void CMemInputPinBaseImpl_UninitIMemInputPin(
|
|---|
| 139 | CMemInputPinBaseImpl* This );
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 | HRESULT CQualityControlPassThruImpl_InitIQualityControl(
|
|---|
| 143 | CQualityControlPassThruImpl* This, IUnknown* punkControl,
|
|---|
| 144 | CPinBaseImpl* pPin );
|
|---|
| 145 | void CQualityControlPassThruImpl_UninitIQualityControl(
|
|---|
| 146 | CQualityControlPassThruImpl* This );
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 | #endif /* WINE_DSHOW_BASEFILT_H */
|
|---|