Commit e8705402 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

quartz: Add the ability to force a pin to use a certain renderer.

parent 6546cd5d
...@@ -344,7 +344,7 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv) ...@@ -344,7 +344,7 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
piInput.dir = PINDIR_INPUT; piInput.dir = PINDIR_INPUT;
piInput.pFilter = (IBaseFilter *)pDSoundRender; piInput.pFilter = (IBaseFilter *)pDSoundRender;
lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0])); lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
hr = InputPin_Construct(&DSoundRender_InputPin_Vtbl, &piInput, DSoundRender_Sample, pDSoundRender, DSoundRender_QueryAccept, NULL, &pDSoundRender->csFilter, (IPin **)&pDSoundRender->pInputPin); hr = InputPin_Construct(&DSoundRender_InputPin_Vtbl, &piInput, DSoundRender_Sample, pDSoundRender, DSoundRender_QueryAccept, NULL, &pDSoundRender->csFilter, NULL, (IPin **)&pDSoundRender->pInputPin);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
......
...@@ -198,7 +198,7 @@ HRESULT NullRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv) ...@@ -198,7 +198,7 @@ HRESULT NullRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
piInput.pFilter = (IBaseFilter *)pNullRenderer; piInput.pFilter = (IBaseFilter *)pNullRenderer;
lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0])); lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
hr = InputPin_Construct(&NullRenderer_InputPin_Vtbl, &piInput, NullRenderer_Sample, (LPVOID)pNullRenderer, NullRenderer_QueryAccept, NULL, &pNullRenderer->csFilter, (IPin **)&pNullRenderer->pInputPin); hr = InputPin_Construct(&NullRenderer_InputPin_Vtbl, &piInput, NullRenderer_Sample, (LPVOID)pNullRenderer, NullRenderer_QueryAccept, NULL, &pNullRenderer->csFilter, NULL, (IPin **)&pNullRenderer->pInputPin);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
......
...@@ -236,7 +236,7 @@ static HRESULT OutputPin_ConnectSpecific(IPin * iface, IPin * pReceivePin, const ...@@ -236,7 +236,7 @@ static HRESULT OutputPin_ConnectSpecific(IPin * iface, IPin * pReceivePin, const
} }
static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData, static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData,
QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, LPCRITICAL_SECTION pCritSec, InputPin * pPinImpl) QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, LPCRITICAL_SECTION pCritSec, IMemAllocator *allocator, InputPin * pPinImpl)
{ {
TRACE("\n"); TRACE("\n");
...@@ -252,7 +252,9 @@ static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPi ...@@ -252,7 +252,9 @@ static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPi
/* Input pin attributes */ /* Input pin attributes */
pPinImpl->fnSampleProc = pSampleProc; pPinImpl->fnSampleProc = pSampleProc;
pPinImpl->fnCleanProc = pCleanUp; pPinImpl->fnCleanProc = pCleanUp;
pPinImpl->pAllocator = NULL; pPinImpl->pAllocator = pPinImpl->preferred_allocator = allocator;
if (pPinImpl->preferred_allocator)
IMemAllocator_AddRef(pPinImpl->preferred_allocator);
pPinImpl->tStart = 0; pPinImpl->tStart = 0;
pPinImpl->tStop = 0; pPinImpl->tStop = 0;
pPinImpl->dRate = 1.0; pPinImpl->dRate = 1.0;
...@@ -299,7 +301,7 @@ static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * p ...@@ -299,7 +301,7 @@ static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * p
return S_OK; return S_OK;
} }
HRESULT InputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, LPCRITICAL_SECTION pCritSec, IPin ** ppPin) HRESULT InputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, LPCRITICAL_SECTION pCritSec, IMemAllocator *allocator, IPin ** ppPin)
{ {
InputPin * pPinImpl; InputPin * pPinImpl;
...@@ -316,7 +318,7 @@ HRESULT InputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinI ...@@ -316,7 +318,7 @@ HRESULT InputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinI
if (!pPinImpl) if (!pPinImpl)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if (SUCCEEDED(InputPin_Init(InputPin_Vtbl, pPinInfo, pSampleProc, pUserData, pQueryAccept, pCleanUp, pCritSec, pPinImpl))) if (SUCCEEDED(InputPin_Init(InputPin_Vtbl, pPinInfo, pSampleProc, pUserData, pQueryAccept, pCleanUp, pCritSec, allocator, pPinImpl)))
{ {
*ppPin = (IPin *)pPinImpl; *ppPin = (IPin *)pPinImpl;
return S_OK; return S_OK;
...@@ -552,6 +554,8 @@ ULONG WINAPI InputPin_Release(IPin * iface) ...@@ -552,6 +554,8 @@ ULONG WINAPI InputPin_Release(IPin * iface)
FreeMediaType(&This->pin.mtCurrent); FreeMediaType(&This->pin.mtCurrent);
if (This->pAllocator) if (This->pAllocator)
IMemAllocator_Release(This->pAllocator); IMemAllocator_Release(This->pAllocator);
This->pAllocator = NULL;
This->pin.lpVtbl = NULL;
CoTaskMemFree(This); CoTaskMemFree(This);
return 0; return 0;
} }
...@@ -766,6 +770,9 @@ HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator * ...@@ -766,6 +770,9 @@ HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator *
return E_POINTER; return E_POINTER;
} }
if (This->preferred_allocator && pAllocator != This->preferred_allocator)
return E_FAIL;
if (This->pAllocator) if (This->pAllocator)
IMemAllocator_Release(This->pAllocator); IMemAllocator_Release(This->pAllocator);
This->pAllocator = pAllocator; This->pAllocator = pAllocator;
...@@ -824,9 +831,7 @@ HRESULT WINAPI MemInputPin_ReceiveCanBlock(IMemInputPin * iface) ...@@ -824,9 +831,7 @@ HRESULT WINAPI MemInputPin_ReceiveCanBlock(IMemInputPin * iface)
{ {
InputPin *This = impl_from_IMemInputPin(iface); InputPin *This = impl_from_IMemInputPin(iface);
FIXME("(%p/%p)->()\n", This, iface); TRACE("(%p/%p)->()\n", This, iface);
/* FIXME: we should check whether any output pins will block */
return S_OK; return S_OK;
} }
......
...@@ -93,6 +93,7 @@ typedef struct InputPin ...@@ -93,6 +93,7 @@ typedef struct InputPin
REFERENCE_TIME tStop; REFERENCE_TIME tStop;
double dRate; double dRate;
BOOL flushing, end_of_stream; BOOL flushing, end_of_stream;
IMemAllocator *preferred_allocator;
} InputPin; } InputPin;
typedef struct OutputPin typedef struct OutputPin
...@@ -142,7 +143,7 @@ typedef struct PullPin ...@@ -142,7 +143,7 @@ typedef struct PullPin
#define Req_Pause 3 #define Req_Pause 3
/*** Constructors ***/ /*** Constructors ***/
HRESULT InputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, LPCRITICAL_SECTION pCritSec, IPin ** ppPin); HRESULT InputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin ** ppPin);
HRESULT OutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, long outputpin_size, const PIN_INFO * pPinInfo, ALLOCATOR_PROPERTIES *props, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin); HRESULT OutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, long outputpin_size, const PIN_INFO * pPinInfo, ALLOCATOR_PROPERTIES *props, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin);
HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PULL pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, STOPPROCESSPROC, REQUESTPROC pCustomRequest, LPCRITICAL_SECTION pCritSec, IPin ** ppPin); HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PULL pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, STOPPROCESSPROC, REQUESTPROC pCustomRequest, LPCRITICAL_SECTION pCritSec, IPin ** ppPin);
......
...@@ -187,7 +187,7 @@ HRESULT TransformFilter_Create(TransformFilterImpl* pTransformFilter, const CLSI ...@@ -187,7 +187,7 @@ HRESULT TransformFilter_Create(TransformFilterImpl* pTransformFilter, const CLSI
piOutput.pFilter = (IBaseFilter *)pTransformFilter; piOutput.pFilter = (IBaseFilter *)pTransformFilter;
lstrcpynW(piOutput.achName, wcsOutputPinName, sizeof(piOutput.achName) / sizeof(piOutput.achName[0])); lstrcpynW(piOutput.achName, wcsOutputPinName, sizeof(piOutput.achName) / sizeof(piOutput.achName[0]));
hr = InputPin_Construct(&TransformFilter_InputPin_Vtbl, &piInput, TransformFilter_Sample, pTransformFilter, TransformFilter_Input_QueryAccept, NULL, &pTransformFilter->csFilter, &pTransformFilter->ppPins[0]); hr = InputPin_Construct(&TransformFilter_InputPin_Vtbl, &piInput, TransformFilter_Sample, pTransformFilter, TransformFilter_Input_QueryAccept, NULL, &pTransformFilter->csFilter, NULL, &pTransformFilter->ppPins[0]);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
......
...@@ -521,7 +521,7 @@ HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv) ...@@ -521,7 +521,7 @@ HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
piInput.pFilter = (IBaseFilter *)pVideoRenderer; piInput.pFilter = (IBaseFilter *)pVideoRenderer;
lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0])); lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
hr = InputPin_Construct(&VideoRenderer_InputPin_Vtbl, &piInput, VideoRenderer_Sample, (LPVOID)pVideoRenderer, VideoRenderer_QueryAccept, NULL, &pVideoRenderer->csFilter, (IPin **)&pVideoRenderer->pInputPin); hr = InputPin_Construct(&VideoRenderer_InputPin_Vtbl, &piInput, VideoRenderer_Sample, (LPVOID)pVideoRenderer, VideoRenderer_QueryAccept, NULL, &pVideoRenderer->csFilter, NULL, (IPin **)&pVideoRenderer->pInputPin);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
......
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