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

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

parent ddd77e74
...@@ -272,27 +272,6 @@ static const IPersistPropertyBagVtbl PersistPropertyBagVtbl = { ...@@ -272,27 +272,6 @@ static const IPersistPropertyBagVtbl PersistPropertyBagVtbl = {
AVICompressorPropertyBag_Save AVICompressorPropertyBag_Save
}; };
static const IPinVtbl AVICompressorInputPinVtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
BaseInputPinImpl_ReceiveConnection,
BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseInputPinImpl_EndOfStream,
BaseInputPinImpl_BeginFlush,
BaseInputPinImpl_EndFlush,
BaseInputPinImpl_NewSegment
};
static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt) static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt)
{ {
AVICompressor *This = impl_from_strmbase_pin(base); AVICompressor *This = impl_from_strmbase_pin(base);
...@@ -517,8 +496,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr) ...@@ -517,8 +496,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr)
compressor->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl; compressor->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl;
strmbase_sink_init(&compressor->sink, &AVICompressorInputPinVtbl, strmbase_sink_init(&compressor->sink, &compressor->filter, sink_name, &sink_ops, NULL);
&compressor->filter, sink_name, &sink_ops, NULL);
strmbase_source_init(&compressor->source, &compressor->filter, source_name, &source_ops); strmbase_source_init(&compressor->source, &compressor->filter, source_name, &source_ops);
*phr = S_OK; *phr = S_OK;
......
...@@ -1500,27 +1500,6 @@ static inline AviMux* impl_from_in_IPin(IPin *iface) ...@@ -1500,27 +1500,6 @@ static inline AviMux* impl_from_in_IPin(IPin *iface)
return impl_from_strmbase_filter(pin->filter); return impl_from_strmbase_filter(pin->filter);
} }
static const IPinVtbl AviMuxIn_PinVtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
BaseInputPinImpl_ReceiveConnection,
BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseInputPinImpl_EndOfStream,
BaseInputPinImpl_BeginFlush,
BaseInputPinImpl_EndFlush,
BasePinImpl_NewSegment
};
static inline AviMuxIn* AviMuxIn_from_IAMStreamControl(IAMStreamControl *iface) static inline AviMuxIn* AviMuxIn_from_IAMStreamControl(IAMStreamControl *iface)
{ {
return CONTAINING_RECORD(iface, AviMuxIn, IAMStreamControl_iface); return CONTAINING_RECORD(iface, AviMuxIn, IAMStreamControl_iface);
...@@ -1825,7 +1804,7 @@ static HRESULT create_input_pin(AviMux *avimux) ...@@ -1825,7 +1804,7 @@ static HRESULT create_input_pin(AviMux *avimux)
if (!(object = heap_alloc_zero(sizeof(*object)))) if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
strmbase_sink_init(&object->pin, &AviMuxIn_PinVtbl, &avimux->filter, name, &sink_ops, NULL); strmbase_sink_init(&object->pin, &avimux->filter, name, &sink_ops, NULL);
object->pin.IMemInputPin_iface.lpVtbl = &AviMuxIn_MemInputPinVtbl; object->pin.IMemInputPin_iface.lpVtbl = &AviMuxIn_MemInputPinVtbl;
object->IAMStreamControl_iface.lpVtbl = &AviMuxIn_AMStreamControlVtbl; object->IAMStreamControl_iface.lpVtbl = &AviMuxIn_AMStreamControlVtbl;
object->IPropertyBag_iface.lpVtbl = &AviMuxIn_PropertyBagVtbl; object->IPropertyBag_iface.lpVtbl = &AviMuxIn_PropertyBagVtbl;
......
...@@ -81,27 +81,6 @@ static const struct strmbase_filter_ops filter_ops = ...@@ -81,27 +81,6 @@ static const struct strmbase_filter_ops filter_ops =
.filter_destroy = smart_tee_destroy, .filter_destroy = smart_tee_destroy,
}; };
static const IPinVtbl SmartTeeFilterInputVtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
BaseInputPinImpl_ReceiveConnection,
BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseInputPinImpl_EndOfStream,
BaseInputPinImpl_BeginFlush,
BaseInputPinImpl_EndFlush,
BaseInputPinImpl_NewSegment
};
static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt) static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt)
{ {
SmartTeeFilter *This = impl_from_strmbase_pin(base); SmartTeeFilter *This = impl_from_strmbase_pin(base);
...@@ -358,7 +337,7 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr) ...@@ -358,7 +337,7 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr)
memset(object, 0, sizeof(*object)); memset(object, 0, sizeof(*object));
strmbase_filter_init(&object->filter, 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, &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);
if (FAILED(hr)) if (FAILED(hr))
......
...@@ -473,28 +473,6 @@ static const IMemInputPinVtbl IMemInputPin_VTable = ...@@ -473,28 +473,6 @@ static const IMemInputPinVtbl IMemInputPin_VTable =
SampleGrabber_IMemInputPin_ReceiveCanBlock, SampleGrabber_IMemInputPin_ReceiveCanBlock,
}; };
static const IPinVtbl sink_vtbl =
{
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
BaseInputPinImpl_ReceiveConnection,
BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseInputPinImpl_EndOfStream,
BaseInputPinImpl_BeginFlush,
BaseInputPinImpl_EndFlush,
BaseInputPinImpl_NewSegment
};
static inline SG_Impl *impl_from_sink_pin(struct strmbase_pin *iface) static inline SG_Impl *impl_from_sink_pin(struct strmbase_pin *iface)
{ {
return CONTAINING_RECORD(iface, SG_Impl, sink.pin); return CONTAINING_RECORD(iface, SG_Impl, sink.pin);
...@@ -663,7 +641,7 @@ HRESULT SampleGrabber_create(IUnknown *outer, void **out) ...@@ -663,7 +641,7 @@ HRESULT SampleGrabber_create(IUnknown *outer, void **out)
obj->ISampleGrabber_iface.lpVtbl = &ISampleGrabber_VTable; obj->ISampleGrabber_iface.lpVtbl = &ISampleGrabber_VTable;
obj->IMemInputPin_iface.lpVtbl = &IMemInputPin_VTable; obj->IMemInputPin_iface.lpVtbl = &IMemInputPin_VTable;
strmbase_sink_init(&obj->sink, &sink_vtbl, &obj->filter, L"In", &sink_ops, NULL); strmbase_sink_init(&obj->sink, &obj->filter, L"In", &sink_ops, NULL);
strmbase_source_init(&obj->source, &obj->filter, L"Out", &source_ops); strmbase_source_init(&obj->source, &obj->filter, L"Out", &source_ops);
obj->mtype.majortype = GUID_NULL; obj->mtype.majortype = GUID_NULL;
......
...@@ -82,7 +82,7 @@ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int ind ...@@ -82,7 +82,7 @@ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int ind
return VFW_S_NO_MORE_ITEMS; return VFW_S_NO_MORE_ITEMS;
} }
HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out) static HRESULT WINAPI pin_QueryInterface(IPin *iface, REFIID iid, void **out)
{ {
struct strmbase_pin *pin = impl_from_IPin(iface); struct strmbase_pin *pin = impl_from_IPin(iface);
HRESULT hr; HRESULT hr;
...@@ -107,19 +107,19 @@ HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out) ...@@ -107,19 +107,19 @@ HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out)
return S_OK; return S_OK;
} }
ULONG WINAPI BasePinImpl_AddRef(IPin *iface) static ULONG WINAPI pin_AddRef(IPin *iface)
{ {
struct strmbase_pin *pin = impl_from_IPin(iface); struct strmbase_pin *pin = impl_from_IPin(iface);
return IBaseFilter_AddRef(&pin->filter->IBaseFilter_iface); return IBaseFilter_AddRef(&pin->filter->IBaseFilter_iface);
} }
ULONG WINAPI BasePinImpl_Release(IPin *iface) static ULONG WINAPI pin_Release(IPin *iface)
{ {
struct strmbase_pin *pin = impl_from_IPin(iface); struct strmbase_pin *pin = impl_from_IPin(iface);
return IBaseFilter_Release(&pin->filter->IBaseFilter_iface); return IBaseFilter_Release(&pin->filter->IBaseFilter_iface);
} }
HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin) static HRESULT WINAPI pin_ConnectedTo(IPin * iface, IPin ** ppPin)
{ {
struct strmbase_pin *This = impl_from_IPin(iface); struct strmbase_pin *This = impl_from_IPin(iface);
HRESULT hr; HRESULT hr;
...@@ -145,7 +145,7 @@ HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin) ...@@ -145,7 +145,7 @@ HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin)
return hr; return hr;
} }
HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt) static HRESULT WINAPI pin_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
{ {
struct strmbase_pin *This = impl_from_IPin(iface); struct strmbase_pin *This = impl_from_IPin(iface);
HRESULT hr; HRESULT hr;
...@@ -171,7 +171,7 @@ HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt ...@@ -171,7 +171,7 @@ HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt
return hr; return hr;
} }
HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *info) static HRESULT WINAPI pin_QueryPinInfo(IPin *iface, PIN_INFO *info)
{ {
struct strmbase_pin *pin = impl_from_IPin(iface); struct strmbase_pin *pin = impl_from_IPin(iface);
...@@ -184,7 +184,7 @@ HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *info) ...@@ -184,7 +184,7 @@ HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *info)
return S_OK; return S_OK;
} }
HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *dir) static HRESULT WINAPI pin_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
{ {
struct strmbase_pin *pin = impl_from_IPin(iface); struct strmbase_pin *pin = impl_from_IPin(iface);
...@@ -195,7 +195,7 @@ HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *dir) ...@@ -195,7 +195,7 @@ HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
return S_OK; return S_OK;
} }
HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, WCHAR **id) static HRESULT WINAPI pin_QueryId(IPin *iface, WCHAR **id)
{ {
struct strmbase_pin *pin = impl_from_IPin(iface); struct strmbase_pin *pin = impl_from_IPin(iface);
...@@ -209,7 +209,7 @@ HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, WCHAR **id) ...@@ -209,7 +209,7 @@ HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, WCHAR **id)
return S_OK; return S_OK;
} }
HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt) static HRESULT WINAPI pin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
{ {
struct strmbase_pin *This = impl_from_IPin(iface); struct strmbase_pin *This = impl_from_IPin(iface);
...@@ -219,7 +219,7 @@ HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt) ...@@ -219,7 +219,7 @@ HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt)
return (This->pFuncsTable->pin_query_accept(This, pmt) == S_OK ? S_OK : S_FALSE); return (This->pFuncsTable->pin_query_accept(This, pmt) == S_OK ? S_OK : S_FALSE);
} }
HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types) static HRESULT WINAPI pin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types)
{ {
struct strmbase_pin *pin = impl_from_IPin(iface); struct strmbase_pin *pin = impl_from_IPin(iface);
AM_MEDIA_TYPE mt; AM_MEDIA_TYPE mt;
...@@ -235,7 +235,7 @@ HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_me ...@@ -235,7 +235,7 @@ HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_me
return enum_media_types_create(pin, enum_media_types); return enum_media_types_create(pin, enum_media_types);
} }
HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin) static HRESULT WINAPI pin_QueryInternalConnections(IPin *iface, IPin **apPin, ULONG *cPin)
{ {
struct strmbase_pin *This = impl_from_IPin(iface); struct strmbase_pin *This = impl_from_IPin(iface);
...@@ -244,14 +244,6 @@ HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ...@@ -244,14 +244,6 @@ HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin,
return E_NOTIMPL; /* to tell caller that all input pins connected to all output pins */ return E_NOTIMPL; /* to tell caller that all input pins connected to all output pins */
} }
HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
{
TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
iface, debugstr_time(start), debugstr_time(stop), rate);
return S_OK;
}
/*** OutputPin implementation ***/ /*** OutputPin implementation ***/
static inline struct strmbase_source *impl_source_from_IPin( IPin *iface ) static inline struct strmbase_source *impl_source_from_IPin( IPin *iface )
...@@ -420,26 +412,33 @@ static HRESULT WINAPI source_EndFlush(IPin *iface) ...@@ -420,26 +412,33 @@ static HRESULT WINAPI source_EndFlush(IPin *iface)
return E_UNEXPECTED; return E_UNEXPECTED;
} }
static HRESULT WINAPI source_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
{
TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
iface, debugstr_time(start), debugstr_time(stop), rate);
return S_OK;
}
static const IPinVtbl source_vtbl = static const IPinVtbl source_vtbl =
{ {
BasePinImpl_QueryInterface, pin_QueryInterface,
BasePinImpl_AddRef, pin_AddRef,
BasePinImpl_Release, pin_Release,
source_Connect, source_Connect,
source_ReceiveConnection, source_ReceiveConnection,
source_Disconnect, source_Disconnect,
BasePinImpl_ConnectedTo, pin_ConnectedTo,
BasePinImpl_ConnectionMediaType, pin_ConnectionMediaType,
BasePinImpl_QueryPinInfo, pin_QueryPinInfo,
BasePinImpl_QueryDirection, pin_QueryDirection,
BasePinImpl_QueryId, pin_QueryId,
BasePinImpl_QueryAccept, pin_QueryAccept,
BasePinImpl_EnumMediaTypes, pin_EnumMediaTypes,
BasePinImpl_QueryInternalConnections, pin_QueryInternalConnections,
source_EndOfStream, source_EndOfStream,
source_BeginFlush, source_BeginFlush,
source_EndFlush, source_EndFlush,
BasePinImpl_NewSegment, source_NewSegment,
}; };
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *This, HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *This,
...@@ -617,14 +616,14 @@ static struct strmbase_sink *impl_sink_from_IPin(IPin *iface) ...@@ -617,14 +616,14 @@ static struct strmbase_sink *impl_sink_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_sink, pin.IPin_iface); return CONTAINING_RECORD(iface, struct strmbase_sink, pin.IPin_iface);
} }
HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt) static HRESULT WINAPI sink_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt)
{ {
ERR("(%p)->(%p, %p) outgoing connection on an input pin!\n", iface, pin, pmt); ERR("(%p)->(%p, %p) outgoing connection on an input pin!\n", iface, pin, pmt);
return E_UNEXPECTED; return E_UNEXPECTED;
} }
HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt) static HRESULT WINAPI sink_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
{ {
struct strmbase_sink *This = impl_sink_from_IPin(iface); struct strmbase_sink *This = impl_sink_from_IPin(iface);
PIN_DIRECTION pindirReceive; PIN_DIRECTION pindirReceive;
...@@ -678,7 +677,7 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP ...@@ -678,7 +677,7 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP
return hr; return hr;
} }
HRESULT WINAPI BaseInputPinImpl_Disconnect(IPin *iface) static HRESULT WINAPI sink_Disconnect(IPin *iface)
{ {
struct strmbase_sink *pin = impl_sink_from_IPin(iface); struct strmbase_sink *pin = impl_sink_from_IPin(iface);
HRESULT hr; HRESULT hr;
...@@ -711,7 +710,7 @@ static HRESULT deliver_endofstream(IPin* pin, LPVOID unused) ...@@ -711,7 +710,7 @@ static HRESULT deliver_endofstream(IPin* pin, LPVOID unused)
return IPin_EndOfStream( pin ); return IPin_EndOfStream( pin );
} }
HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface) static HRESULT WINAPI sink_EndOfStream(IPin *iface)
{ {
struct strmbase_sink *This = impl_sink_from_IPin(iface); struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr = S_OK; HRESULT hr = S_OK;
...@@ -736,7 +735,7 @@ static HRESULT deliver_beginflush(IPin* pin, LPVOID unused) ...@@ -736,7 +735,7 @@ static HRESULT deliver_beginflush(IPin* pin, LPVOID unused)
return IPin_BeginFlush( pin ); return IPin_BeginFlush( pin );
} }
HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface) static HRESULT WINAPI sink_BeginFlush(IPin *iface)
{ {
struct strmbase_sink *pin = impl_sink_from_IPin(iface); struct strmbase_sink *pin = impl_sink_from_IPin(iface);
HRESULT hr; HRESULT hr;
...@@ -762,7 +761,7 @@ static HRESULT deliver_endflush(IPin* pin, LPVOID unused) ...@@ -762,7 +761,7 @@ static HRESULT deliver_endflush(IPin* pin, LPVOID unused)
return IPin_EndFlush( pin ); return IPin_EndFlush( pin );
} }
HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface) static HRESULT WINAPI sink_EndFlush(IPin * iface)
{ {
struct strmbase_sink *pin = impl_sink_from_IPin(iface); struct strmbase_sink *pin = impl_sink_from_IPin(iface);
HRESULT hr; HRESULT hr;
...@@ -795,7 +794,7 @@ static HRESULT deliver_newsegment(IPin *pin, LPVOID data) ...@@ -795,7 +794,7 @@ static HRESULT deliver_newsegment(IPin *pin, LPVOID data)
return IPin_NewSegment(pin, args->tStart, args->tStop, args->rate); return IPin_NewSegment(pin, args->tStart, args->tStop, args->rate);
} }
HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate) static HRESULT WINAPI sink_NewSegment(IPin *iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
{ {
struct strmbase_sink *pin = impl_sink_from_IPin(iface); struct strmbase_sink *pin = impl_sink_from_IPin(iface);
newsegmentargs args; newsegmentargs args;
...@@ -813,6 +812,28 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R ...@@ -813,6 +812,28 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R
return SendFurther(pin, deliver_newsegment, &args); return SendFurther(pin, deliver_newsegment, &args);
} }
static const IPinVtbl sink_vtbl =
{
pin_QueryInterface,
pin_AddRef,
pin_Release,
sink_Connect,
sink_ReceiveConnection,
sink_Disconnect,
pin_ConnectedTo,
pin_ConnectionMediaType,
pin_QueryPinInfo,
pin_QueryDirection,
pin_QueryId,
pin_QueryAccept,
pin_EnumMediaTypes,
pin_QueryInternalConnections,
sink_EndOfStream,
sink_BeginFlush,
sink_EndFlush,
sink_NewSegment,
};
/*** IMemInputPin implementation ***/ /*** IMemInputPin implementation ***/
static inline struct strmbase_sink *impl_from_IMemInputPin(IMemInputPin *iface) static inline struct strmbase_sink *impl_from_IMemInputPin(IMemInputPin *iface)
...@@ -944,11 +965,11 @@ static const IMemInputPinVtbl MemInputPin_Vtbl = ...@@ -944,11 +965,11 @@ static const IMemInputPinVtbl MemInputPin_Vtbl =
MemInputPin_ReceiveCanBlock MemInputPin_ReceiveCanBlock
}; };
void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter, void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_sink_ops *func_table, IMemAllocator *allocator) const WCHAR *name, const struct strmbase_sink_ops *func_table, IMemAllocator *allocator)
{ {
memset(pin, 0, sizeof(*pin)); memset(pin, 0, sizeof(*pin));
pin->pin.IPin_iface.lpVtbl = vtbl; pin->pin.IPin_iface.lpVtbl = &sink_vtbl;
pin->pin.filter = filter; pin->pin.filter = filter;
pin->pin.dir = PINDIR_INPUT; pin->pin.dir = PINDIR_INPUT;
lstrcpyW(pin->pin.name, name); lstrcpyW(pin->pin.name, name);
......
...@@ -40,28 +40,6 @@ static inline struct strmbase_renderer *impl_from_IPin(IPin *iface) ...@@ -40,28 +40,6 @@ static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface); return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface);
} }
static const IPinVtbl BaseRenderer_InputPin_Vtbl =
{
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
BaseInputPinImpl_ReceiveConnection,
BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseInputPinImpl_EndOfStream,
BaseInputPinImpl_BeginFlush,
BaseInputPinImpl_EndFlush,
BaseInputPinImpl_NewSegment
};
static struct strmbase_pin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index) static struct strmbase_pin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index)
{ {
struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); struct strmbase_renderer *filter = impl_from_strmbase_filter(iface);
...@@ -436,8 +414,7 @@ HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown ...@@ -436,8 +414,7 @@ HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown
filter->pFuncsTable = ops; filter->pFuncsTable = ops;
strmbase_sink_init(&filter->sink, &BaseRenderer_InputPin_Vtbl, &filter->filter, strmbase_sink_init(&filter->sink, &filter->filter, sink_name, &sink_ops, NULL);
sink_name, &sink_ops, NULL);
hr = CreatePosPassThru(outer ? outer : (IUnknown *)&filter->filter.IBaseFilter_iface, hr = CreatePosPassThru(outer ? outer : (IUnknown *)&filter->filter.IBaseFilter_iface,
TRUE, &filter->sink.pin.IPin_iface, &filter->pPosition); TRUE, &filter->sink.pin.IPin_iface, &filter->pPosition);
......
...@@ -26,8 +26,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(strmbase); ...@@ -26,8 +26,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
static const WCHAR wcsInputPinName[] = {'I','n',0}; static const WCHAR wcsInputPinName[] = {'I','n',0};
static const WCHAR wcsOutputPinName[] = {'O','u','t',0}; static const WCHAR wcsOutputPinName[] = {'O','u','t',0};
static const IPinVtbl TransformFilter_InputPin_Vtbl;
static inline TransformFilter *impl_from_strmbase_filter(struct strmbase_filter *iface) static inline TransformFilter *impl_from_strmbase_filter(struct strmbase_filter *iface)
{ {
return CONTAINING_RECORD(iface, TransformFilter, filter); return CONTAINING_RECORD(iface, TransformFilter, filter);
...@@ -403,8 +401,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid, ...@@ -403,8 +401,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid,
filter->pFuncsTable = func_table; filter->pFuncsTable = func_table;
ZeroMemory(&filter->pmt, sizeof(filter->pmt)); ZeroMemory(&filter->pmt, sizeof(filter->pmt));
strmbase_sink_init(&filter->sink, &TransformFilter_InputPin_Vtbl, &filter->filter, strmbase_sink_init(&filter->sink, &filter->filter, wcsInputPinName, &sink_ops, NULL);
wcsInputPinName, &sink_ops, NULL);
strmbase_source_init(&filter->source, &filter->filter, wcsOutputPinName, &source_ops); strmbase_source_init(&filter->source, &filter->filter, wcsOutputPinName, &source_ops);
filter->source_IQualityControl_iface.lpVtbl = &source_qc_vtbl; filter->source_IQualityControl_iface.lpVtbl = &source_qc_vtbl;
...@@ -454,25 +451,3 @@ HRESULT strmbase_transform_create(LONG filter_size, IUnknown *outer, const CLSID ...@@ -454,25 +451,3 @@ HRESULT strmbase_transform_create(LONG filter_size, IUnknown *outer, const CLSID
CoTaskMemFree(pTf); CoTaskMemFree(pTf);
return E_FAIL; return E_FAIL;
} }
static const IPinVtbl TransformFilter_InputPin_Vtbl =
{
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
BaseInputPinImpl_ReceiveConnection,
BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseInputPinImpl_EndOfStream,
BaseInputPinImpl_BeginFlush,
BaseInputPinImpl_EndFlush,
BaseInputPinImpl_NewSegment
};
...@@ -97,7 +97,6 @@ const char* media_quark_string = "media-sample"; ...@@ -97,7 +97,6 @@ const char* media_quark_string = "media-sample";
static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0}; 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_InputPin_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);
...@@ -1502,8 +1501,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr) ...@@ -1502,8 +1501,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
} }
strmbase_filter_init(&object->filter, outer, &CLSID_Gstreamer_Splitter, &filter_ops); strmbase_filter_init(&object->filter, outer, &CLSID_Gstreamer_Splitter, &filter_ops);
strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter, strmbase_sink_init(&object->sink, &object->filter, wcsInputPinName, &sink_ops, NULL);
wcsInputPinName, &sink_ops, NULL);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL); object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
object->init_gst = gstdecoder_init_gst; object->init_gst = gstdecoder_init_gst;
...@@ -1967,27 +1965,6 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This) ...@@ -1967,27 +1965,6 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This)
return S_OK; return S_OK;
} }
static const IPinVtbl GST_InputPin_Vtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
BaseInputPinImpl_ReceiveConnection,
BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseInputPinImpl_EndOfStream,
BaseInputPinImpl_BeginFlush,
BaseInputPinImpl_EndFlush,
BaseInputPinImpl_NewSegment
};
pthread_mutex_t cb_list_lock = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t cb_list_lock = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cb_list_cond = PTHREAD_COND_INITIALIZER; pthread_cond_t cb_list_cond = PTHREAD_COND_INITIALIZER;
struct list cb_list = LIST_INIT(cb_list); struct list cb_list = LIST_INIT(cb_list);
...@@ -2235,8 +2212,7 @@ IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr) ...@@ -2235,8 +2212,7 @@ IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr)
} }
strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops); strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops);
strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter, strmbase_sink_init(&object->sink, &object->filter, sink_name, &wave_parser_sink_ops, NULL);
sink_name, &wave_parser_sink_ops, NULL);
object->init_gst = wave_parser_init_gst; object->init_gst = wave_parser_init_gst;
*phr = S_OK; *phr = S_OK;
...@@ -2339,8 +2315,7 @@ IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr) ...@@ -2339,8 +2315,7 @@ IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr)
} }
strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops); strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops);
strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter, strmbase_sink_init(&object->sink, &object->filter, sink_name, &avi_splitter_sink_ops, NULL);
sink_name, &avi_splitter_sink_ops, NULL);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL); object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
object->init_gst = avi_splitter_init_gst; object->init_gst = avi_splitter_init_gst;
*phr = S_OK; *phr = S_OK;
...@@ -2475,8 +2450,7 @@ IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr) ...@@ -2475,8 +2450,7 @@ IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr)
} }
strmbase_filter_init(&object->filter, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops); strmbase_filter_init(&object->filter, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops);
strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter, strmbase_sink_init(&object->sink, &object->filter, sink_name, &mpeg_splitter_sink_ops, NULL);
sink_name, &mpeg_splitter_sink_ops, NULL);
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);
......
...@@ -171,7 +171,6 @@ typedef struct QTSplitter { ...@@ -171,7 +171,6 @@ typedef struct QTSplitter {
HANDLE splitterThread; HANDLE splitterThread;
} QTSplitter; } QTSplitter;
static const IPinVtbl QT_InputPin_Vtbl;
static const IBaseFilterVtbl QT_Vtbl; static const IBaseFilterVtbl QT_Vtbl;
static const IMediaSeekingVtbl QT_Seeking_Vtbl; static const IMediaSeekingVtbl QT_Seeking_Vtbl;
...@@ -421,8 +420,7 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr) ...@@ -421,8 +420,7 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
ZeroMemory(This,sizeof(*This)); ZeroMemory(This,sizeof(*This));
strmbase_filter_init(&This->filter, outer, &CLSID_QTSplitter, &filter_ops); strmbase_filter_init(&This->filter, outer, &CLSID_QTSplitter, &filter_ops);
strmbase_sink_init(&This->pInputPin.pin, &QT_InputPin_Vtbl, &This->filter, strmbase_sink_init(&This->pInputPin.pin, &This->filter, wcsInputPinName, &sink_ops, NULL);
wcsInputPinName, &sink_ops, NULL);
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");
...@@ -1030,27 +1028,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter) ...@@ -1030,27 +1028,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
return hr; return hr;
} }
static const IPinVtbl QT_InputPin_Vtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
BaseInputPinImpl_ReceiveConnection,
BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
BasePinImpl_QueryDirection,
BasePinImpl_QueryId,
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
BaseInputPinImpl_EndOfStream,
BaseInputPinImpl_BeginFlush,
BaseInputPinImpl_EndFlush,
BaseInputPinImpl_NewSegment
};
static inline QTOutPin *impl_source_from_strmbase_pin(struct strmbase_pin *iface) static inline QTOutPin *impl_source_from_strmbase_pin(struct strmbase_pin *iface)
{ {
return CONTAINING_RECORD(iface, QTOutPin, pin.pin); return CONTAINING_RECORD(iface, QTOutPin, pin.pin);
......
...@@ -103,20 +103,6 @@ struct strmbase_sink_ops ...@@ -103,20 +103,6 @@ struct strmbase_sink_ops
/* Base Pin */ /* Base Pin */
HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt); HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt);
LONG WINAPI BasePinImpl_GetMediaTypeVersion(struct strmbase_pin *pin);
HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out);
ULONG WINAPI BasePinImpl_AddRef(IPin *iface);
ULONG WINAPI BasePinImpl_Release(IPin *iface);
HRESULT WINAPI BaseInputPinImpl_Disconnect(IPin * iface);
HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin);
HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt);
HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin * iface, PIN_INFO * pInfo);
HRESULT WINAPI BasePinImpl_QueryDirection(IPin * iface, PIN_DIRECTION * pPinDir);
HRESULT WINAPI BasePinImpl_QueryId(IPin * iface, LPWSTR * Id);
HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum);
HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin);
HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *pin, HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *pin,
IMediaSample **sample, REFERENCE_TIME *start, REFERENCE_TIME *stop, DWORD flags); IMediaSample **sample, REFERENCE_TIME *start, REFERENCE_TIME *stop, DWORD flags);
...@@ -130,16 +116,7 @@ void strmbase_source_cleanup(struct strmbase_source *pin); ...@@ -130,16 +116,7 @@ void strmbase_source_cleanup(struct strmbase_source *pin);
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_source_ops *func_table); const WCHAR *name, const struct strmbase_source_ops *func_table);
/* Base Input Pin */ void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter,
HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt);
HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface);
HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface);
HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface);
HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator); const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator);
void strmbase_sink_cleanup(struct strmbase_sink *pin); void strmbase_sink_cleanup(struct strmbase_sink *pin);
......
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