strmbase: Get rid of the "vtbl" parameter to strmbase_filter_init().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-12-04 23:03:31 -06:00 committed by Alexandre Julliard
parent 84e55192fa
commit 18f561a783
17 changed files with 60 additions and 320 deletions

View File

@ -49,24 +49,6 @@ static inline AudioRecord *impl_from_IPersistPropertyBag(IPersistPropertyBag *if
return CONTAINING_RECORD(iface, AudioRecord, IPersistPropertyBag_iface); return CONTAINING_RECORD(iface, AudioRecord, IPersistPropertyBag_iface);
} }
static const IBaseFilterVtbl AudioRecordVtbl = {
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
};
static struct strmbase_pin *audio_record_get_pin(struct strmbase_filter *iface, unsigned int index) static struct strmbase_pin *audio_record_get_pin(struct strmbase_filter *iface, unsigned int index)
{ {
FIXME("iface %p, index %u, stub!\n", iface, index); FIXME("iface %p, index %u, stub!\n", iface, index);
@ -186,7 +168,7 @@ IUnknown* WINAPI QCAP_createAudioCaptureFilter(IUnknown *outer, HRESULT *phr)
memset(This, 0, sizeof(*This)); memset(This, 0, sizeof(*This));
This->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl; This->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl;
strmbase_filter_init(&This->filter, &AudioRecordVtbl, outer, &CLSID_AudioRecord, &filter_ops); strmbase_filter_init(&This->filter, outer, &CLSID_AudioRecord, &filter_ops);
*phr = S_OK; *phr = S_OK;
return &This->filter.IUnknown_inner; return &This->filter.IUnknown_inner;

View File

@ -111,24 +111,6 @@ static HRESULT fill_format_info(AVICompressor *This, VIDEOINFOHEADER *src_videoi
return S_OK; return S_OK;
} }
static const IBaseFilterVtbl AVICompressorVtbl = {
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo,
};
static struct strmbase_pin *avi_compressor_get_pin(struct strmbase_filter *iface, unsigned int index) static struct strmbase_pin *avi_compressor_get_pin(struct strmbase_filter *iface, unsigned int index)
{ {
AVICompressor *filter = impl_from_strmbase_filter(iface); AVICompressor *filter = impl_from_strmbase_filter(iface);
@ -576,7 +558,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr)
return NULL; return NULL;
} }
strmbase_filter_init(&compressor->filter, &AVICompressorVtbl, outer, &CLSID_AVICo, &filter_ops); strmbase_filter_init(&compressor->filter, outer, &CLSID_AVICo, &filter_ops);
compressor->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl; compressor->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl;

View File

@ -672,24 +672,6 @@ static const struct strmbase_filter_ops filter_ops =
.filter_cleanup_stream = avi_mux_cleanup_stream, .filter_cleanup_stream = avi_mux_cleanup_stream,
}; };
static const IBaseFilterVtbl AviMuxVtbl = {
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
};
static inline AviMux* impl_from_IConfigAviMux(IConfigAviMux *iface) static inline AviMux* impl_from_IConfigAviMux(IConfigAviMux *iface)
{ {
return CONTAINING_RECORD(iface, AviMux, IConfigAviMux_iface); return CONTAINING_RECORD(iface, AviMux, IConfigAviMux_iface);
@ -1964,7 +1946,7 @@ IUnknown * WINAPI QCAP_createAVIMux(IUnknown *outer, HRESULT *phr)
return NULL; return NULL;
} }
strmbase_filter_init(&avimux->filter, &AviMuxVtbl, outer, &CLSID_AviDest, &filter_ops); strmbase_filter_init(&avimux->filter, outer, &CLSID_AviDest, &filter_ops);
avimux->IConfigAviMux_iface.lpVtbl = &ConfigAviMuxVtbl; avimux->IConfigAviMux_iface.lpVtbl = &ConfigAviMuxVtbl;
avimux->IConfigInterleaving_iface.lpVtbl = &ConfigInterleavingVtbl; avimux->IConfigInterleaving_iface.lpVtbl = &ConfigInterleavingVtbl;
avimux->IMediaSeeking_iface.lpVtbl = &MediaSeekingVtbl; avimux->IMediaSeeking_iface.lpVtbl = &MediaSeekingVtbl;

View File

@ -51,24 +51,6 @@ static inline SmartTeeFilter *impl_from_strmbase_pin(struct strmbase_pin *pin)
return impl_from_strmbase_filter(pin->filter); return impl_from_strmbase_filter(pin->filter);
} }
static const IBaseFilterVtbl SmartTeeFilterVtbl = {
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
};
static struct strmbase_pin *smart_tee_get_pin(struct strmbase_filter *iface, unsigned int index) static struct strmbase_pin *smart_tee_get_pin(struct strmbase_filter *iface, unsigned int index)
{ {
SmartTeeFilter *filter = impl_from_strmbase_filter(iface); SmartTeeFilter *filter = impl_from_strmbase_filter(iface);
@ -417,7 +399,7 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr)
} }
memset(object, 0, sizeof(*object)); memset(object, 0, sizeof(*object));
strmbase_filter_init(&object->filter, &SmartTeeFilterVtbl, outer, &CLSID_SmartTee, &filter_ops); strmbase_filter_init(&object->filter, outer, &CLSID_SmartTee, &filter_ops);
strmbase_sink_init(&object->sink, &SmartTeeFilterInputVtbl, &object->filter, inputW, &sink_ops, NULL); strmbase_sink_init(&object->sink, &SmartTeeFilterInputVtbl, &object->filter, inputW, &sink_ops, NULL);
hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER,
&IID_IMemAllocator, (void **)&object->sink.pAllocator); &IID_IMemAllocator, (void **)&object->sink.pAllocator);

View File

@ -167,25 +167,6 @@ static const struct strmbase_filter_ops filter_ops =
.filter_cleanup_stream = vfw_capture_cleanup_stream, .filter_cleanup_stream = vfw_capture_cleanup_stream,
}; };
static const IBaseFilterVtbl VfwCapture_Vtbl =
{
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
};
/* AMStreamConfig interface, we only need to implement {G,S}etFormat */ /* AMStreamConfig interface, we only need to implement {G,S}etFormat */
static HRESULT WINAPI AMStreamConfig_QueryInterface(IAMStreamConfig *iface, REFIID iid, void **out) static HRESULT WINAPI AMStreamConfig_QueryInterface(IAMStreamConfig *iface, REFIID iid, void **out)
{ {
@ -615,7 +596,7 @@ IUnknown * WINAPI QCAP_createVFWCaptureFilter(IUnknown *outer, HRESULT *phr)
return NULL; return NULL;
} }
strmbase_filter_init(&object->filter, &VfwCapture_Vtbl, outer, &CLSID_VfwCapture, &filter_ops); strmbase_filter_init(&object->filter, outer, &CLSID_VfwCapture, &filter_ops);
object->IAMStreamConfig_iface.lpVtbl = &IAMStreamConfig_VTable; object->IAMStreamConfig_iface.lpVtbl = &IAMStreamConfig_VTable;
object->IAMVideoProcAmp_iface.lpVtbl = &IAMVideoProcAmp_VTable; object->IAMVideoProcAmp_iface.lpVtbl = &IAMVideoProcAmp_VTable;

View File

@ -489,25 +489,6 @@ SampleGrabber_In_IPin_ReceiveConnection(IPin *iface, IPin *connector, const AM_M
return S_OK; return S_OK;
} }
static const IBaseFilterVtbl IBaseFilter_VTable =
{
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo,
};
static const ISampleGrabberVtbl ISampleGrabber_VTable = static const ISampleGrabberVtbl ISampleGrabber_VTable =
{ {
SampleGrabber_ISampleGrabber_QueryInterface, SampleGrabber_ISampleGrabber_QueryInterface,
@ -714,7 +695,7 @@ HRESULT SampleGrabber_create(IUnknown *outer, void **out)
} }
ZeroMemory(obj, sizeof(SG_Impl)); ZeroMemory(obj, sizeof(SG_Impl));
strmbase_filter_init(&obj->filter, &IBaseFilter_VTable, outer, &CLSID_SampleGrabber, &filter_ops); strmbase_filter_init(&obj->filter, outer, &CLSID_SampleGrabber, &filter_ops);
obj->ISampleGrabber_iface.lpVtbl = &ISampleGrabber_VTable; obj->ISampleGrabber_iface.lpVtbl = &ISampleGrabber_VTable;
obj->IMemInputPin_iface.lpVtbl = &IMemInputPin_VTable; obj->IMemInputPin_iface.lpVtbl = &IMemInputPin_VTable;

View File

@ -555,7 +555,7 @@ static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface,
TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj); TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
return BaseFilterImpl_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppvObj); return IUnknown_QueryInterface(This->renderer.filter.outer_unk, riid, ppvObj);
} }
static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) { static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
@ -563,7 +563,7 @@ static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
TRACE("(%p/%p)->()\n", This, iface); TRACE("(%p/%p)->()\n", This, iface);
return BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface); return IUnknown_AddRef(This->renderer.filter.outer_unk);
} }
static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) { static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
@ -571,7 +571,7 @@ static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
TRACE("(%p/%p)->()\n", This, iface); TRACE("(%p/%p)->()\n", This, iface);
return BaseFilterImpl_Release(&This->renderer.filter.IBaseFilter_iface); return IUnknown_Release(This->renderer.filter.outer_unk);
} }
HRESULT WINAPI basic_audio_GetTypeInfoCount(IBasicAudio *iface, UINT *count) HRESULT WINAPI basic_audio_GetTypeInfoCount(IBasicAudio *iface, UINT *count)
@ -708,7 +708,7 @@ static HRESULT WINAPI AMDirectSound_QueryInterface(IAMDirectSound *iface,
TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj); TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
return BaseFilterImpl_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppvObj); return IUnknown_QueryInterface(This->renderer.filter.outer_unk, riid, ppvObj);
} }
static ULONG WINAPI AMDirectSound_AddRef(IAMDirectSound *iface) static ULONG WINAPI AMDirectSound_AddRef(IAMDirectSound *iface)
@ -717,7 +717,7 @@ static ULONG WINAPI AMDirectSound_AddRef(IAMDirectSound *iface)
TRACE("(%p/%p)->()\n", This, iface); TRACE("(%p/%p)->()\n", This, iface);
return BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface); return IUnknown_AddRef(This->renderer.filter.outer_unk);
} }
static ULONG WINAPI AMDirectSound_Release(IAMDirectSound *iface) static ULONG WINAPI AMDirectSound_Release(IAMDirectSound *iface)
@ -726,7 +726,7 @@ static ULONG WINAPI AMDirectSound_Release(IAMDirectSound *iface)
TRACE("(%p/%p)->()\n", This, iface); TRACE("(%p/%p)->()\n", This, iface);
return BaseFilterImpl_Release(&This->renderer.filter.IBaseFilter_iface); return IUnknown_Release(This->renderer.filter.outer_unk);
} }
/*** IAMDirectSound methods ***/ /*** IAMDirectSound methods ***/

View File

@ -90,7 +90,6 @@ static inline AsyncReader *impl_from_IFileSourceFilter(IFileSourceFilter *iface)
return CONTAINING_RECORD(iface, AsyncReader, IFileSourceFilter_iface); return CONTAINING_RECORD(iface, AsyncReader, IFileSourceFilter_iface);
} }
static const IBaseFilterVtbl AsyncReader_Vtbl;
static const IFileSourceFilterVtbl FileSource_Vtbl; static const IFileSourceFilterVtbl FileSource_Vtbl;
static const IAsyncReaderVtbl FileAsyncReader_Vtbl; static const IAsyncReaderVtbl FileAsyncReader_Vtbl;
@ -412,7 +411,7 @@ HRESULT AsyncReader_create(IUnknown *outer, void **out)
if (!pAsyncRead) if (!pAsyncRead)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
strmbase_filter_init(&pAsyncRead->filter, &AsyncReader_Vtbl, outer, &CLSID_AsyncReader, &filter_ops); strmbase_filter_init(&pAsyncRead->filter, outer, &CLSID_AsyncReader, &filter_ops);
pAsyncRead->IFileSourceFilter_iface.lpVtbl = &FileSource_Vtbl; pAsyncRead->IFileSourceFilter_iface.lpVtbl = &FileSource_Vtbl;
@ -428,25 +427,6 @@ HRESULT AsyncReader_create(IUnknown *outer, void **out)
return S_OK; return S_OK;
} }
static const IBaseFilterVtbl AsyncReader_Vtbl =
{
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
};
static HRESULT WINAPI FileSource_QueryInterface(IFileSourceFilter * iface, REFIID riid, LPVOID * ppv) static HRESULT WINAPI FileSource_QueryInterface(IFileSourceFilter * iface, REFIID riid, LPVOID * ppv)
{ {
AsyncReader *This = impl_from_IFileSourceFilter(iface); AsyncReader *This = impl_from_IFileSourceFilter(iface);

View File

@ -495,25 +495,6 @@ struct testfilter
struct strmbase_source source; struct strmbase_source source;
}; };
static const IBaseFilterVtbl testfilter_vtbl =
{
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo,
};
static inline struct testfilter *impl_from_BaseFilter(struct strmbase_filter *iface) static inline struct testfilter *impl_from_BaseFilter(struct strmbase_filter *iface)
{ {
return CONTAINING_RECORD(iface, struct testfilter, filter); return CONTAINING_RECORD(iface, struct testfilter, filter);
@ -597,7 +578,7 @@ static const struct strmbase_source_ops testsource_ops =
static void testfilter_init(struct testfilter *filter) static void testfilter_init(struct testfilter *filter)
{ {
static const GUID clsid = {0xabacab}; static const GUID clsid = {0xabacab};
strmbase_filter_init(&filter->filter, &testfilter_vtbl, NULL, &clsid, &testfilter_ops); strmbase_filter_init(&filter->filter, NULL, &clsid, &testfilter_ops);
strmbase_source_init(&filter->source, &testsource_vtbl, &filter->filter, L"", &testsource_ops); strmbase_source_init(&filter->source, &testsource_vtbl, &filter->filter, L"", &testsource_ops);
} }

View File

@ -855,25 +855,6 @@ struct testfilter
struct strmbase_source source; struct strmbase_source source;
}; };
static const IBaseFilterVtbl testfilter_vtbl =
{
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo,
};
static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface)
{ {
return CONTAINING_RECORD(iface, struct testfilter, filter); return CONTAINING_RECORD(iface, struct testfilter, filter);
@ -957,7 +938,7 @@ static const struct strmbase_source_ops testsource_ops =
static void testfilter_init(struct testfilter *filter) static void testfilter_init(struct testfilter *filter)
{ {
static const GUID clsid = {0xabacab}; static const GUID clsid = {0xabacab};
strmbase_filter_init(&filter->filter, &testfilter_vtbl, NULL, &clsid, &testfilter_ops); strmbase_filter_init(&filter->filter, NULL, &clsid, &testfilter_ops);
strmbase_source_init(&filter->source, &testsource_vtbl, &filter->filter, L"", &testsource_ops); strmbase_source_init(&filter->source, &testsource_vtbl, &filter->filter, L"", &testsource_ops);
} }

View File

@ -859,25 +859,6 @@ struct testfilter
struct strmbase_source source; struct strmbase_source source;
}; };
static const IBaseFilterVtbl testfilter_vtbl =
{
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo,
};
static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface)
{ {
return CONTAINING_RECORD(iface, struct testfilter, filter); return CONTAINING_RECORD(iface, struct testfilter, filter);
@ -961,7 +942,7 @@ static const struct strmbase_source_ops testsource_ops =
static void testfilter_init(struct testfilter *filter) static void testfilter_init(struct testfilter *filter)
{ {
static const GUID clsid = {0xabacab}; static const GUID clsid = {0xabacab};
strmbase_filter_init(&filter->filter, &testfilter_vtbl, NULL, &clsid, &testfilter_ops); strmbase_filter_init(&filter->filter, NULL, &clsid, &testfilter_ops);
strmbase_source_init(&filter->source, &testsource_vtbl, &filter->filter, L"", &testsource_ops); strmbase_source_init(&filter->source, &testsource_vtbl, &filter->filter, L"", &testsource_ops);
} }

View File

@ -95,25 +95,25 @@ static inline struct strmbase_filter *impl_from_IBaseFilter(IBaseFilter *iface)
return CONTAINING_RECORD(iface, struct strmbase_filter, IBaseFilter_iface); return CONTAINING_RECORD(iface, struct strmbase_filter, IBaseFilter_iface);
} }
HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter *iface, REFIID iid, void **out) static HRESULT WINAPI filter_QueryInterface(IBaseFilter *iface, REFIID iid, void **out)
{ {
struct strmbase_filter *filter = impl_from_IBaseFilter(iface); struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
return IUnknown_QueryInterface(filter->outer_unk, iid, out); return IUnknown_QueryInterface(filter->outer_unk, iid, out);
} }
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface) static ULONG WINAPI filter_AddRef(IBaseFilter *iface)
{ {
struct strmbase_filter *filter = impl_from_IBaseFilter(iface); struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
return IUnknown_AddRef(filter->outer_unk); return IUnknown_AddRef(filter->outer_unk);
} }
ULONG WINAPI BaseFilterImpl_Release(IBaseFilter *iface) static ULONG WINAPI filter_Release(IBaseFilter *iface)
{ {
struct strmbase_filter *filter = impl_from_IBaseFilter(iface); struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
return IUnknown_Release(filter->outer_unk); return IUnknown_Release(filter->outer_unk);
} }
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter * iface, CLSID * pClsid) static HRESULT WINAPI filter_GetClassID(IBaseFilter * iface, CLSID * pClsid)
{ {
struct strmbase_filter *This = impl_from_IBaseFilter(iface); struct strmbase_filter *This = impl_from_IBaseFilter(iface);
TRACE("(%p)->(%p)\n", This, pClsid); TRACE("(%p)->(%p)\n", This, pClsid);
@ -123,7 +123,7 @@ HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter * iface, CLSID * pClsid)
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseFilterImpl_Stop(IBaseFilter *iface) static HRESULT WINAPI filter_Stop(IBaseFilter *iface)
{ {
struct strmbase_filter *filter = impl_from_IBaseFilter(iface); struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
HRESULT hr = S_OK; HRESULT hr = S_OK;
@ -144,7 +144,7 @@ HRESULT WINAPI BaseFilterImpl_Stop(IBaseFilter *iface)
return hr; return hr;
} }
HRESULT WINAPI BaseFilterImpl_Pause(IBaseFilter *iface) static HRESULT WINAPI filter_Pause(IBaseFilter *iface)
{ {
struct strmbase_filter *filter = impl_from_IBaseFilter(iface); struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
HRESULT hr = S_OK; HRESULT hr = S_OK;
@ -165,7 +165,7 @@ HRESULT WINAPI BaseFilterImpl_Pause(IBaseFilter *iface)
return hr; return hr;
} }
HRESULT WINAPI BaseFilterImpl_Run(IBaseFilter *iface, REFERENCE_TIME start) static HRESULT WINAPI filter_Run(IBaseFilter *iface, REFERENCE_TIME start)
{ {
struct strmbase_filter *filter = impl_from_IBaseFilter(iface); struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
HRESULT hr = S_OK; HRESULT hr = S_OK;
@ -186,7 +186,7 @@ HRESULT WINAPI BaseFilterImpl_Run(IBaseFilter *iface, REFERENCE_TIME start)
return hr; return hr;
} }
HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter *iface, DWORD timeout, FILTER_STATE *state) static HRESULT WINAPI filter_GetState(IBaseFilter *iface, DWORD timeout, FILTER_STATE *state)
{ {
struct strmbase_filter *filter = impl_from_IBaseFilter(iface); struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
HRESULT hr = S_OK; HRESULT hr = S_OK;
@ -204,7 +204,7 @@ HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter *iface, DWORD timeout, FILTER
return hr; return hr;
} }
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock) static HRESULT WINAPI filter_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock)
{ {
struct strmbase_filter *This = impl_from_IBaseFilter(iface); struct strmbase_filter *This = impl_from_IBaseFilter(iface);
TRACE("(%p)->(%p)\n", This, pClock); TRACE("(%p)->(%p)\n", This, pClock);
@ -222,7 +222,7 @@ HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter * iface, IReferenceClock
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock) static HRESULT WINAPI filter_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
{ {
struct strmbase_filter *This = impl_from_IBaseFilter(iface); struct strmbase_filter *This = impl_from_IBaseFilter(iface);
TRACE("(%p)->(%p)\n", This, ppClock); TRACE("(%p)->(%p)\n", This, ppClock);
@ -238,7 +238,7 @@ HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter * iface, IReferenceClock
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **enum_pins) static HRESULT WINAPI filter_EnumPins(IBaseFilter *iface, IEnumPins **enum_pins)
{ {
struct strmbase_filter *filter = impl_from_IBaseFilter(iface); struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
@ -247,7 +247,7 @@ HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **enum_pins
return enum_pins_create(filter, enum_pins); return enum_pins_create(filter, enum_pins);
} }
HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **ret) static HRESULT WINAPI filter_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **ret)
{ {
struct strmbase_filter *This = impl_from_IBaseFilter(iface); struct strmbase_filter *This = impl_from_IBaseFilter(iface);
struct strmbase_pin *pin; struct strmbase_pin *pin;
@ -267,7 +267,7 @@ HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin
return VFW_E_NOT_FOUND; return VFW_E_NOT_FOUND;
} }
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo) static HRESULT WINAPI filter_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
{ {
struct strmbase_filter *This = impl_from_IBaseFilter(iface); struct strmbase_filter *This = impl_from_IBaseFilter(iface);
TRACE("(%p)->(%p)\n", This, pInfo); TRACE("(%p)->(%p)\n", This, pInfo);
@ -281,7 +281,7 @@ HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName ) static HRESULT WINAPI filter_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, const WCHAR *pName)
{ {
struct strmbase_filter *This = impl_from_IBaseFilter(iface); struct strmbase_filter *This = impl_from_IBaseFilter(iface);
@ -300,23 +300,42 @@ HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo) static HRESULT WINAPI filter_QueryVendorInfo(IBaseFilter *iface, WCHAR **pVendorInfo)
{ {
TRACE("(%p)->(%p)\n", iface, pVendorInfo); TRACE("(%p)->(%p)\n", iface, pVendorInfo);
return E_NOTIMPL; return E_NOTIMPL;
} }
static const IBaseFilterVtbl filter_vtbl =
{
filter_QueryInterface,
filter_AddRef,
filter_Release,
filter_GetClassID,
filter_Stop,
filter_Pause,
filter_Run,
filter_GetState,
filter_SetSyncSource,
filter_GetSyncSource,
filter_EnumPins,
filter_FindPin,
filter_QueryFilterInfo,
filter_JoinFilterGraph,
filter_QueryVendorInfo,
};
VOID WINAPI BaseFilterImpl_IncrementPinVersion(struct strmbase_filter *filter) VOID WINAPI BaseFilterImpl_IncrementPinVersion(struct strmbase_filter *filter)
{ {
InterlockedIncrement(&filter->pin_version); InterlockedIncrement(&filter->pin_version);
} }
void strmbase_filter_init(struct strmbase_filter *filter, const IBaseFilterVtbl *vtbl, IUnknown *outer, void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer,
const CLSID *clsid, const struct strmbase_filter_ops *ops) const CLSID *clsid, const struct strmbase_filter_ops *ops)
{ {
memset(filter, 0, sizeof(*filter)); memset(filter, 0, sizeof(*filter));
filter->IBaseFilter_iface.lpVtbl = vtbl; filter->IBaseFilter_iface.lpVtbl = &filter_vtbl;
filter->IUnknown_inner.lpVtbl = &filter_inner_vtbl; filter->IUnknown_inner.lpVtbl = &filter_inner_vtbl;
filter->outer_unk = outer ? outer : &filter->IUnknown_inner; filter->outer_unk = outer ? outer : &filter->IUnknown_inner;
filter->refcount = 1; filter->refcount = 1;

View File

@ -448,25 +448,6 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa
return hr; return hr;
} }
static const IBaseFilterVtbl strmbase_renderer_vtbl =
{
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
};
HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *iface) HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *iface)
{ {
if (iface->pMediaSample) if (iface->pMediaSample)
@ -483,7 +464,7 @@ HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown
HRESULT hr; HRESULT hr;
memset(filter, 0, sizeof(*filter)); memset(filter, 0, sizeof(*filter));
strmbase_filter_init(&filter->filter, &strmbase_renderer_vtbl, outer, clsid, &filter_ops); strmbase_filter_init(&filter->filter, outer, clsid, &filter_ops);
filter->pFuncsTable = ops; filter->pFuncsTable = ops;

View File

@ -246,26 +246,6 @@ static const struct strmbase_source_ops source_ops =
.pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator,
}; };
static const IBaseFilterVtbl transform_vtbl =
{
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
};
static TransformFilter *impl_from_source_IQualityControl(IQualityControl *iface) static TransformFilter *impl_from_source_IQualityControl(IQualityControl *iface)
{ {
return CONTAINING_RECORD(iface, TransformFilter, source_IQualityControl_iface); return CONTAINING_RECORD(iface, TransformFilter, source_IQualityControl_iface);
@ -346,7 +326,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid,
ISeekingPassThru *passthru; ISeekingPassThru *passthru;
HRESULT hr; HRESULT hr;
strmbase_filter_init(&filter->filter, &transform_vtbl, outer, clsid, &filter_ops); strmbase_filter_init(&filter->filter, outer, clsid, &filter_ops);
InitializeCriticalSection(&filter->csReceive); InitializeCriticalSection(&filter->csReceive);
filter->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": TransformFilter.csReceive"); filter->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": TransformFilter.csReceive");

View File

@ -99,7 +99,6 @@ static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
static const IMediaSeekingVtbl GST_Seeking_Vtbl; static const IMediaSeekingVtbl GST_Seeking_Vtbl;
static const IPinVtbl GST_OutputPin_Vtbl; static const IPinVtbl GST_OutputPin_Vtbl;
static const IPinVtbl GST_InputPin_Vtbl; static const IPinVtbl GST_InputPin_Vtbl;
static const IBaseFilterVtbl GST_Vtbl;
static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl; static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl;
static struct gstdemux_source *create_pin(struct gstdemux *filter, const WCHAR *name); static struct gstdemux_source *create_pin(struct gstdemux *filter, const WCHAR *name);
@ -1438,7 +1437,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
return NULL; return NULL;
} }
strmbase_filter_init(&object->filter, &GST_Vtbl, outer, &CLSID_Gstreamer_Splitter, &filter_ops); strmbase_filter_init(&object->filter, outer, &CLSID_Gstreamer_Splitter, &filter_ops);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL); object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
object->sink.dir = PINDIR_INPUT; object->sink.dir = PINDIR_INPUT;
@ -1453,24 +1452,6 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
return &object->filter.IUnknown_inner; return &object->filter.IUnknown_inner;
} }
static const IBaseFilterVtbl GST_Vtbl = {
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
};
static struct gstdemux *impl_from_IAMStreamSelect(IAMStreamSelect *iface) static struct gstdemux *impl_from_IAMStreamSelect(IAMStreamSelect *iface)
{ {
return CONTAINING_RECORD(iface, struct gstdemux, IAMStreamSelect_iface); return CONTAINING_RECORD(iface, struct gstdemux, IAMStreamSelect_iface);
@ -2383,7 +2364,7 @@ IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr)
return NULL; return NULL;
} }
strmbase_filter_init(&object->filter, &GST_Vtbl, outer, &CLSID_WAVEParser, &filter_ops); strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops);
object->sink.dir = PINDIR_INPUT; object->sink.dir = PINDIR_INPUT;
object->sink.filter = &object->filter; object->sink.filter = &object->filter;
@ -2489,7 +2470,7 @@ IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr)
return NULL; return NULL;
} }
strmbase_filter_init(&object->filter, &GST_Vtbl, outer, &CLSID_AviSplitter, &filter_ops); strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL); object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
object->sink.dir = PINDIR_INPUT; object->sink.dir = PINDIR_INPUT;
@ -2627,7 +2608,7 @@ IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr)
return NULL; return NULL;
} }
strmbase_filter_init(&object->filter, &GST_Vtbl, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops); strmbase_filter_init(&object->filter, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops);
object->IAMStreamSelect_iface.lpVtbl = &stream_select_vtbl; object->IAMStreamSelect_iface.lpVtbl = &stream_select_vtbl;
object->duration_event = CreateEventW(NULL, FALSE, FALSE, NULL); object->duration_event = CreateEventW(NULL, FALSE, FALSE, NULL);

View File

@ -357,7 +357,7 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
} }
ZeroMemory(This,sizeof(*This)); ZeroMemory(This,sizeof(*This));
strmbase_filter_init(&This->filter, &QT_Vtbl, outer, &CLSID_QTSplitter, &filter_ops); strmbase_filter_init(&This->filter, outer, &CLSID_QTSplitter, &filter_ops);
InitializeCriticalSection(&This->csReceive); InitializeCriticalSection(&This->csReceive);
This->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": QTSplitter.csReceive"); This->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": QTSplitter.csReceive");
@ -721,24 +721,6 @@ audio_error:
return hr; return hr;
} }
static const IBaseFilterVtbl QT_Vtbl = {
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
BaseFilterImpl_Stop,
BaseFilterImpl_Pause,
BaseFilterImpl_Run,
BaseFilterImpl_GetState,
BaseFilterImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
};
static void free_source_pin(QTOutPin *pin) static void free_source_pin(QTOutPin *pin)
{ {
if (pin->pin.pin.peer) if (pin->pin.pin.peer)

View File

@ -176,25 +176,9 @@ struct strmbase_filter_ops
HRESULT (*filter_wait_state)(struct strmbase_filter *iface, DWORD timeout); HRESULT (*filter_wait_state)(struct strmbase_filter *iface, DWORD timeout);
}; };
HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter * iface);
ULONG WINAPI BaseFilterImpl_Release(IBaseFilter * iface);
HRESULT WINAPI BaseFilterImpl_Stop(IBaseFilter *iface);
HRESULT WINAPI BaseFilterImpl_Pause(IBaseFilter *iface);
HRESULT WINAPI BaseFilterImpl_Run(IBaseFilter *iface, REFERENCE_TIME start);
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter * iface, CLSID * pClsid);
HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState );
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock);
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock);
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum);
HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **pin);
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo);
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName );
HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo);
VOID WINAPI BaseFilterImpl_IncrementPinVersion(struct strmbase_filter *filter); VOID WINAPI BaseFilterImpl_IncrementPinVersion(struct strmbase_filter *filter);
void strmbase_filter_init(struct strmbase_filter *filter, const IBaseFilterVtbl *vtbl, IUnknown *outer, void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer,
const CLSID *clsid, const struct strmbase_filter_ops *func_table); const CLSID *clsid, const struct strmbase_filter_ops *func_table);
void strmbase_filter_cleanup(struct strmbase_filter *filter); void strmbase_filter_cleanup(struct strmbase_filter *filter);