strmbase: Get rid of the "lpVtbl" parameter to BaseControlVideo_Init().

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-06-11 18:54:37 -05:00 committed by Alexandre Julliard
parent cb0b2d81d2
commit fbd9133ee5
4 changed files with 101 additions and 183 deletions

View File

@ -708,50 +708,6 @@ static const IBaseFilterVtbl VideoRenderer_Vtbl =
BaseFilterImpl_QueryVendorInfo BaseFilterImpl_QueryVendorInfo
}; };
static const IBasicVideoVtbl IBasicVideo_VTable =
{
BaseControlVideoImpl_QueryInterface,
BaseControlVideoImpl_AddRef,
BaseControlVideoImpl_Release,
BaseControlVideoImpl_GetTypeInfoCount,
BaseControlVideoImpl_GetTypeInfo,
BaseControlVideoImpl_GetIDsOfNames,
BaseControlVideoImpl_Invoke,
BaseControlVideoImpl_get_AvgTimePerFrame,
BaseControlVideoImpl_get_BitRate,
BaseControlVideoImpl_get_BitErrorRate,
BaseControlVideoImpl_get_VideoWidth,
BaseControlVideoImpl_get_VideoHeight,
BaseControlVideoImpl_put_SourceLeft,
BaseControlVideoImpl_get_SourceLeft,
BaseControlVideoImpl_put_SourceWidth,
BaseControlVideoImpl_get_SourceWidth,
BaseControlVideoImpl_put_SourceTop,
BaseControlVideoImpl_get_SourceTop,
BaseControlVideoImpl_put_SourceHeight,
BaseControlVideoImpl_get_SourceHeight,
BaseControlVideoImpl_put_DestinationLeft,
BaseControlVideoImpl_get_DestinationLeft,
BaseControlVideoImpl_put_DestinationWidth,
BaseControlVideoImpl_get_DestinationWidth,
BaseControlVideoImpl_put_DestinationTop,
BaseControlVideoImpl_get_DestinationTop,
BaseControlVideoImpl_put_DestinationHeight,
BaseControlVideoImpl_get_DestinationHeight,
BaseControlVideoImpl_SetSourcePosition,
BaseControlVideoImpl_GetSourcePosition,
BaseControlVideoImpl_SetDefaultSourcePosition,
BaseControlVideoImpl_SetDestinationPosition,
BaseControlVideoImpl_GetDestinationPosition,
BaseControlVideoImpl_SetDefaultDestinationPosition,
BaseControlVideoImpl_GetVideoSize,
BaseControlVideoImpl_GetVideoPaletteEntries,
BaseControlVideoImpl_GetCurrentImage,
BaseControlVideoImpl_IsUsingDefaultSource,
BaseControlVideoImpl_IsUsingDefaultDestination
};
/*** IUnknown methods ***/ /*** IUnknown methods ***/
static HRESULT WINAPI VideoWindow_QueryInterface(IVideoWindow *iface, REFIID riid, LPVOID *ppvObj) static HRESULT WINAPI VideoWindow_QueryInterface(IVideoWindow *iface, REFIID riid, LPVOID *ppvObj)
{ {
@ -902,7 +858,7 @@ HRESULT VideoRenderer_create(IUnknown *outer, void **out)
if (FAILED(hr)) if (FAILED(hr))
goto fail; goto fail;
hr = BaseControlVideo_Init(&pVideoRenderer->baseControlVideo, &IBasicVideo_VTable, hr = strmbase_video_init(&pVideoRenderer->baseControlVideo,
&pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.filter.csFilter, &pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.filter.csFilter,
&pVideoRenderer->renderer.pInputPin->pin, &renderer_BaseControlVideoFuncTable); &pVideoRenderer->renderer.pInputPin->pin, &renderer_BaseControlVideoFuncTable);
if (FAILED(hr)) if (FAILED(hr))

View File

@ -887,49 +887,6 @@ static const IVideoWindowVtbl IVideoWindow_VTable =
BaseControlWindowImpl_IsCursorHidden BaseControlWindowImpl_IsCursorHidden
}; };
static const IBasicVideoVtbl IBasicVideo_VTable =
{
BaseControlVideoImpl_QueryInterface,
BaseControlVideoImpl_AddRef,
BaseControlVideoImpl_Release,
BaseControlVideoImpl_GetTypeInfoCount,
BaseControlVideoImpl_GetTypeInfo,
BaseControlVideoImpl_GetIDsOfNames,
BaseControlVideoImpl_Invoke,
BaseControlVideoImpl_get_AvgTimePerFrame,
BaseControlVideoImpl_get_BitRate,
BaseControlVideoImpl_get_BitErrorRate,
BaseControlVideoImpl_get_VideoWidth,
BaseControlVideoImpl_get_VideoHeight,
BaseControlVideoImpl_put_SourceLeft,
BaseControlVideoImpl_get_SourceLeft,
BaseControlVideoImpl_put_SourceWidth,
BaseControlVideoImpl_get_SourceWidth,
BaseControlVideoImpl_put_SourceTop,
BaseControlVideoImpl_get_SourceTop,
BaseControlVideoImpl_put_SourceHeight,
BaseControlVideoImpl_get_SourceHeight,
BaseControlVideoImpl_put_DestinationLeft,
BaseControlVideoImpl_get_DestinationLeft,
BaseControlVideoImpl_put_DestinationWidth,
BaseControlVideoImpl_get_DestinationWidth,
BaseControlVideoImpl_put_DestinationTop,
BaseControlVideoImpl_get_DestinationTop,
BaseControlVideoImpl_put_DestinationHeight,
BaseControlVideoImpl_get_DestinationHeight,
BaseControlVideoImpl_SetSourcePosition,
BaseControlVideoImpl_GetSourcePosition,
BaseControlVideoImpl_SetDefaultSourcePosition,
BaseControlVideoImpl_SetDestinationPosition,
BaseControlVideoImpl_GetDestinationPosition,
BaseControlVideoImpl_SetDefaultDestinationPosition,
BaseControlVideoImpl_GetVideoSize,
BaseControlVideoImpl_GetVideoPaletteEntries,
BaseControlVideoImpl_GetCurrentImage,
BaseControlVideoImpl_IsUsingDefaultSource,
BaseControlVideoImpl_IsUsingDefaultDestination
};
static HRESULT WINAPI AMCertifiedOutputProtection_QueryInterface(IAMCertifiedOutputProtection *iface, static HRESULT WINAPI AMCertifiedOutputProtection_QueryInterface(IAMCertifiedOutputProtection *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
@ -2263,7 +2220,7 @@ static HRESULT vmr_create(IUnknown *outer, void **out, const CLSID *clsid)
if (FAILED(hr)) if (FAILED(hr))
goto fail; goto fail;
hr = BaseControlVideo_Init(&pVMR->baseControlVideo, &IBasicVideo_VTable, &pVMR->renderer.filter, hr = strmbase_video_init(&pVMR->baseControlVideo, &pVMR->renderer.filter,
&pVMR->renderer.filter.csFilter, &pVMR->renderer.pInputPin->pin, &pVMR->renderer.filter.csFilter, &pVMR->renderer.pInputPin->pin,
&renderer_BaseControlVideoFuncTable); &renderer_BaseControlVideoFuncTable);
if (FAILED(hr)) if (FAILED(hr))

View File

@ -27,17 +27,6 @@ static inline BaseControlVideo *impl_from_IBasicVideo(IBasicVideo *iface)
return CONTAINING_RECORD(iface, BaseControlVideo, IBasicVideo_iface); return CONTAINING_RECORD(iface, BaseControlVideo, IBasicVideo_iface);
} }
HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBasicVideoVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin* pPin, const BaseControlVideoFuncTable* pFuncsTable)
{
pControlVideo->IBasicVideo_iface.lpVtbl = lpVtbl;
pControlVideo->pFilter = owner;
pControlVideo->pInterfaceLock = lock;
pControlVideo->pPin = pPin;
pControlVideo->pFuncsTable = pFuncsTable;
return S_OK;
}
HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo) HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo)
{ {
return S_OK; return S_OK;
@ -51,7 +40,7 @@ static HRESULT BaseControlVideoImpl_CheckSourceRect(BaseControlVideo *This, RECT
if (IsRectEmpty(pSourceRect)) if (IsRectEmpty(pSourceRect))
return E_INVALIDARG; return E_INVALIDARG;
hr = BaseControlVideoImpl_GetVideoSize((IBasicVideo *)This, &VideoWidth, &VideoHeight); hr = IBasicVideo_GetVideoSize(&This->IBasicVideo_iface, &VideoWidth, &VideoHeight);
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
@ -70,39 +59,39 @@ static HRESULT BaseControlVideoImpl_CheckTargetRect(BaseControlVideo *This, RECT
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_QueryInterface(IBasicVideo *iface, REFIID iid, void **out) static HRESULT WINAPI basic_video_QueryInterface(IBasicVideo *iface, REFIID iid, void **out)
{ {
BaseControlVideo *video = impl_from_IBasicVideo(iface); BaseControlVideo *video = impl_from_IBasicVideo(iface);
return IUnknown_QueryInterface(video->pFilter->outer_unk, iid, out); return IUnknown_QueryInterface(video->pFilter->outer_unk, iid, out);
} }
ULONG WINAPI BaseControlVideoImpl_AddRef(IBasicVideo *iface) static ULONG WINAPI basic_video_AddRef(IBasicVideo *iface)
{ {
BaseControlVideo *video = impl_from_IBasicVideo(iface); BaseControlVideo *video = impl_from_IBasicVideo(iface);
return IUnknown_AddRef(video->pFilter->outer_unk); return IUnknown_AddRef(video->pFilter->outer_unk);
} }
ULONG WINAPI BaseControlVideoImpl_Release(IBasicVideo *iface) static ULONG WINAPI basic_video_Release(IBasicVideo *iface)
{ {
BaseControlVideo *video = impl_from_IBasicVideo(iface); BaseControlVideo *video = impl_from_IBasicVideo(iface);
return IUnknown_Release(video->pFilter->outer_unk); return IUnknown_Release(video->pFilter->outer_unk);
} }
HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT *count) static HRESULT WINAPI basic_video_GetTypeInfoCount(IBasicVideo *iface, UINT *count)
{ {
TRACE("iface %p, count %p.\n", iface, count); TRACE("iface %p, count %p.\n", iface, count);
*count = 1; *count = 1;
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo(IBasicVideo *iface, UINT index, static HRESULT WINAPI basic_video_GetTypeInfo(IBasicVideo *iface, UINT index,
LCID lcid, ITypeInfo **typeinfo) LCID lcid, ITypeInfo **typeinfo)
{ {
TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo);
return strmbase_get_typeinfo(IBasicVideo_tid, typeinfo); return strmbase_get_typeinfo(IBasicVideo_tid, typeinfo);
} }
HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID iid, static HRESULT WINAPI basic_video_GetIDsOfNames(IBasicVideo *iface, REFIID iid,
LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) LPOLESTR *names, UINT count, LCID lcid, DISPID *ids)
{ {
ITypeInfo *typeinfo; ITypeInfo *typeinfo;
@ -119,7 +108,7 @@ HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID iid
return hr; return hr;
} }
HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID id, REFIID iid, LCID lcid, static HRESULT WINAPI basic_video_Invoke(IBasicVideo *iface, DISPID id, REFIID iid, LCID lcid,
WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg)
{ {
ITypeInfo *typeinfo; ITypeInfo *typeinfo;
@ -136,7 +125,7 @@ HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID id, REFIID
return hr; return hr;
} }
HRESULT WINAPI BaseControlVideoImpl_get_AvgTimePerFrame(IBasicVideo *iface, REFTIME *pAvgTimePerFrame) static HRESULT WINAPI basic_video_get_AvgTimePerFrame(IBasicVideo *iface, REFTIME *pAvgTimePerFrame)
{ {
VIDEOINFOHEADER *vih; VIDEOINFOHEADER *vih;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -153,7 +142,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_AvgTimePerFrame(IBasicVideo *iface, REFT
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_get_BitRate(IBasicVideo *iface, LONG *pBitRate) static HRESULT WINAPI basic_video_get_BitRate(IBasicVideo *iface, LONG *pBitRate)
{ {
VIDEOINFOHEADER *vih; VIDEOINFOHEADER *vih;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -170,7 +159,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_BitRate(IBasicVideo *iface, LONG *pBitRa
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_get_BitErrorRate(IBasicVideo *iface, LONG *pBitErrorRate) static HRESULT WINAPI basic_video_get_BitErrorRate(IBasicVideo *iface, LONG *pBitErrorRate)
{ {
VIDEOINFOHEADER *vih; VIDEOINFOHEADER *vih;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -187,7 +176,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_BitErrorRate(IBasicVideo *iface, LONG *p
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_get_VideoWidth(IBasicVideo *iface, LONG *pVideoWidth) static HRESULT WINAPI basic_video_get_VideoWidth(IBasicVideo *iface, LONG *pVideoWidth)
{ {
VIDEOINFOHEADER *vih; VIDEOINFOHEADER *vih;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -202,7 +191,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_VideoWidth(IBasicVideo *iface, LONG *pVi
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_get_VideoHeight(IBasicVideo *iface, LONG *pVideoHeight) static HRESULT WINAPI basic_video_get_VideoHeight(IBasicVideo *iface, LONG *pVideoHeight)
{ {
VIDEOINFOHEADER *vih; VIDEOINFOHEADER *vih;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -217,7 +206,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_VideoHeight(IBasicVideo *iface, LONG *pV
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG SourceLeft) static HRESULT WINAPI basic_video_put_SourceLeft(IBasicVideo *iface, LONG SourceLeft)
{ {
RECT SourceRect; RECT SourceRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -237,7 +226,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG Sour
return hr; return hr;
} }
HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft(IBasicVideo *iface, LONG *pSourceLeft) static HRESULT WINAPI basic_video_get_SourceLeft(IBasicVideo *iface, LONG *pSourceLeft)
{ {
RECT SourceRect; RECT SourceRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -251,7 +240,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft(IBasicVideo *iface, LONG *pSo
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth(IBasicVideo *iface, LONG SourceWidth) static HRESULT WINAPI basic_video_put_SourceWidth(IBasicVideo *iface, LONG SourceWidth)
{ {
RECT SourceRect; RECT SourceRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -270,7 +259,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth(IBasicVideo *iface, LONG Sou
return hr; return hr;
} }
HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth(IBasicVideo *iface, LONG *pSourceWidth) static HRESULT WINAPI basic_video_get_SourceWidth(IBasicVideo *iface, LONG *pSourceWidth)
{ {
RECT SourceRect; RECT SourceRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -284,7 +273,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth(IBasicVideo *iface, LONG *pS
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG SourceTop) static HRESULT WINAPI basic_video_put_SourceTop(IBasicVideo *iface, LONG SourceTop)
{ {
RECT SourceRect; RECT SourceRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -304,7 +293,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG Sourc
return hr; return hr;
} }
HRESULT WINAPI BaseControlVideoImpl_get_SourceTop(IBasicVideo *iface, LONG *pSourceTop) static HRESULT WINAPI basic_video_get_SourceTop(IBasicVideo *iface, LONG *pSourceTop)
{ {
RECT SourceRect; RECT SourceRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -318,7 +307,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_SourceTop(IBasicVideo *iface, LONG *pSou
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight(IBasicVideo *iface, LONG SourceHeight) static HRESULT WINAPI basic_video_put_SourceHeight(IBasicVideo *iface, LONG SourceHeight)
{ {
RECT SourceRect; RECT SourceRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -337,7 +326,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight(IBasicVideo *iface, LONG So
return hr; return hr;
} }
HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight(IBasicVideo *iface, LONG *pSourceHeight) static HRESULT WINAPI basic_video_get_SourceHeight(IBasicVideo *iface, LONG *pSourceHeight)
{ {
RECT SourceRect; RECT SourceRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -352,7 +341,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight(IBasicVideo *iface, LONG *p
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG DestinationLeft) static HRESULT WINAPI basic_video_put_DestinationLeft(IBasicVideo *iface, LONG DestinationLeft)
{ {
RECT DestRect; RECT DestRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -372,7 +361,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG
return hr; return hr;
} }
HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft(IBasicVideo *iface, LONG *pDestinationLeft) static HRESULT WINAPI basic_video_get_DestinationLeft(IBasicVideo *iface, LONG *pDestinationLeft)
{ {
RECT DestRect; RECT DestRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -386,7 +375,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft(IBasicVideo *iface, LONG
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth(IBasicVideo *iface, LONG DestinationWidth) static HRESULT WINAPI basic_video_put_DestinationWidth(IBasicVideo *iface, LONG DestinationWidth)
{ {
RECT DestRect; RECT DestRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -405,7 +394,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth(IBasicVideo *iface, LON
return hr; return hr;
} }
HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth(IBasicVideo *iface, LONG *pDestinationWidth) static HRESULT WINAPI basic_video_get_DestinationWidth(IBasicVideo *iface, LONG *pDestinationWidth)
{ {
RECT DestRect; RECT DestRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -419,7 +408,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth(IBasicVideo *iface, LON
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG DestinationTop) static HRESULT WINAPI basic_video_put_DestinationTop(IBasicVideo *iface, LONG DestinationTop)
{ {
RECT DestRect; RECT DestRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -439,7 +428,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG
return hr; return hr;
} }
HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop(IBasicVideo *iface, LONG *pDestinationTop) static HRESULT WINAPI basic_video_get_DestinationTop(IBasicVideo *iface, LONG *pDestinationTop)
{ {
RECT DestRect; RECT DestRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -453,7 +442,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop(IBasicVideo *iface, LONG
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight(IBasicVideo *iface, LONG DestinationHeight) static HRESULT WINAPI basic_video_put_DestinationHeight(IBasicVideo *iface, LONG DestinationHeight)
{ {
RECT DestRect; RECT DestRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -472,7 +461,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight(IBasicVideo *iface, LO
return hr; return hr;
} }
HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight(IBasicVideo *iface, LONG *pDestinationHeight) static HRESULT WINAPI basic_video_get_DestinationHeight(IBasicVideo *iface, LONG *pDestinationHeight)
{ {
RECT DestRect; RECT DestRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -486,7 +475,7 @@ HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight(IBasicVideo *iface, LO
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height) static HRESULT WINAPI basic_video_SetSourcePosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height)
{ {
RECT SourceRect; RECT SourceRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -499,7 +488,7 @@ HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition(IBasicVideo *iface, LONG L
return This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); return This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
} }
HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight) static HRESULT WINAPI basic_video_GetSourcePosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
{ {
RECT SourceRect; RECT SourceRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -517,7 +506,7 @@ HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition(IBasicVideo *iface, LONG *
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_SetDefaultSourcePosition(IBasicVideo *iface) static HRESULT WINAPI basic_video_SetDefaultSourcePosition(IBasicVideo *iface)
{ {
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -525,7 +514,7 @@ HRESULT WINAPI BaseControlVideoImpl_SetDefaultSourcePosition(IBasicVideo *iface)
return This->pFuncsTable->pfnSetDefaultSourceRect(This); return This->pFuncsTable->pfnSetDefaultSourceRect(This);
} }
HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height) static HRESULT WINAPI basic_video_SetDestinationPosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height)
{ {
RECT DestRect; RECT DestRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -538,7 +527,7 @@ HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition(IBasicVideo *iface, L
return This->pFuncsTable->pfnSetTargetRect(This, &DestRect); return This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
} }
HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight) static HRESULT WINAPI basic_video_GetDestinationPosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
{ {
RECT DestRect; RECT DestRect;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -556,7 +545,7 @@ HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition(IBasicVideo *iface, L
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_SetDefaultDestinationPosition(IBasicVideo *iface) static HRESULT WINAPI basic_video_SetDefaultDestinationPosition(IBasicVideo *iface)
{ {
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -564,7 +553,7 @@ HRESULT WINAPI BaseControlVideoImpl_SetDefaultDestinationPosition(IBasicVideo *i
return This->pFuncsTable->pfnSetDefaultTargetRect(This); return This->pFuncsTable->pfnSetDefaultTargetRect(This);
} }
HRESULT WINAPI BaseControlVideoImpl_GetVideoSize(IBasicVideo *iface, LONG *pWidth, LONG *pHeight) static HRESULT WINAPI basic_video_GetVideoSize(IBasicVideo *iface, LONG *pWidth, LONG *pHeight)
{ {
VIDEOINFOHEADER *vih; VIDEOINFOHEADER *vih;
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -580,7 +569,7 @@ HRESULT WINAPI BaseControlVideoImpl_GetVideoSize(IBasicVideo *iface, LONG *pWidt
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseControlVideoImpl_GetVideoPaletteEntries(IBasicVideo *iface, LONG StartIndex, LONG Entries, LONG *pRetrieved, LONG *pPalette) static HRESULT WINAPI basic_video_GetVideoPaletteEntries(IBasicVideo *iface, LONG StartIndex, LONG Entries, LONG *pRetrieved, LONG *pPalette)
{ {
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
@ -592,7 +581,7 @@ HRESULT WINAPI BaseControlVideoImpl_GetVideoPaletteEntries(IBasicVideo *iface, L
return VFW_E_NO_PALETTE_AVAILABLE; return VFW_E_NO_PALETTE_AVAILABLE;
} }
HRESULT WINAPI BaseControlVideoImpl_GetCurrentImage(IBasicVideo *iface, LONG *pBufferSize, LONG *pDIBImage) static HRESULT WINAPI basic_video_GetCurrentImage(IBasicVideo *iface, LONG *pBufferSize, LONG *pDIBImage)
{ {
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
if (!pBufferSize || !pDIBImage) if (!pBufferSize || !pDIBImage)
@ -601,16 +590,71 @@ HRESULT WINAPI BaseControlVideoImpl_GetCurrentImage(IBasicVideo *iface, LONG *pB
return This->pFuncsTable->pfnGetStaticImage(This, pBufferSize, pDIBImage); return This->pFuncsTable->pfnGetStaticImage(This, pBufferSize, pDIBImage);
} }
HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultSource(IBasicVideo *iface) static HRESULT WINAPI basic_video_IsUsingDefaultSource(IBasicVideo *iface)
{ {
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
return This->pFuncsTable->pfnIsDefaultSourceRect(This); return This->pFuncsTable->pfnIsDefaultSourceRect(This);
} }
HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultDestination(IBasicVideo *iface) static HRESULT WINAPI basic_video_IsUsingDefaultDestination(IBasicVideo *iface)
{ {
BaseControlVideo *This = impl_from_IBasicVideo(iface); BaseControlVideo *This = impl_from_IBasicVideo(iface);
return This->pFuncsTable->pfnIsDefaultTargetRect(This); return This->pFuncsTable->pfnIsDefaultTargetRect(This);
} }
static const IBasicVideoVtbl basic_video_vtbl =
{
basic_video_QueryInterface,
basic_video_AddRef,
basic_video_Release,
basic_video_GetTypeInfoCount,
basic_video_GetTypeInfo,
basic_video_GetIDsOfNames,
basic_video_Invoke,
basic_video_get_AvgTimePerFrame,
basic_video_get_BitRate,
basic_video_get_BitErrorRate,
basic_video_get_VideoWidth,
basic_video_get_VideoHeight,
basic_video_put_SourceLeft,
basic_video_get_SourceLeft,
basic_video_put_SourceWidth,
basic_video_get_SourceWidth,
basic_video_put_SourceTop,
basic_video_get_SourceTop,
basic_video_put_SourceHeight,
basic_video_get_SourceHeight,
basic_video_put_DestinationLeft,
basic_video_get_DestinationLeft,
basic_video_put_DestinationWidth,
basic_video_get_DestinationWidth,
basic_video_put_DestinationTop,
basic_video_get_DestinationTop,
basic_video_put_DestinationHeight,
basic_video_get_DestinationHeight,
basic_video_SetSourcePosition,
basic_video_GetSourcePosition,
basic_video_SetDefaultSourcePosition,
basic_video_SetDestinationPosition,
basic_video_GetDestinationPosition,
basic_video_SetDefaultDestinationPosition,
basic_video_GetVideoSize,
basic_video_GetVideoPaletteEntries,
basic_video_GetCurrentImage,
basic_video_IsUsingDefaultSource,
basic_video_IsUsingDefaultDestination
};
HRESULT WINAPI strmbase_video_init(BaseControlVideo *video, BaseFilter *filter,
CRITICAL_SECTION *cs, BasePin *pin, const BaseControlVideoFuncTable *func_table)
{
video->IBasicVideo_iface.lpVtbl = &basic_video_vtbl;
video->pFilter = filter;
video->pInterfaceLock = cs;
video->pPin = pin;
video->pFuncsTable = func_table;
return S_OK;
}

View File

@ -514,48 +514,9 @@ typedef struct BaseControlVideoFuncTable {
BaseControlVideo_SetTargetRect pfnSetTargetRect; BaseControlVideo_SetTargetRect pfnSetTargetRect;
} BaseControlVideoFuncTable; } BaseControlVideoFuncTable;
HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBasicVideoVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin* pPin, const BaseControlVideoFuncTable* pFuncsTable); HRESULT WINAPI strmbase_video_init(BaseControlVideo *video, BaseFilter *filter,
CRITICAL_SECTION *cs, BasePin *pin, const BaseControlVideoFuncTable *func_table);
HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo); HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo);
HRESULT WINAPI BaseControlVideoImpl_QueryInterface(IBasicVideo *iface, REFIID iid, void **out);
ULONG WINAPI BaseControlVideoImpl_AddRef(IBasicVideo *iface);
ULONG WINAPI BaseControlVideoImpl_Release(IBasicVideo *iface);
HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT*pctinfo);
HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo(IBasicVideo *iface, UINT iTInfo, LCID lcid, ITypeInfo**ppTInfo);
HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID riid, LPOLESTR*rgszNames, UINT cNames, LCID lcid, DISPID*rgDispId);
HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS*pDispParams, VARIANT*pVarResult, EXCEPINFO*pExepInfo, UINT*puArgErr);
HRESULT WINAPI BaseControlVideoImpl_get_AvgTimePerFrame(IBasicVideo *iface, REFTIME *pAvgTimePerFrame);
HRESULT WINAPI BaseControlVideoImpl_get_BitRate(IBasicVideo *iface, LONG *pBitRate);
HRESULT WINAPI BaseControlVideoImpl_get_BitErrorRate(IBasicVideo *iface, LONG *pBitErrorRate);
HRESULT WINAPI BaseControlVideoImpl_get_VideoWidth(IBasicVideo *iface, LONG *pVideoWidth);
HRESULT WINAPI BaseControlVideoImpl_get_VideoHeight(IBasicVideo *iface, LONG *pVideoHeight);
HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG SourceLeft);
HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft(IBasicVideo *iface, LONG *pSourceLeft);
HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth(IBasicVideo *iface, LONG SourceWidth);
HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth(IBasicVideo *iface, LONG *pSourceWidth);
HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG SourceTop);
HRESULT WINAPI BaseControlVideoImpl_get_SourceTop(IBasicVideo *iface, LONG *pSourceTop);
HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight(IBasicVideo *iface, LONG SourceHeight);
HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight(IBasicVideo *iface, LONG *pSourceHeight);
HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG DestinationLeft);
HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft(IBasicVideo *iface, LONG *pDestinationLeft);
HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth(IBasicVideo *iface, LONG DestinationWidth);
HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth(IBasicVideo *iface, LONG *pDestinationWidth);
HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG DestinationTop);
HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop(IBasicVideo *iface, LONG *pDestinationTop);
HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight(IBasicVideo *iface, LONG DestinationHeight);
HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight(IBasicVideo *iface, LONG *pDestinationHeight);
HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height);
HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight);
HRESULT WINAPI BaseControlVideoImpl_SetDefaultSourcePosition(IBasicVideo *iface);
HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height);
HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight);
HRESULT WINAPI BaseControlVideoImpl_SetDefaultDestinationPosition(IBasicVideo *iface);
HRESULT WINAPI BaseControlVideoImpl_GetVideoSize(IBasicVideo *iface, LONG *pWidth, LONG *pHeight);
HRESULT WINAPI BaseControlVideoImpl_GetVideoPaletteEntries(IBasicVideo *iface, LONG StartIndex, LONG Entries, LONG *pRetrieved, LONG *pPalette);
HRESULT WINAPI BaseControlVideoImpl_GetCurrentImage(IBasicVideo *iface, LONG *pBufferSize, LONG *pDIBImage);
HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultSource(IBasicVideo *iface);
HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultDestination(IBasicVideo *iface);
#endif #endif
#endif #endif