strmbase: Use an unsigned int for the GetPin() callback.

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-05-23 17:06:30 -05:00 committed by Alexandre Julliard
parent 27bf52d12c
commit 97546ca0b7
15 changed files with 44 additions and 67 deletions

View File

@ -191,9 +191,9 @@ static const IBaseFilterVtbl basefilter_vtbl =
BaseFilterImpl_QueryVendorInfo
};
static IPin* WINAPI filter_GetPin(BaseFilter *iface, int position)
static IPin * WINAPI filter_GetPin(BaseFilter *iface, unsigned int index)
{
FIXME("(%p, %d): stub!\n", iface, position);
FIXME("iface %p, index %u, stub!\n", iface, index);
return NULL;
}

View File

@ -171,10 +171,9 @@ static const IBaseFilterVtbl AudioRecordVtbl = {
BaseFilterImpl_QueryVendorInfo
};
static IPin* WINAPI AudioRecord_GetPin(BaseFilter *iface, int pos)
static IPin * WINAPI AudioRecord_GetPin(BaseFilter *iface, unsigned int index)
{
AudioRecord *This = impl_from_BaseFilter(iface);
FIXME("(%p, %d): stub\n", This, pos);
FIXME("iface %p, index %u, stub!\n", iface, index);
return NULL;
}

View File

@ -244,24 +244,17 @@ static const IBaseFilterVtbl AVICompressorVtbl = {
AVICompressor_QueryVendorInfo
};
static IPin* WINAPI AVICompressor_GetPin(BaseFilter *iface, int pos)
static IPin * WINAPI AVICompressor_GetPin(BaseFilter *iface, unsigned int index)
{
AVICompressor *This = impl_from_BaseFilter(iface);
IPin *ret;
TRACE("(%p)->(%d)\n", This, pos);
switch(pos) {
case 0:
if (index == 0)
ret = &This->in->pin.IPin_iface;
break;
case 1:
else if (index == 1)
ret = &This->out->pin.IPin_iface;
break;
default:
TRACE("No pin %d\n", pos);
else
return NULL;
};
IPin_AddRef(ret);
return ret;

View File

@ -116,18 +116,19 @@ static inline AviMux* impl_from_BaseFilter(BaseFilter *filter)
return CONTAINING_RECORD(filter, AviMux, filter);
}
static IPin* WINAPI AviMux_GetPin(BaseFilter *iface, int pos)
static IPin * WINAPI AviMux_GetPin(BaseFilter *iface, unsigned int index)
{
AviMux *This = impl_from_BaseFilter(iface);
TRACE("(%p)->(%d)\n", This, pos);
if(pos == 0) {
if (!index)
{
IPin_AddRef(&This->out->pin.pin.IPin_iface);
return &This->out->pin.pin.IPin_iface;
}else if(pos>0 && pos<=This->input_pin_no) {
IPin_AddRef(&This->in[pos-1]->pin.pin.IPin_iface);
return &This->in[pos-1]->pin.pin.IPin_iface;
}
else if (index <= This->input_pin_no)
{
IPin_AddRef(&This->in[index - 1]->pin.pin.IPin_iface);
return &This->in[index - 1]->pin.pin.IPin_iface;
}
return NULL;

View File

@ -199,27 +199,19 @@ static const IBaseFilterVtbl SmartTeeFilterVtbl = {
BaseFilterImpl_QueryVendorInfo
};
static IPin* WINAPI SmartTeeFilter_GetPin(BaseFilter *iface, int pos)
static IPin * WINAPI SmartTeeFilter_GetPin(BaseFilter *iface, unsigned int index)
{
SmartTeeFilter *This = impl_from_BaseFilter(iface);
IPin *ret;
TRACE("(%p)->(%d)\n", This, pos);
switch(pos) {
case 0:
if (index == 0)
ret = &This->input->pin.IPin_iface;
break;
case 1:
else if (index == 1)
ret = &This->capture->pin.IPin_iface;
break;
case 2:
else if (index == 2)
ret = &This->preview->pin.IPin_iface;
break;
default:
TRACE("No pin %d\n", pos);
else
return NULL;
}
IPin_AddRef(ret);
return ret;

View File

@ -192,11 +192,11 @@ static const IUnknownVtbl unknown_inner_vtbl =
unknown_inner_Release,
};
static IPin* WINAPI VfwCapture_GetPin(BaseFilter *iface, int pos)
static IPin * WINAPI VfwCapture_GetPin(BaseFilter *iface, unsigned int index)
{
VfwCapture *This = impl_from_BaseFilter(iface);
if (pos >= 1 || pos < 0)
if (index >= 1)
return NULL;
IPin_AddRef(This->pOutputPin);

View File

@ -339,14 +339,14 @@ static const IUnknownVtbl samplegrabber_vtbl =
SampleGrabber_Release,
};
static IPin *WINAPI SampleGrabber_GetPin(BaseFilter *iface, int pos)
static IPin * WINAPI SampleGrabber_GetPin(BaseFilter *iface, unsigned int index)
{
SG_Impl *This = impl_from_BaseFilter(iface);
IPin *pin;
if (pos == 0)
if (index == 0)
pin = &This->pin_in.IPin_iface;
else if (pos == 1)
else if (index == 1)
pin = &This->pin_out.IPin_iface;
else
return NULL;

View File

@ -392,13 +392,11 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID *
return hr;
}
static IPin* WINAPI AsyncReader_GetPin(BaseFilter *iface, int pos)
static IPin * WINAPI AsyncReader_GetPin(BaseFilter *iface, unsigned int index)
{
AsyncReader *This = impl_from_BaseFilter(iface);
TRACE("%p->(%d)\n", This, pos);
if (pos >= 1 || !This->pOutputPin)
if (index >= 1 || !This->pOutputPin)
return NULL;
IPin_AddRef(This->pOutputPin);

View File

@ -62,19 +62,15 @@ static inline ParserImpl *impl_from_BaseFilter( BaseFilter *iface )
return CONTAINING_RECORD(iface, ParserImpl, filter);
}
/* FIXME: WRONG */
static IPin* WINAPI Parser_GetPin(BaseFilter *iface, int pos)
static IPin * WINAPI Parser_GetPin(BaseFilter *iface, unsigned int index)
{
ParserImpl *This = impl_from_BaseFilter(iface);
ParserImpl *filter = impl_from_BaseFilter(iface);
TRACE("%p->(%x)\n", This, pos);
/* Input pin also has a pin, hence the > and not >= */
if (pos > This->cStreams || pos < 0)
if (index > filter->cStreams)
return NULL;
IPin_AddRef(This->ppPins[pos]);
return This->ppPins[pos];
IPin_AddRef(filter->ppPins[index]);
return filter->ppPins[index];
}
static const BaseFilterFuncTable BaseFuncTable = {

View File

@ -137,10 +137,10 @@ HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **enum_pins
HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **ret)
{
BaseFilter *This = impl_from_IBaseFilter(iface);
unsigned int i;
PIN_INFO info;
HRESULT hr;
IPin *pin;
int i;
TRACE("(%p)->(%s, %p)\n", This, debugstr_w(id), ret);

View File

@ -183,11 +183,11 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl =
BaseInputPinImpl_NewSegment
};
static IPin* WINAPI BaseRenderer_GetPin(BaseFilter *iface, int pos)
static IPin * WINAPI BaseRenderer_GetPin(BaseFilter *iface, unsigned int index)
{
BaseRenderer *This = impl_from_BaseFilter(iface);
if (pos >= 1 || pos < 0)
if (index >= 1)
return NULL;
IPin_AddRef(&This->pInputPin->pin.IPin_iface);

View File

@ -128,11 +128,11 @@ static HRESULT WINAPI TransformFilter_Output_GetMediaType(BasePin *This, int iPo
return S_OK;
}
static IPin *WINAPI TransformFilter_GetPin(BaseFilter *iface, int index)
static IPin *WINAPI TransformFilter_GetPin(BaseFilter *iface, unsigned int index)
{
TransformFilter *filter = impl_from_BaseFilter(iface);
if (index >= 2 || index < 0)
if (index >= 2)
return NULL;
IPin_AddRef(filter->ppPins[index]);

View File

@ -1196,20 +1196,18 @@ static inline GSTOutPin *impl_from_IMediaSeeking( IMediaSeeking *iface )
return CONTAINING_RECORD(iface, GSTOutPin, seek.IMediaSeeking_iface);
}
static IPin* WINAPI GST_GetPin(BaseFilter *base, int pos)
static IPin* WINAPI GST_GetPin(BaseFilter *base, unsigned int index)
{
GSTImpl *This = impl_from_IBaseFilter(&base->IBaseFilter_iface);
IPin *pin;
TRACE("%p: Asking for pos %x\n", This, pos);
if (pos > This->cStreams || pos < 0)
if (index > This->cStreams)
return NULL;
if (!pos)
if (!index)
pin = &This->pInputPin.pin.IPin_iface;
else
pin = &This->ppPins[pos - 1]->pin.pin.IPin_iface;
pin = &This->ppPins[index - 1]->pin.pin.IPin_iface;
IPin_AddRef(pin);
return pin;

View File

@ -202,7 +202,7 @@ static inline QTSplitter *impl_from_IBaseFilter( IBaseFilter *iface )
* Base Filter
*/
static IPin * WINAPI QT_GetPin(BaseFilter *base, int index)
static IPin * WINAPI QT_GetPin(BaseFilter *base, unsigned int index)
{
QTSplitter *filter = impl_from_BaseFilter(base);

View File

@ -168,7 +168,7 @@ typedef struct BaseFilter
const struct BaseFilterFuncTable* pFuncsTable;
} BaseFilter;
typedef IPin* (WINAPI *BaseFilter_GetPin)(BaseFilter* iface, int iPosition);
typedef IPin * (WINAPI *BaseFilter_GetPin)(BaseFilter *iface, unsigned int index);
typedef struct BaseFilterFuncTable {
/* Required */