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

strmbase: Get rid of the version fields from IEnumMediaTypesImpl.

parent b68498c8
...@@ -83,8 +83,6 @@ typedef struct IEnumMediaTypesImpl ...@@ -83,8 +83,6 @@ typedef struct IEnumMediaTypesImpl
LONG refCount; LONG refCount;
BasePin *basePin; BasePin *basePin;
BasePin_GetMediaType enumMediaFunction; BasePin_GetMediaType enumMediaFunction;
BasePin_GetMediaTypeVersion mediaVersionFunction;
LONG currentVersion;
ULONG count; ULONG count;
ULONG uIndex; ULONG uIndex;
} IEnumMediaTypesImpl; } IEnumMediaTypesImpl;
...@@ -96,7 +94,7 @@ static inline IEnumMediaTypesImpl *impl_from_IEnumMediaTypes(IEnumMediaTypes *if ...@@ -96,7 +94,7 @@ static inline IEnumMediaTypesImpl *impl_from_IEnumMediaTypes(IEnumMediaTypes *if
static const struct IEnumMediaTypesVtbl IEnumMediaTypesImpl_Vtbl; static const struct IEnumMediaTypesVtbl IEnumMediaTypesImpl_Vtbl;
HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType enumFunc, BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes ** ppEnum) HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType enumFunc, IEnumMediaTypes **ppEnum)
{ {
ULONG i; ULONG i;
IEnumMediaTypesImpl * pEnumMediaTypes = CoTaskMemAlloc(sizeof(IEnumMediaTypesImpl)); IEnumMediaTypesImpl * pEnumMediaTypes = CoTaskMemAlloc(sizeof(IEnumMediaTypesImpl));
...@@ -111,7 +109,6 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType e ...@@ -111,7 +109,6 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType e
pEnumMediaTypes->refCount = 1; pEnumMediaTypes->refCount = 1;
pEnumMediaTypes->uIndex = 0; pEnumMediaTypes->uIndex = 0;
pEnumMediaTypes->enumMediaFunction = enumFunc; pEnumMediaTypes->enumMediaFunction = enumFunc;
pEnumMediaTypes->mediaVersionFunction = versionFunc;
IPin_AddRef(&basePin->IPin_iface); IPin_AddRef(&basePin->IPin_iface);
pEnumMediaTypes->basePin = basePin; pEnumMediaTypes->basePin = basePin;
...@@ -124,7 +121,6 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType e ...@@ -124,7 +121,6 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType e
pEnumMediaTypes->count = i; pEnumMediaTypes->count = i;
*ppEnum = &pEnumMediaTypes->IEnumMediaTypes_iface; *ppEnum = &pEnumMediaTypes->IEnumMediaTypes_iface;
pEnumMediaTypes->currentVersion = versionFunc(basePin);
return S_OK; return S_OK;
} }
...@@ -180,9 +176,6 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Next(IEnumMediaTypes *iface, ...@@ -180,9 +176,6 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Next(IEnumMediaTypes *iface,
TRACE("iface %p, count %u, mts %p, ret_count %p.\n", iface, count, mts, ret_count); TRACE("iface %p, count %u, mts %p, ret_count %p.\n", iface, count, mts, ret_count);
if (enummt->currentVersion != enummt->mediaVersionFunction(enummt->basePin))
return VFW_E_ENUM_OUT_OF_SYNC;
for (i = 0; i < count && enummt->uIndex + i < enummt->count; i++) for (i = 0; i < count && enummt->uIndex + i < enummt->count; i++)
{ {
if (!(mts[i] = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))) if (!(mts[i] = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)))
...@@ -209,9 +202,6 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Skip(IEnumMediaTypes *iface, ULONG cou ...@@ -209,9 +202,6 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Skip(IEnumMediaTypes *iface, ULONG cou
TRACE("iface %p, count %u.\n", iface, count); TRACE("iface %p, count %u.\n", iface, count);
if (enummt->currentVersion != enummt->mediaVersionFunction(enummt->basePin))
return VFW_E_ENUM_OUT_OF_SYNC;
enummt->uIndex += count; enummt->uIndex += count;
return enummt->uIndex > enummt->count ? S_FALSE : S_OK; return enummt->uIndex > enummt->count ? S_FALSE : S_OK;
...@@ -232,7 +222,6 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Reset(IEnumMediaTypes * iface) ...@@ -232,7 +222,6 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Reset(IEnumMediaTypes * iface)
i++; i++;
} }
This->count = i; This->count = i;
This->currentVersion = This->mediaVersionFunction(This->basePin);
This->uIndex = 0; This->uIndex = 0;
return S_OK; return S_OK;
...@@ -245,7 +234,7 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Clone(IEnumMediaTypes * iface, IEnumMe ...@@ -245,7 +234,7 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Clone(IEnumMediaTypes * iface, IEnumMe
TRACE("(%p)->(%p)\n", iface, ppEnum); TRACE("(%p)->(%p)\n", iface, ppEnum);
hr = EnumMediaTypes_Construct(This->basePin, This->enumMediaFunction, This->mediaVersionFunction, ppEnum); hr = EnumMediaTypes_Construct(This->basePin, This->enumMediaFunction, ppEnum);
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
return IEnumMediaTypes_Skip(*ppEnum, This->uIndex); return IEnumMediaTypes_Skip(*ppEnum, This->uIndex);
......
...@@ -160,11 +160,6 @@ HRESULT WINAPI BasePinImpl_GetMediaType(BasePin *iface, int iPosition, AM_MEDIA_ ...@@ -160,11 +160,6 @@ HRESULT WINAPI BasePinImpl_GetMediaType(BasePin *iface, int iPosition, AM_MEDIA_
return VFW_S_NO_MORE_ITEMS; return VFW_S_NO_MORE_ITEMS;
} }
LONG WINAPI BasePinImpl_GetMediaTypeVersion(BasePin *iface)
{
return 1;
}
ULONG WINAPI BasePinImpl_AddRef(IPin *iface) ULONG WINAPI BasePinImpl_AddRef(IPin *iface)
{ {
BasePin *pin = impl_from_IPin(iface); BasePin *pin = impl_from_IPin(iface);
...@@ -306,8 +301,7 @@ HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_me ...@@ -306,8 +301,7 @@ HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_me
TRACE("iface %p, enum_media_types %p.\n", iface, enum_media_types); TRACE("iface %p, enum_media_types %p.\n", iface, enum_media_types);
return EnumMediaTypes_Construct(pin, pin->pFuncsTable->pfnGetMediaType, return EnumMediaTypes_Construct(pin, pin->pFuncsTable->pfnGetMediaType, enum_media_types);
BasePinImpl_GetMediaTypeVersion, enum_media_types);
} }
HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin) HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin)
......
...@@ -64,7 +64,7 @@ void QualityControlRender_EndRender(QualityControlImpl *This); ...@@ -64,7 +64,7 @@ void QualityControlRender_EndRender(QualityControlImpl *This);
HRESULT enum_pins_create(struct strmbase_filter *filter, IEnumPins **enum_pins); HRESULT enum_pins_create(struct strmbase_filter *filter, IEnumPins **enum_pins);
HRESULT WINAPI EnumMediaTypes_Construct(BasePin *pin, BasePin_GetMediaType enumFunc, HRESULT WINAPI EnumMediaTypes_Construct(BasePin *pin, BasePin_GetMediaType enumFunc,
BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes **enum_media_types) DECLSPEC_HIDDEN; IEnumMediaTypes **enum_media_types) DECLSPEC_HIDDEN;
HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_TIME start); HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_TIME start);
HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface); HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface);
......
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