Module: wine Branch: master Commit: 828d5a0c4a8f13e170916801ac020b90ddcddbf7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=828d5a0c4a8f13e170916801ac...
Author: Chris Robinson chris.kcat@gmail.com Date: Fri Apr 6 21:18:25 2007 -0700
quartz: Add a cleanup callback for parser filters to call on release.
---
dlls/quartz/avisplit.c | 2 +- dlls/quartz/parser.c | 6 +++++- dlls/quartz/parser.h | 4 +++- dlls/quartz/waveparser.c | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/quartz/avisplit.c b/dlls/quartz/avisplit.c index e90035d..20bfe92 100644 --- a/dlls/quartz/avisplit.c +++ b/dlls/quartz/avisplit.c @@ -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; diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 01d215f..8e85456 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -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);
diff --git a/dlls/quartz/parser.h b/dlls/quartz/parser.h index fec1d37..25f1d6d 100644 --- a/dlls/quartz/parser.h +++ b/dlls/quartz/parser.h @@ -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); diff --git a/dlls/quartz/waveparser.c b/dlls/quartz/waveparser.c index 5cd979f..7feeadf 100644 --- a/dlls/quartz/waveparser.c +++ b/dlls/quartz/waveparser.c @@ -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;