strmbase: Add support for IQualityControl to transform filter.
This commit is contained in:
parent
b6fd7bc133
commit
5955a349c6
|
@ -44,6 +44,7 @@ static const WCHAR wcsOutputPinName[] = {'o','u','t','p','u','t',' ','p','i','n'
|
|||
static const IBaseFilterVtbl TransformFilter_Vtbl;
|
||||
static const IPinVtbl TransformFilter_InputPin_Vtbl;
|
||||
static const IPinVtbl TransformFilter_OutputPin_Vtbl;
|
||||
static const IQualityControlVtbl TransformFilter_QualityControl_Vtbl;
|
||||
|
||||
static HRESULT WINAPI TransformFilter_Input_CheckMediaType(BasePin *iface, const AM_MEDIA_TYPE * pmt)
|
||||
{
|
||||
|
@ -198,6 +199,10 @@ static HRESULT TransformFilter_Init(const IBaseFilterVtbl *pVtbl, const CLSID* p
|
|||
|
||||
if (FAILED(hr))
|
||||
ERR("Cannot create output pin (%x)\n", hr);
|
||||
else {
|
||||
QualityControlImpl_init(&pTransformFilter->qcimpl, (IPin*)pTransformFilter->ppPins[0], (IBaseFilter*)pTransformFilter);
|
||||
pTransformFilter->qcimpl.lpVtbl = &TransformFilter_QualityControl_Vtbl;
|
||||
}
|
||||
}
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
@ -238,6 +243,11 @@ HRESULT WINAPI TransformFilterImpl_QueryInterface(IBaseFilter * iface, REFIID ri
|
|||
TransformFilter *This = (TransformFilter *)iface;
|
||||
TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv);
|
||||
|
||||
if (IsEqualIID(riid, &IID_IQualityControl)) {
|
||||
*ppv = (IQualityControl*)&This->qcimpl;
|
||||
IUnknown_AddRef((IUnknown*)*ppv);
|
||||
return S_OK;
|
||||
}
|
||||
hr = BaseFilterImpl_QueryInterface(iface, riid, ppv);
|
||||
|
||||
if (FAILED(hr) && (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IVideoWindow)))
|
||||
|
@ -547,3 +557,21 @@ static const IPinVtbl TransformFilter_OutputPin_Vtbl =
|
|||
BaseOutputPinImpl_EndFlush,
|
||||
BasePinImpl_NewSegment
|
||||
};
|
||||
|
||||
HRESULT WINAPI TransformFilter_QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) {
|
||||
QualityControlImpl *qc = (QualityControlImpl*)iface;
|
||||
TransformFilter *This = (TransformFilter *)qc->self;
|
||||
|
||||
if (This->pFuncsTable->pfnNotify)
|
||||
return This->pFuncsTable->pfnNotify(This, sender, qm);
|
||||
else
|
||||
return QualityControlImpl_Notify(iface, sender, qm);
|
||||
}
|
||||
|
||||
static const IQualityControlVtbl TransformFilter_QualityControl_Vtbl = {
|
||||
QualityControlImpl_QueryInterface,
|
||||
QualityControlImpl_AddRef,
|
||||
QualityControlImpl_Release,
|
||||
TransformFilter_QualityControlImpl_Notify,
|
||||
QualityControlImpl_SetSink
|
||||
};
|
||||
|
|
|
@ -219,6 +219,7 @@ typedef struct TransformFilter
|
|||
AM_MEDIA_TYPE pmt;
|
||||
|
||||
const struct TransformFilterFuncTable * pFuncsTable;
|
||||
QualityControlImpl qcimpl;
|
||||
} TransformFilter;
|
||||
|
||||
typedef HRESULT (WINAPI *TransformFilter_DecideBufferSize) (TransformFilter *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest);
|
||||
|
@ -234,6 +235,7 @@ typedef HRESULT (WINAPI *TransformFilter_BeginFlush) (TransformFilter *iface);
|
|||
typedef HRESULT (WINAPI *TransformFilter_EndFlush) (TransformFilter *iface);
|
||||
typedef HRESULT (WINAPI *TransformFilter_NewSegment) (TransformFilter *iface,
|
||||
REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
|
||||
typedef HRESULT (WINAPI *TransformFilter_Notify) (TransformFilter *iface, IBaseFilter *sender, Quality qm);
|
||||
|
||||
typedef struct TransformFilterFuncTable {
|
||||
/* Required */
|
||||
|
@ -250,6 +252,7 @@ typedef struct TransformFilterFuncTable {
|
|||
TransformFilter_BeginFlush pfnBeginFlush;
|
||||
TransformFilter_EndFlush pfnEndFlush;
|
||||
TransformFilter_NewSegment pfnNewSegment;
|
||||
TransformFilter_Notify pfnNotify;
|
||||
} TransformFilterFuncTable;
|
||||
|
||||
HRESULT WINAPI TransformFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
|
||||
|
|
Loading…
Reference in New Issue