strmbase: Pass an unsigned index to pin_get_media_type().

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-09-24 19:10:12 -05:00 committed by Alexandre Julliard
parent f46fe6d371
commit b0e47ab9e7
10 changed files with 18 additions and 34 deletions

View File

@ -526,12 +526,10 @@ static const IPinVtbl AVICompressorOutputPinVtbl = {
BasePinImpl_NewSegment
};
static HRESULT source_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt)
static HRESULT source_get_media_type(struct strmbase_pin *base, unsigned int iPosition, AM_MEDIA_TYPE *amt)
{
AVICompressor *This = impl_from_strmbase_filter(base->filter);
TRACE("(%p)->(%d %p)\n", base, iPosition, amt);
if(iPosition || !This->videoinfo)
return S_FALSE;

View File

@ -1174,12 +1174,10 @@ static HRESULT WINAPI AviMuxOut_AttemptConnection(struct strmbase_source *base,
return BaseOutputPinImpl_AttemptConnection(base, pReceivePin, pmt);
}
static HRESULT source_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt)
static HRESULT source_get_media_type(struct strmbase_pin *base, unsigned int iPosition, AM_MEDIA_TYPE *amt)
{
TRACE("(%p)->(%d %p)\n", base, iPosition, amt);
if(iPosition < 0)
return E_INVALIDARG;
if(iPosition > 0)
return VFW_S_NO_MORE_ITEMS;

View File

@ -179,7 +179,8 @@ static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE
return S_OK;
}
static HRESULT sink_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt)
static HRESULT sink_get_media_type(struct strmbase_pin *base,
unsigned int iPosition, AM_MEDIA_TYPE *amt)
{
SmartTeeFilter *This = impl_from_strmbase_pin(base);
HRESULT hr;
@ -367,7 +368,8 @@ static HRESULT capture_query_accept(struct strmbase_pin *base, const AM_MEDIA_TY
return S_OK;
}
static HRESULT capture_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt)
static HRESULT capture_get_media_type(struct strmbase_pin *base,
unsigned int iPosition, AM_MEDIA_TYPE *amt)
{
SmartTeeFilter *This = impl_from_strmbase_pin(base);
TRACE("(%p, %d, %p)\n", This, iPosition, amt);
@ -437,7 +439,8 @@ static HRESULT preview_query_accept(struct strmbase_pin *base, const AM_MEDIA_TY
return S_OK;
}
static HRESULT preview_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt)
static HRESULT preview_get_media_type(struct strmbase_pin *base,
unsigned int iPosition, AM_MEDIA_TYPE *amt)
{
SmartTeeFilter *This = impl_from_strmbase_pin(base);
TRACE("(%p, %d, %p)\n", This, iPosition, amt);

View File

@ -518,14 +518,13 @@ static HRESULT source_query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE
return qcap_driver_check_format(filter->driver_info, mt);
}
static HRESULT source_get_media_type(struct strmbase_pin *pin, int iPosition, AM_MEDIA_TYPE *pmt)
static HRESULT source_get_media_type(struct strmbase_pin *pin,
unsigned int iPosition, AM_MEDIA_TYPE *pmt)
{
VfwCapture *filter = impl_from_strmbase_pin(pin);
AM_MEDIA_TYPE *vfw_pmt;
HRESULT hr;
if (iPosition < 0)
return E_INVALIDARG;
if (iPosition > 0)
return VFW_S_NO_MORE_ITEMS;

View File

@ -591,13 +591,11 @@ static HRESULT source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TY
return S_FALSE;
}
static HRESULT source_get_media_type(struct strmbase_pin *iface, int index, AM_MEDIA_TYPE *mt)
static HRESULT source_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
{
AsyncReader *filter = impl_from_strmbase_pin(iface);
if (index < 0)
return E_INVALIDARG;
else if (index > 1)
if (index > 1)
return VFW_S_NO_MORE_ITEMS;
if (index == 0)

View File

@ -152,11 +152,8 @@ static BOOL CompareMediaTypes(const AM_MEDIA_TYPE * pmt1, const AM_MEDIA_TYPE *
((bWildcards && (IsEqualGUID(&pmt1->subtype, &GUID_NULL) || IsEqualGUID(&pmt2->subtype, &GUID_NULL))) || IsEqualGUID(&pmt1->subtype, &pmt2->subtype)));
}
/*** Common Base Pin function */
HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt)
HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
{
if (iPosition < 0)
return E_INVALIDARG;
return VFW_S_NO_MORE_ITEMS;
}

View File

@ -110,12 +110,10 @@ static HRESULT WINAPI TransformFilter_Output_DecideBufferSize(struct strmbase_so
return pTransformFilter->pFuncsTable->pfnDecideBufferSize(pTransformFilter, pAlloc, ppropInputRequest);
}
static HRESULT source_get_media_type(struct strmbase_pin *This, int iPosition, AM_MEDIA_TYPE *pmt)
static HRESULT source_get_media_type(struct strmbase_pin *This, unsigned int iPosition, AM_MEDIA_TYPE *pmt)
{
TransformFilter *pTransform = impl_from_source_IPin(&This->IPin_iface);
if (iPosition < 0)
return E_INVALIDARG;
if (iPosition > 0)
return VFW_S_NO_MORE_ITEMS;
CopyMediaType(pmt, &pTransform->pmt);

View File

@ -1799,15 +1799,10 @@ static HRESULT source_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYP
return S_OK;
}
static HRESULT source_get_media_type(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt)
static HRESULT source_get_media_type(struct strmbase_pin *iface, unsigned int iPosition, AM_MEDIA_TYPE *pmt)
{
struct gstdemux_source *This = impl_source_from_IPin(&iface->IPin_iface);
TRACE("(%p)->(%i, %p)\n", This, iPosition, pmt);
if (iPosition < 0)
return E_INVALIDARG;
if (iPosition > 0)
return VFW_S_NO_MORE_ITEMS;

View File

@ -1295,12 +1295,10 @@ static HRESULT source_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYP
return S_OK;
}
static HRESULT source_get_media_type(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt)
static HRESULT source_get_media_type(struct strmbase_pin *iface, unsigned int iPosition, AM_MEDIA_TYPE *pmt)
{
QTOutPin *This = impl_sink_from_strmbase_pin(iface);
if (iPosition < 0)
return E_INVALIDARG;
if (iPosition > 0)
return VFW_S_NO_MORE_ITEMS;
CopyMediaType(pmt, This->pmt);

View File

@ -46,7 +46,7 @@ typedef struct BasePinFuncTable {
/* Required for QueryAccept(), Connect(), ReceiveConnection(). */
HRESULT (*pin_query_accept)(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt);
/* Required for EnumMediaTypes(). */
HRESULT (*pin_get_media_type)(struct strmbase_pin *pin, int index, AM_MEDIA_TYPE *mt);
HRESULT (*pin_get_media_type)(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt);
} BasePinFuncTable;
struct strmbase_source
@ -95,7 +95,7 @@ typedef struct BaseInputPinFuncTable {
} BaseInputPinFuncTable;
/* Base Pin */
HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, 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);
ULONG WINAPI BasePinImpl_AddRef(IPin *iface);
ULONG WINAPI BasePinImpl_Release(IPin *iface);