Commit b883b69e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/parser: Pass a BaseFilterFuncTable to Parser_Create().

parent 461cee21
......@@ -1429,6 +1429,11 @@ static const IBaseFilterVtbl AVISplitterImpl_Vtbl =
Parser_QueryVendorInfo
};
static const BaseFilterFuncTable avi_splitter_func_table =
{
.filter_get_pin = parser_get_pin,
};
HRESULT AVISplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
{
static const WCHAR sink_name[] = {'i','n','p','u','t',' ','p','i','n',0};
......@@ -1449,7 +1454,7 @@ HRESULT AVISplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
This->oldindex = NULL;
hr = Parser_Create(&This->Parser, &AVISplitterImpl_Vtbl, &CLSID_AviSplitter,
sink_name, AVISplitter_Sample, AVISplitter_QueryAccept,
&avi_splitter_func_table, sink_name, AVISplitter_Sample, AVISplitter_QueryAccept,
AVISplitter_InputPin_PreConnect, AVISplitter_Flush,
AVISplitter_Disconnect, AVISplitter_first_request,
AVISplitter_done_process, NULL, AVISplitter_seek, NULL);
......
......@@ -868,6 +868,11 @@ static const IAMStreamSelectVtbl AMStreamSelectVtbl =
AMStreamSelect_Enable
};
static const BaseFilterFuncTable mpeg_splitter_func_table =
{
.filter_get_pin = parser_get_pin,
};
HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
{
static const WCHAR sink_name[] = {'I','n','p','u','t',0};
......@@ -887,7 +892,7 @@ HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
ZeroMemory(This, sizeof(MPEGSplitterImpl));
hr = Parser_Create(&This->Parser, &MPEGSplitter_Vtbl, &CLSID_MPEG1Splitter,
sink_name, MPEGSplitter_process_sample, MPEGSplitter_query_accept,
&mpeg_splitter_func_table, sink_name, MPEGSplitter_process_sample, MPEGSplitter_query_accept,
MPEGSplitter_pre_connect, MPEGSplitter_cleanup, MPEGSplitter_disconnect,
MPEGSplitter_first_request, NULL, NULL, MPEGSplitter_seek, NULL);
if (FAILED(hr))
......
......@@ -62,7 +62,7 @@ static inline ParserImpl *impl_from_BaseFilter( BaseFilter *iface )
return CONTAINING_RECORD(iface, ParserImpl, filter);
}
static IPin *parser_get_pin(BaseFilter *iface, unsigned int index)
IPin *parser_get_pin(BaseFilter *iface, unsigned int index)
{
ParserImpl *filter = impl_from_BaseFilter(iface);
......@@ -73,13 +73,9 @@ static IPin *parser_get_pin(BaseFilter *iface, unsigned int index)
return filter->ppPins[index];
}
static const BaseFilterFuncTable BaseFuncTable = {
.filter_get_pin = parser_get_pin,
};
HRESULT Parser_Create(ParserImpl *pParser, const IBaseFilterVtbl *Parser_Vtbl,
const CLSID* pClsid, const WCHAR *sink_name, PFN_PROCESS_SAMPLE fnProcessSample,
PFN_QUERY_ACCEPT fnQueryAccept, PFN_PRE_CONNECT fnPreConnect,
const CLSID *pClsid, const BaseFilterFuncTable *func_table, const WCHAR *sink_name,
PFN_PROCESS_SAMPLE fnProcessSample, PFN_QUERY_ACCEPT fnQueryAccept, PFN_PRE_CONNECT fnPreConnect,
PFN_CLEANUP fnCleanup, PFN_DISCONNECT fnDisconnect, REQUESTPROC fnRequest,
STOPPROCESSPROC fnDone, SourceSeeking_ChangeStop stop,
SourceSeeking_ChangeStart start, SourceSeeking_ChangeRate rate)
......@@ -88,7 +84,7 @@ HRESULT Parser_Create(ParserImpl *pParser, const IBaseFilterVtbl *Parser_Vtbl,
PIN_INFO piInput;
/* pTransformFilter is already allocated */
BaseFilter_Init(&pParser->filter, Parser_Vtbl, pClsid, (DWORD_PTR)(__FILE__ ": ParserImpl.csFilter"), &BaseFuncTable);
BaseFilter_Init(&pParser->filter, Parser_Vtbl, pClsid, (DWORD_PTR)(__FILE__ ": ParserImpl.csFilter"), func_table);
pParser->fnDisconnect = fnDisconnect;
......
......@@ -53,8 +53,8 @@ typedef struct Parser_OutputPin
extern HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PROPERTIES * props, const AM_MEDIA_TYPE * amt);
HRESULT Parser_Create(ParserImpl *parser, const IBaseFilterVtbl *vtbl,
const CLSID *clsid, const WCHAR *sink_name, PFN_PROCESS_SAMPLE,
PFN_QUERY_ACCEPT, PFN_PRE_CONNECT, PFN_CLEANUP, PFN_DISCONNECT,
const CLSID *clsid, const BaseFilterFuncTable *func_table, const WCHAR *sink_name,
PFN_PROCESS_SAMPLE, PFN_QUERY_ACCEPT, PFN_PRE_CONNECT, PFN_CLEANUP, PFN_DISCONNECT,
REQUESTPROC, STOPPROCESSPROC, SourceSeeking_ChangeStop,
SourceSeeking_ChangeStart, SourceSeeking_ChangeRate) DECLSPEC_HIDDEN;
......@@ -76,6 +76,8 @@ extern HRESULT WINAPI Parser_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *p
extern HRESULT WINAPI Parser_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName);
extern HRESULT WINAPI Parser_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo);
IPin *parser_get_pin(BaseFilter *iface, unsigned int index) DECLSPEC_HIDDEN;
/* COM helpers */
static inline Parser_OutputPin *unsafe_impl_Parser_OutputPin_from_IPin( IPin *iface )
{
......
......@@ -413,6 +413,11 @@ static const IBaseFilterVtbl WAVEParser_Vtbl =
Parser_QueryVendorInfo
};
static const BaseFilterFuncTable wave_parser_func_table =
{
.filter_get_pin = parser_get_pin,
};
HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv)
{
static const WCHAR sink_name[] = {'i','n','p','u','t',' ','p','i','n',0};
......@@ -430,7 +435,7 @@ HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv)
This = CoTaskMemAlloc(sizeof(WAVEParserImpl));
hr = Parser_Create(&This->Parser, &WAVEParser_Vtbl, &CLSID_WAVEParser,
sink_name, WAVEParser_Sample, WAVEParser_QueryAccept,
&wave_parser_func_table, sink_name, WAVEParser_Sample, WAVEParser_QueryAccept,
WAVEParser_InputPin_PreConnect, WAVEParser_Cleanup, WAVEParser_disconnect,
WAVEParser_first_request, NULL, NULL, WAVEParserImpl_seek, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment