strmbase: Get rid of the "pfnGetPinCount" callback.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
89242d8b94
commit
dad885e2b9
|
@ -321,16 +321,8 @@ static IPin* WINAPI MediaStreamFilterImpl_GetPin(BaseFilter *iface, int pos)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static LONG WINAPI MediaStreamFilterImpl_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
IMediaStreamFilterImpl* This = (IMediaStreamFilterImpl*)iface;
|
||||
|
||||
return This->nb_streams;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable BaseFuncTable = {
|
||||
MediaStreamFilterImpl_GetPin,
|
||||
MediaStreamFilterImpl_GetPinCount
|
||||
};
|
||||
|
||||
HRESULT MediaStreamFilter_create(IUnknown *pUnkOuter, void **ppObj)
|
||||
|
|
|
@ -194,16 +194,9 @@ static IPin* WINAPI filter_GetPin(BaseFilter *iface, int position)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static LONG WINAPI filter_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
FIXME("(%p): stub!\n", iface);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable basefilter_functable =
|
||||
{
|
||||
filter_GetPin,
|
||||
filter_GetPinCount,
|
||||
};
|
||||
|
||||
HRESULT evr_filter_create(IUnknown *outer_unk, void **ppv)
|
||||
|
|
|
@ -177,16 +177,8 @@ static IPin* WINAPI AudioRecord_GetPin(BaseFilter *iface, int pos)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static LONG WINAPI AudioRecord_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
AudioRecord *This = impl_from_BaseFilter(iface);
|
||||
FIXME("(%p): stub\n", This);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable AudioRecordFuncs = {
|
||||
AudioRecord_GetPin,
|
||||
AudioRecord_GetPinCount
|
||||
};
|
||||
|
||||
static HRESULT WINAPI PPB_QueryInterface(IPersistPropertyBag *iface, REFIID riid, LPVOID *ppv)
|
||||
|
|
|
@ -266,14 +266,8 @@ static IPin* WINAPI AVICompressor_GetPin(BaseFilter *iface, int pos)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static LONG WINAPI AVICompressor_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable filter_func_table = {
|
||||
AVICompressor_GetPin,
|
||||
AVICompressor_GetPinCount
|
||||
};
|
||||
|
||||
static AVICompressor *impl_from_IPersistPropertyBag(IPersistPropertyBag *iface)
|
||||
|
|
|
@ -133,16 +133,8 @@ static IPin* WINAPI AviMux_GetPin(BaseFilter *iface, int pos)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static LONG WINAPI AviMux_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
AviMux *This = impl_from_BaseFilter(iface);
|
||||
TRACE("(%p)\n", This);
|
||||
return This->input_pin_no+1;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable filter_func_table = {
|
||||
AviMux_GetPin,
|
||||
AviMux_GetPinCount
|
||||
};
|
||||
|
||||
static inline AviMux* impl_from_IBaseFilter(IBaseFilter *iface)
|
||||
|
|
|
@ -224,13 +224,8 @@ static IPin* WINAPI SmartTeeFilter_GetPin(BaseFilter *iface, int pos)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static LONG WINAPI SmartTeeFilter_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
static const BaseFilterFuncTable SmartTeeFilterFuncs = {
|
||||
SmartTeeFilter_GetPin,
|
||||
SmartTeeFilter_GetPinCount
|
||||
};
|
||||
|
||||
static ULONG WINAPI SmartTeeFilterInput_AddRef(IPin *iface)
|
||||
|
|
|
@ -203,14 +203,8 @@ static IPin* WINAPI VfwCapture_GetPin(BaseFilter *iface, int pos)
|
|||
return This->pOutputPin;
|
||||
}
|
||||
|
||||
static LONG WINAPI VfwCapture_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable BaseFuncTable = {
|
||||
VfwCapture_GetPin,
|
||||
VfwCapture_GetPinCount
|
||||
};
|
||||
|
||||
IUnknown * WINAPI QCAP_createVFWCaptureFilter(IUnknown *pUnkOuter, HRESULT *phr)
|
||||
|
|
|
@ -354,14 +354,8 @@ static IPin *WINAPI SampleGrabber_GetPin(BaseFilter *iface, int pos)
|
|||
return pin;
|
||||
}
|
||||
|
||||
static LONG WINAPI SampleGrabber_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable basefunc_vtbl = {
|
||||
SampleGrabber_GetPin,
|
||||
SampleGrabber_GetPinCount
|
||||
};
|
||||
|
||||
/* Helper that buffers data and/or calls installed sample callbacks */
|
||||
|
|
|
@ -405,21 +405,8 @@ static IPin* WINAPI AsyncReader_GetPin(BaseFilter *iface, int pos)
|
|||
return This->pOutputPin;
|
||||
}
|
||||
|
||||
static LONG WINAPI AsyncReader_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
AsyncReader *This = impl_from_BaseFilter(iface);
|
||||
|
||||
TRACE("%p->()\n", This);
|
||||
|
||||
if (!This->pOutputPin)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable BaseFuncTable = {
|
||||
AsyncReader_GetPin,
|
||||
AsyncReader_GetPinCount
|
||||
};
|
||||
|
||||
HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv)
|
||||
|
|
|
@ -77,18 +77,8 @@ static IPin* WINAPI Parser_GetPin(BaseFilter *iface, int pos)
|
|||
return This->ppPins[pos];
|
||||
}
|
||||
|
||||
static LONG WINAPI Parser_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
ParserImpl *This = impl_from_BaseFilter(iface);
|
||||
|
||||
TRACE("%p->()\n", This);
|
||||
|
||||
return This->cStreams + 1;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable BaseFuncTable = {
|
||||
Parser_GetPin,
|
||||
Parser_GetPinCount
|
||||
};
|
||||
|
||||
HRESULT Parser_Create(ParserImpl *pParser, const IBaseFilterVtbl *Parser_Vtbl,
|
||||
|
|
|
@ -144,9 +144,8 @@ HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin
|
|||
|
||||
TRACE("(%p)->(%s, %p)\n", This, debugstr_w(id), ret);
|
||||
|
||||
for (i = 0; i < This->pFuncsTable->pfnGetPinCount(This); ++i)
|
||||
for (i = 0; (pin = This->pFuncsTable->pfnGetPin(This, i)); ++i)
|
||||
{
|
||||
pin = This->pFuncsTable->pfnGetPin(This, i);
|
||||
hr = IPin_QueryPinInfo(pin, &info);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
|
|
@ -194,11 +194,6 @@ static IPin* WINAPI BaseRenderer_GetPin(BaseFilter *iface, int pos)
|
|||
return &This->pInputPin->pin.IPin_iface;
|
||||
}
|
||||
|
||||
static LONG WINAPI BaseRenderer_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI BaseRenderer_Input_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE * pmt)
|
||||
{
|
||||
BaseRenderer *This = impl_from_IBaseFilter(pin->pinInfo.pFilter);
|
||||
|
@ -213,7 +208,6 @@ static HRESULT WINAPI BaseRenderer_Receive(BaseInputPin *pin, IMediaSample * pSa
|
|||
|
||||
static const BaseFilterFuncTable RendererBaseFilterFuncTable = {
|
||||
BaseRenderer_GetPin,
|
||||
BaseRenderer_GetPinCount
|
||||
};
|
||||
|
||||
static const BaseInputPinFuncTable input_BaseInputFuncTable = {
|
||||
|
|
|
@ -139,14 +139,8 @@ static IPin *WINAPI TransformFilter_GetPin(BaseFilter *iface, int index)
|
|||
return filter->ppPins[index];
|
||||
}
|
||||
|
||||
static LONG WINAPI TransformFilter_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable tfBaseFuncTable = {
|
||||
TransformFilter_GetPin,
|
||||
TransformFilter_GetPinCount
|
||||
};
|
||||
|
||||
static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = {
|
||||
|
|
|
@ -1210,16 +1210,8 @@ static IPin* WINAPI GST_GetPin(BaseFilter *iface, int pos)
|
|||
return pin;
|
||||
}
|
||||
|
||||
static LONG WINAPI GST_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
GSTImpl *This = (GSTImpl *)iface;
|
||||
TRACE("%p -> %u\n", This, This->cStreams + 1);
|
||||
return (This->cStreams + 1);
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable BaseFuncTable = {
|
||||
GST_GetPin,
|
||||
GST_GetPinCount
|
||||
};
|
||||
|
||||
IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *pUnkOuter, HRESULT *phr)
|
||||
|
|
|
@ -233,18 +233,8 @@ static IPin * WINAPI QT_GetPin(BaseFilter *base, int index)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static LONG WINAPI QT_GetPinCount(BaseFilter *iface)
|
||||
{
|
||||
QTSplitter *This = impl_from_BaseFilter(iface);
|
||||
int c = 1;
|
||||
if (This->pAudio_Pin) c++;
|
||||
if (This->pVideo_Pin) c++;
|
||||
return c;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable BaseFuncTable = {
|
||||
QT_GetPin,
|
||||
QT_GetPinCount
|
||||
};
|
||||
|
||||
IUnknown * CALLBACK QTSplitter_create(IUnknown *punkout, HRESULT *phr)
|
||||
|
|
|
@ -169,12 +169,10 @@ typedef struct BaseFilter
|
|||
} BaseFilter;
|
||||
|
||||
typedef IPin* (WINAPI *BaseFilter_GetPin)(BaseFilter* iface, int iPosition);
|
||||
typedef LONG (WINAPI *BaseFilter_GetPinCount)(BaseFilter* iface);
|
||||
|
||||
typedef struct BaseFilterFuncTable {
|
||||
/* Required */
|
||||
BaseFilter_GetPin pfnGetPin;
|
||||
BaseFilter_GetPinCount pfnGetPinCount;
|
||||
} BaseFilterFuncTable;
|
||||
|
||||
HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
|
||||
|
|
Loading…
Reference in New Issue