Commit 4f16a137 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

strmbase: Correct pin IDs for renderers.

parent 294af5ee
......@@ -182,7 +182,7 @@ static const IBaseFilterVtbl basefilter_vtbl =
BaseRendererImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseRendererImpl_FindPin,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
......
......@@ -617,6 +617,8 @@ static const BaseRendererFuncTable BaseFuncTable = {
HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
{
static const WCHAR sink_name[] = {'A','u','d','i','o',' ','I','n','p','u','t',' ','p','i','n',' ','(','r','e','n','d','e','r','e','d',')',0};
HRESULT hr;
DSoundRenderImpl * pDSoundRender;
......@@ -632,7 +634,10 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
return E_OUTOFMEMORY;
ZeroMemory(pDSoundRender, sizeof(DSoundRenderImpl));
hr = BaseRenderer_Init(&pDSoundRender->renderer, &DSoundRender_Vtbl, (IUnknown*)pDSoundRender, &CLSID_DSoundRender, (DWORD_PTR)(__FILE__ ": DSoundRenderImpl.csFilter"), &BaseFuncTable);
hr = strmbase_renderer_init(&pDSoundRender->renderer, &DSoundRender_Vtbl,
(IUnknown *)&pDSoundRender->renderer. filter.IBaseFilter_iface,
&CLSID_DSoundRender, sink_name,
(DWORD_PTR)(__FILE__ ": DSoundRenderImpl.csFilter"), &BaseFuncTable);
BasicAudio_Init(&pDSoundRender->basicAudio,&IBasicAudio_Vtbl);
pDSoundRender->IReferenceClock_iface.lpVtbl = &IReferenceClock_Vtbl;
......@@ -794,7 +799,7 @@ static const IBaseFilterVtbl DSoundRender_Vtbl =
BaseRendererImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseRendererImpl_FindPin,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
......
......@@ -180,7 +180,7 @@ static const IBaseFilterVtbl NullRenderer_Vtbl =
BaseRendererImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseRendererImpl_FindPin,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
......@@ -224,6 +224,8 @@ static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl = {
HRESULT NullRenderer_create(IUnknown *pUnkOuter, void **ppv)
{
static const WCHAR sink_name[] = {'I','n',0};
HRESULT hr;
NullRendererImpl *pNullRenderer;
......@@ -240,9 +242,9 @@ HRESULT NullRenderer_create(IUnknown *pUnkOuter, void **ppv)
else
pNullRenderer->outer_unk = &pNullRenderer->IUnknown_inner;
hr = BaseRenderer_Init(&pNullRenderer->renderer, &NullRenderer_Vtbl, pUnkOuter,
&CLSID_NullRenderer, (DWORD_PTR)(__FILE__ ": NullRendererImpl.csFilter"),
&RendererFuncTable);
hr = strmbase_renderer_init(&pNullRenderer->renderer, &NullRenderer_Vtbl, pUnkOuter,
&CLSID_NullRenderer, sink_name,
(DWORD_PTR)(__FILE__ ": NullRendererImpl.csFilter"), &RendererFuncTable);
if (FAILED(hr))
{
......
......@@ -780,7 +780,7 @@ static const IBaseFilterVtbl VideoRenderer_Vtbl =
BaseRendererImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseRendererImpl_FindPin,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
......@@ -1017,6 +1017,7 @@ static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl = {
HRESULT VideoRenderer_create(IUnknown *pUnkOuter, void **ppv)
{
static const WCHAR sink_name[] = {'I','n',0};
HRESULT hr;
VideoRendererImpl * pVideoRenderer;
......@@ -1039,9 +1040,9 @@ HRESULT VideoRenderer_create(IUnknown *pUnkOuter, void **ppv)
else
pVideoRenderer->outer_unk = &pVideoRenderer->IUnknown_inner;
hr = BaseRenderer_Init(&pVideoRenderer->renderer, &VideoRenderer_Vtbl, pUnkOuter,
&CLSID_VideoRenderer, (DWORD_PTR)(__FILE__ ": VideoRendererImpl.csFilter"),
&BaseFuncTable);
hr = strmbase_renderer_init(&pVideoRenderer->renderer, &VideoRenderer_Vtbl,
pUnkOuter, &CLSID_VideoRenderer, sink_name,
(DWORD_PTR)(__FILE__ ": VideoRendererImpl.csFilter"), &BaseFuncTable);
if (FAILED(hr))
goto fail;
......
......@@ -935,7 +935,7 @@ static const IBaseFilterVtbl VMR_Vtbl =
BaseRendererImpl_SetSyncSource,
BaseFilterImpl_GetSyncSource,
BaseFilterImpl_EnumPins,
BaseRendererImpl_FindPin,
BaseFilterImpl_FindPin,
BaseFilterImpl_QueryFilterInfo,
BaseFilterImpl_JoinFilterGraph,
BaseFilterImpl_QueryVendorInfo
......@@ -2368,6 +2368,8 @@ static const IVMRSurfaceAllocatorNotify9Vtbl VMR9_SurfaceAllocatorNotify_Vtbl =
static HRESULT vmr_create(IUnknown *outer_unk, LPVOID *ppv, const CLSID *clsid)
{
static const WCHAR sink_name[] = {'V','M','R',' ','I','n','p','u','t','0',0};
HRESULT hr;
struct quartz_vmr* pVMR;
......@@ -2409,11 +2411,13 @@ static HRESULT vmr_create(IUnknown *outer_unk, LPVOID *ppv, const CLSID *clsid)
pVMR->IVMRWindowlessControl9_iface.lpVtbl = &VMR9_WindowlessControl_Vtbl;
if (IsEqualGUID(clsid, &CLSID_VideoMixingRenderer))
hr = BaseRenderer_Init(&pVMR->renderer, &VMR_Vtbl, outer_unk, &CLSID_VideoMixingRenderer,
(DWORD_PTR)(__FILE__ ": VMR7Impl.csFilter"), &BaseFuncTable);
hr = strmbase_renderer_init(&pVMR->renderer, &VMR_Vtbl, outer_unk,
&CLSID_VideoMixingRenderer, sink_name,
(DWORD_PTR)(__FILE__ ": VMR7Impl.csFilter"), &BaseFuncTable);
else
hr = BaseRenderer_Init(&pVMR->renderer, &VMR_Vtbl, outer_unk, &CLSID_VideoMixingRenderer9,
(DWORD_PTR)(__FILE__ ": VMR9Impl.csFilter"), &BaseFuncTable);
hr = strmbase_renderer_init(&pVMR->renderer, &VMR_Vtbl, outer_unk,
&CLSID_VideoMixingRenderer9, sink_name,
(DWORD_PTR)(__FILE__ ": VMR9Impl.csFilter"), &BaseFuncTable);
if (FAILED(hr))
goto fail;
......
......@@ -30,9 +30,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
static const WCHAR wcsAltInputPinName[] = {'I','n',0};
static inline BaseInputPin *impl_BaseInputPin_from_IPin( IPin *iface )
{
return CONTAINING_RECORD(iface, BaseInputPin, pin.IPin_iface);
......@@ -238,8 +235,9 @@ static const BaseInputPinFuncTable input_BaseInputFuncTable = {
};
HRESULT WINAPI BaseRenderer_Init(BaseRenderer * This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid,
DWORD_PTR DebugInfo, const BaseRendererFuncTable* pBaseFuncsTable)
HRESULT WINAPI strmbase_renderer_init(BaseRenderer *This, const IBaseFilterVtbl *Vtbl,
IUnknown *pUnkOuter, const CLSID *pClsid, const WCHAR *sink_name, DWORD_PTR DebugInfo,
const BaseRendererFuncTable *pBaseFuncsTable)
{
PIN_INFO piInput;
HRESULT hr;
......@@ -251,7 +249,7 @@ HRESULT WINAPI BaseRenderer_Init(BaseRenderer * This, const IBaseFilterVtbl *Vtb
/* construct input pin */
piInput.dir = PINDIR_INPUT;
piInput.pFilter = &This->filter.IBaseFilter_iface;
lstrcpynW(piInput.achName, wcsInputPinName, ARRAY_SIZE(piInput.achName));
lstrcpynW(piInput.achName, sink_name, ARRAY_SIZE(piInput.achName));
hr = BaseInputPin_Construct(&BaseRenderer_InputPin_Vtbl, sizeof(BaseInputPin), &piInput,
&input_BaseInputFuncTable, &This->filter.csFilter, NULL, (IPin **)&This->pInputPin);
......@@ -419,25 +417,6 @@ HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSamp
return hr;
}
HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
{
BaseRenderer *This = impl_from_IBaseFilter(iface);
TRACE("(%p)->(%s,%p)\n", This, debugstr_w(Id), ppPin);
if (!Id || !ppPin)
return E_POINTER;
if (!lstrcmpiW(Id,wcsInputPinName) || !lstrcmpiW(Id,wcsAltInputPinName))
{
*ppPin = &This->pInputPin->pin.IPin_iface;
IPin_AddRef(*ppPin);
return S_OK;
}
*ppPin = NULL;
return VFW_E_NOT_FOUND;
}
HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface)
{
BaseRenderer *This = impl_from_IBaseFilter(iface);
......
......@@ -634,7 +634,6 @@ typedef struct BaseRendererFuncTable {
HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
ULONG WINAPI BaseRendererImpl_Release(IBaseFilter * iface);
HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSample);
HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin);
HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface);
HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart);
HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface);
......@@ -645,7 +644,9 @@ HRESULT WINAPI BaseRendererImpl_BeginFlush(BaseRenderer* iface);
HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer* iface);
HRESULT WINAPI BaseRendererImpl_ClearPendingSample(BaseRenderer *iface);
HRESULT WINAPI BaseRenderer_Init(BaseRenderer *This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseRendererFuncTable* pBaseFuncsTable);
HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, const IBaseFilterVtbl *vtbl,
IUnknown *outer, const CLSID *clsid, const WCHAR *sink_name, DWORD_PTR debug_info,
const BaseRendererFuncTable *func_table);
#ifdef __IBasicAudio_FWD_DEFINED__
typedef struct tagBasicAudio
......
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