quartz: Add a cleanup callback for parser filters to call on release.
This commit is contained in:
parent
ea0d7f17ca
commit
828d5a0c4a
|
@ -594,7 +594,7 @@ HRESULT AVISplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
|
|||
|
||||
This->pCurrentSample = NULL;
|
||||
|
||||
hr = Parser_Create(&(This->Parser), &CLSID_AviSplitter, AVISplitter_Sample, AVISplitter_QueryAccept, AVISplitter_InputPin_PreConnect);
|
||||
hr = Parser_Create(&(This->Parser), &CLSID_AviSplitter, AVISplitter_Sample, AVISplitter_QueryAccept, AVISplitter_InputPin_PreConnect, NULL);
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
|
|
@ -60,7 +60,7 @@ static inline Parser_OutputPin *impl_from_IMediaSeeking( IMediaSeeking *iface )
|
|||
}
|
||||
|
||||
|
||||
HRESULT Parser_Create(ParserImpl* pParser, const CLSID* pClsid, PFN_PROCESS_SAMPLE fnProcessSample, PFN_QUERY_ACCEPT fnQueryAccept, PFN_PRE_CONNECT fnPreConnect)
|
||||
HRESULT Parser_Create(ParserImpl* pParser, const CLSID* pClsid, PFN_PROCESS_SAMPLE fnProcessSample, PFN_QUERY_ACCEPT fnQueryAccept, PFN_PRE_CONNECT fnPreConnect, PFN_CLEANUP fnCleanup)
|
||||
{
|
||||
HRESULT hr;
|
||||
PIN_INFO piInput;
|
||||
|
@ -74,6 +74,7 @@ HRESULT Parser_Create(ParserImpl* pParser, const CLSID* pClsid, PFN_PROCESS_SAMP
|
|||
pParser->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ParserImpl.csFilter");
|
||||
pParser->state = State_Stopped;
|
||||
pParser->pClock = NULL;
|
||||
pParser->fnCleanup = fnCleanup;
|
||||
ZeroMemory(&pParser->filterInfo, sizeof(FILTER_INFO));
|
||||
|
||||
pParser->cStreams = 0;
|
||||
|
@ -187,6 +188,9 @@ static ULONG WINAPI Parser_Release(IBaseFilter * iface)
|
|||
{
|
||||
ULONG i;
|
||||
|
||||
if (This->fnCleanup)
|
||||
This->fnCleanup(This);
|
||||
|
||||
if (This->pClock)
|
||||
IReferenceClock_Release(This->pClock);
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ typedef struct ParserImpl ParserImpl;
|
|||
typedef HRESULT (*PFN_PROCESS_SAMPLE) (LPVOID iface, IMediaSample * pSample);
|
||||
typedef HRESULT (*PFN_QUERY_ACCEPT) (LPVOID iface, const AM_MEDIA_TYPE * pmt);
|
||||
typedef HRESULT (*PFN_PRE_CONNECT) (IPin * iface, IPin * pConnectPin);
|
||||
typedef HRESULT (*PFN_CLEANUP) (LPVOID iface);
|
||||
|
||||
struct ParserImpl
|
||||
{
|
||||
|
@ -33,6 +34,7 @@ struct ParserImpl
|
|||
FILTER_STATE state;
|
||||
REFERENCE_TIME rtStreamStart;
|
||||
IReferenceClock * pClock;
|
||||
PFN_CLEANUP fnCleanup;
|
||||
FILTER_INFO filterInfo;
|
||||
CLSID clsid;
|
||||
|
||||
|
@ -54,4 +56,4 @@ typedef struct Parser_OutputPin
|
|||
} Parser_OutputPin;
|
||||
|
||||
HRESULT Parser_AddPin(ParserImpl * This, PIN_INFO * piOutput, ALLOCATOR_PROPERTIES * props, AM_MEDIA_TYPE * amt, float fSamplesPerSec, DWORD dwSampleSize, DWORD dwLength);
|
||||
HRESULT Parser_Create(ParserImpl*, const CLSID*, PFN_PROCESS_SAMPLE, PFN_QUERY_ACCEPT, PFN_PRE_CONNECT);
|
||||
HRESULT Parser_Create(ParserImpl*, const CLSID*, PFN_PROCESS_SAMPLE, PFN_QUERY_ACCEPT, PFN_PRE_CONNECT, PFN_CLEANUP);
|
||||
|
|
|
@ -318,7 +318,7 @@ HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv)
|
|||
|
||||
This->pCurrentSample = NULL;
|
||||
|
||||
hr = Parser_Create(&(This->Parser), &CLSID_WAVEParser, WAVEParser_Sample, WAVEParser_QueryAccept, WAVEParser_InputPin_PreConnect);
|
||||
hr = Parser_Create(&(This->Parser), &CLSID_WAVEParser, WAVEParser_Sample, WAVEParser_QueryAccept, WAVEParser_InputPin_PreConnect, NULL);
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
|
Loading…
Reference in New Issue