2001-09-26 00:37:04 +02:00
|
|
|
#ifndef WINE_DSHOW_BASEFILT_H
|
|
|
|
#define WINE_DSHOW_BASEFILT_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The following interfaces must be used as a part of aggregation.
|
|
|
|
* The punkControl must not be NULL since all IUnknown methods are
|
|
|
|
* implemented only for aggregation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* implements IBaseFilter (internal)
|
|
|
|
*
|
|
|
|
* a base class for implementing IBaseFilter.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "complist.h"
|
2001-10-01 22:53:58 +02:00
|
|
|
#include "mtype.h"
|
|
|
|
|
|
|
|
typedef struct CBaseFilterHandlers CBaseFilterHandlers;
|
|
|
|
typedef struct CBasePinHandlers CBasePinHandlers;
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
typedef struct CBaseFilterImpl
|
|
|
|
{
|
2001-10-01 22:53:58 +02:00
|
|
|
/* IPersist - IMediaFilter - IBaseFilter */
|
2001-09-26 00:37:04 +02:00
|
|
|
ICOM_VFIELD(IBaseFilter);
|
|
|
|
|
|
|
|
/* IUnknown fields */
|
|
|
|
IUnknown* punkControl;
|
|
|
|
/* IBaseFilter fields */
|
2001-10-01 22:53:58 +02:00
|
|
|
const CBaseFilterHandlers* pHandlers;
|
2001-09-26 00:37:04 +02:00
|
|
|
CRITICAL_SECTION csFilter;
|
|
|
|
const CLSID* pclsidFilter;
|
|
|
|
QUARTZ_CompList* pInPins; /* a list of IPin-s. */
|
|
|
|
QUARTZ_CompList* pOutPins; /* a list of IPin-s. */
|
|
|
|
IFilterGraph* pfg;
|
|
|
|
DWORD cbNameGraph;
|
|
|
|
WCHAR* pwszNameGraph;
|
|
|
|
IReferenceClock* pClock;
|
|
|
|
REFERENCE_TIME rtStart;
|
|
|
|
FILTER_STATE fstate;
|
|
|
|
} CBaseFilterImpl;
|
|
|
|
|
2001-10-01 22:53:58 +02:00
|
|
|
struct CBaseFilterHandlers
|
|
|
|
{
|
|
|
|
HRESULT (*pOnActive)( CBaseFilterImpl* pImpl );
|
|
|
|
HRESULT (*pOnInactive)( CBaseFilterImpl* pImpl );
|
2001-10-08 22:56:08 +02:00
|
|
|
HRESULT (*pOnStop)( CBaseFilterImpl* pImpl );
|
2001-10-01 22:53:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
HRESULT CBaseFilterImpl_InitIBaseFilter(
|
|
|
|
CBaseFilterImpl* This, IUnknown* punkControl,
|
2001-10-01 22:53:58 +02:00
|
|
|
const CLSID* pclsidFilter, LPCWSTR lpwszNameGraph,
|
|
|
|
const CBaseFilterHandlers* pHandlers );
|
2001-09-26 00:37:04 +02:00
|
|
|
void CBaseFilterImpl_UninitIBaseFilter( CBaseFilterImpl* This );
|
|
|
|
|
|
|
|
|
2001-10-08 22:56:08 +02:00
|
|
|
HRESULT CBaseFilterImpl_MediaEventNotify(
|
|
|
|
CBaseFilterImpl* This, long lEvent,LONG_PTR lParam1,LONG_PTR lParam2);
|
|
|
|
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
/*
|
2001-10-01 22:53:58 +02:00
|
|
|
* Implements IPin, IMemInputPin, and IQualityControl. (internal)
|
2001-09-26 00:37:04 +02:00
|
|
|
*
|
|
|
|
* a base class for implementing IPin.
|
|
|
|
*/
|
|
|
|
|
2001-10-08 22:56:08 +02:00
|
|
|
typedef struct OutputPinAsyncImpl OutputPinAsyncImpl;
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
typedef struct CPinBaseImpl
|
|
|
|
{
|
2001-10-01 22:53:58 +02:00
|
|
|
/* IPin */
|
2001-09-26 00:37:04 +02:00
|
|
|
ICOM_VFIELD(IPin);
|
|
|
|
|
|
|
|
/* IUnknown fields */
|
|
|
|
IUnknown* punkControl;
|
|
|
|
/* IPin fields */
|
2001-10-01 22:53:58 +02:00
|
|
|
const CBasePinHandlers* pHandlers;
|
2001-09-26 00:37:04 +02:00
|
|
|
DWORD cbIdLen;
|
|
|
|
WCHAR* pwszId;
|
|
|
|
BOOL bOutput;
|
|
|
|
|
2001-10-01 22:53:58 +02:00
|
|
|
/* you can change AcceptTypes while pcsPin has been hold */
|
|
|
|
const AM_MEDIA_TYPE* pmtAcceptTypes;
|
|
|
|
ULONG cAcceptTypes;
|
|
|
|
|
|
|
|
CRITICAL_SECTION* pcsPin;
|
2001-09-26 00:37:04 +02:00
|
|
|
CBaseFilterImpl* pFilter;
|
|
|
|
IPin* pPinConnectedTo;
|
2001-10-08 22:56:08 +02:00
|
|
|
IMemInputPin* pMemInputPinConnectedTo;
|
2001-09-26 00:37:04 +02:00
|
|
|
AM_MEDIA_TYPE* pmtConn;
|
2001-10-08 22:56:08 +02:00
|
|
|
OutputPinAsyncImpl* pAsyncOut; /* for asynchronous output */
|
2001-09-26 00:37:04 +02:00
|
|
|
} CPinBaseImpl;
|
|
|
|
|
|
|
|
typedef struct CMemInputPinBaseImpl
|
|
|
|
{
|
2001-10-01 22:53:58 +02:00
|
|
|
/* IMemInputPin */
|
2001-09-26 00:37:04 +02:00
|
|
|
ICOM_VFIELD(IMemInputPin);
|
|
|
|
|
|
|
|
/* IUnknown fields */
|
|
|
|
IUnknown* punkControl;
|
|
|
|
/* IMemInputPin fields */
|
2001-10-01 22:53:58 +02:00
|
|
|
CPinBaseImpl* pPin;
|
2001-09-26 00:37:04 +02:00
|
|
|
IMemAllocator* pAllocator;
|
|
|
|
BOOL bReadonly;
|
|
|
|
} CMemInputPinBaseImpl;
|
|
|
|
|
2001-10-01 22:53:58 +02:00
|
|
|
typedef struct CQualityControlPassThruImpl
|
|
|
|
{
|
|
|
|
/* IQualityControl */
|
|
|
|
ICOM_VFIELD(IQualityControl);
|
|
|
|
|
|
|
|
/* IUnknown fields */
|
|
|
|
IUnknown* punkControl;
|
|
|
|
/* IQualityControl fields */
|
|
|
|
CPinBaseImpl* pPin;
|
|
|
|
IQualityControl* pControl;
|
|
|
|
} CQualityControlPassThruImpl;
|
|
|
|
|
|
|
|
|
|
|
|
struct CBasePinHandlers
|
|
|
|
{
|
2001-10-08 22:56:08 +02:00
|
|
|
HRESULT (*pOnPreConnect)( CPinBaseImpl* pImpl, IPin* pPin );
|
|
|
|
HRESULT (*pOnPostConnect)( CPinBaseImpl* pImpl, IPin* pPin );
|
|
|
|
HRESULT (*pOnDisconnect)( CPinBaseImpl* pImpl );
|
2001-10-01 22:53:58 +02:00
|
|
|
HRESULT (*pCheckMediaType)( CPinBaseImpl* pImpl, const AM_MEDIA_TYPE* pmt );
|
|
|
|
HRESULT (*pQualityNotify)( CPinBaseImpl* pImpl, IBaseFilter* pFilter, Quality q );
|
|
|
|
HRESULT (*pReceive)( CPinBaseImpl* pImpl, IMediaSample* pSample );
|
|
|
|
HRESULT (*pReceiveCanBlock)( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT (*pEndOfStream)( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT (*pBeginFlush)( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT (*pEndFlush)( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT (*pNewSegment)( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
|
|
|
|
HRESULT CPinBaseImpl_InitIPin(
|
|
|
|
CPinBaseImpl* This, IUnknown* punkControl,
|
2001-10-01 22:53:58 +02:00
|
|
|
CRITICAL_SECTION* pcsPin,
|
2001-09-26 00:37:04 +02:00
|
|
|
CBaseFilterImpl* pFilter, LPCWSTR pwszId,
|
2001-10-01 22:53:58 +02:00
|
|
|
BOOL bOutput,
|
|
|
|
const CBasePinHandlers* pHandlers );
|
2001-09-26 00:37:04 +02:00
|
|
|
void CPinBaseImpl_UninitIPin( CPinBaseImpl* This );
|
|
|
|
|
|
|
|
|
|
|
|
HRESULT CMemInputPinBaseImpl_InitIMemInputPin(
|
|
|
|
CMemInputPinBaseImpl* This, IUnknown* punkControl,
|
2001-10-01 22:53:58 +02:00
|
|
|
CPinBaseImpl* pPin );
|
2001-09-26 00:37:04 +02:00
|
|
|
void CMemInputPinBaseImpl_UninitIMemInputPin(
|
|
|
|
CMemInputPinBaseImpl* This );
|
|
|
|
|
|
|
|
|
2001-10-01 22:53:58 +02:00
|
|
|
HRESULT CQualityControlPassThruImpl_InitIQualityControl(
|
|
|
|
CQualityControlPassThruImpl* This, IUnknown* punkControl,
|
|
|
|
CPinBaseImpl* pPin );
|
|
|
|
void CQualityControlPassThruImpl_UninitIQualityControl(
|
|
|
|
CQualityControlPassThruImpl* This );
|
|
|
|
|
|
|
|
|
2001-10-08 22:56:08 +02:00
|
|
|
HRESULT CPinBaseImpl_SendSample( CPinBaseImpl* This, IMediaSample* pSample );
|
2001-10-22 21:03:26 +02:00
|
|
|
HRESULT CPinBaseImpl_SendReceiveCanBlock( CPinBaseImpl* This );
|
2001-10-08 22:56:08 +02:00
|
|
|
HRESULT CPinBaseImpl_SendEndOfStream( CPinBaseImpl* This );
|
|
|
|
HRESULT CPinBaseImpl_SendBeginFlush( CPinBaseImpl* This );
|
|
|
|
HRESULT CPinBaseImpl_SendEndFlush( CPinBaseImpl* This );
|
|
|
|
HRESULT CPinBaseImpl_SendNewSegment( CPinBaseImpl* This, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* handlers for output pins.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
HRESULT OutputPinSync_Receive( CPinBaseImpl* pImpl, IMediaSample* pSample );
|
|
|
|
HRESULT OutputPinSync_ReceiveCanBlock( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT OutputPinSync_EndOfStream( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT OutputPinSync_BeginFlush( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT OutputPinSync_EndFlush( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT OutputPinSync_NewSegment( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* handlers for output pins (async).
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
HRESULT OutputPinAsync_OnActive( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT OutputPinAsync_OnInactive( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT OutputPinAsync_Receive( CPinBaseImpl* pImpl, IMediaSample* pSample );
|
|
|
|
HRESULT OutputPinAsync_ReceiveCanBlock( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT OutputPinAsync_EndOfStream( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT OutputPinAsync_BeginFlush( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT OutputPinAsync_EndFlush( CPinBaseImpl* pImpl );
|
|
|
|
HRESULT OutputPinAsync_NewSegment( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
|
|
|
|
|
|
|
|
|
2001-09-26 00:37:04 +02:00
|
|
|
|
|
|
|
#endif /* WINE_DSHOW_BASEFILT_H */
|