Commit 461a928f authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

strmbase: Set the IQualityControl vtbl in QualityControlImpl_Create().

parent a881a730
......@@ -27,20 +27,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(strmbase_qc);
HRESULT QualityControlImpl_Create(struct strmbase_pin *pin, struct strmbase_qc **ppv)
{
struct strmbase_qc *This;
*ppv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(struct strmbase_qc));
if (!*ppv)
return E_OUTOFMEMORY;
This = *ppv;
This->pin = pin;
This->tonotify = NULL;
This->current_rstart = This->current_rstop = -1;
TRACE("-> %p\n", This);
return S_OK;
}
void QualityControlImpl_Destroy(struct strmbase_qc *This)
{
HeapFree(GetProcessHeap(),0,This);
......@@ -51,25 +37,25 @@ static inline struct strmbase_qc *impl_from_IQualityControl(IQualityControl *ifa
return CONTAINING_RECORD(iface, struct strmbase_qc, IQualityControl_iface);
}
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv)
static HRESULT WINAPI quality_control_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv)
{
struct strmbase_qc *This = impl_from_IQualityControl(iface);
return IBaseFilter_QueryInterface(&This->pin->filter->IBaseFilter_iface, riid, ppv);
}
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface)
static ULONG WINAPI quality_control_AddRef(IQualityControl *iface)
{
struct strmbase_qc *This = impl_from_IQualityControl(iface);
return IBaseFilter_AddRef(&This->pin->filter->IBaseFilter_iface);
}
ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface)
static ULONG WINAPI quality_control_Release(IQualityControl *iface)
{
struct strmbase_qc *This = impl_from_IQualityControl(iface);
return IBaseFilter_Release(&This->pin->filter->IBaseFilter_iface);
}
HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
static HRESULT WINAPI quality_control_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
{
struct strmbase_qc *This = impl_from_IQualityControl(iface);
HRESULT hr = S_FALSE;
......@@ -94,7 +80,7 @@ HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *se
return hr;
}
HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify)
static HRESULT WINAPI quality_control_SetSink(IQualityControl *iface, IQualityControl *tonotify)
{
struct strmbase_qc *This = impl_from_IQualityControl(iface);
TRACE("%p %p\n", This, tonotify);
......@@ -102,6 +88,15 @@ HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityContro
return S_OK;
}
static const IQualityControlVtbl quality_control_vtbl =
{
quality_control_QueryInterface,
quality_control_AddRef,
quality_control_Release,
quality_control_Notify,
quality_control_SetSink,
};
/* Macros copied from gstreamer, weighted average between old average and new ones */
#define DO_RUNNING_AVG(avg,val,size) (((val) + ((size)-1) * (avg)) / (size))
......@@ -317,3 +312,18 @@ void QualityControlRender_EndRender(struct strmbase_qc *This)
else
This->avg_render = UPDATE_RUNNING_AVG (This->avg_render, elapsed);
}
HRESULT QualityControlImpl_Create(struct strmbase_pin *pin, struct strmbase_qc **ppv)
{
struct strmbase_qc *This;
*ppv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(struct strmbase_qc));
if (!*ppv)
return E_OUTOFMEMORY;
This = *ppv;
This->pin = pin;
This->tonotify = NULL;
This->current_rstart = This->current_rstop = -1;
This->IQualityControl_iface.lpVtbl = &quality_control_vtbl;
TRACE("-> %p\n", This);
return S_OK;
}
......@@ -27,14 +27,6 @@ static inline struct strmbase_renderer *impl_from_strmbase_filter(struct strmbas
return CONTAINING_RECORD(iface, struct strmbase_renderer, filter);
}
static const IQualityControlVtbl Renderer_QualityControl_Vtbl = {
QualityControlImpl_QueryInterface,
QualityControlImpl_AddRef,
QualityControlImpl_Release,
QualityControlImpl_Notify,
QualityControlImpl_SetSink
};
static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
{
return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface);
......@@ -406,5 +398,4 @@ void strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer,
filter->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL);
QualityControlImpl_Create(&filter->sink.pin, &filter->qcimpl);
filter->qcimpl->IQualityControl_iface.lpVtbl = &Renderer_QualityControl_Vtbl;
}
......@@ -70,11 +70,6 @@ struct strmbase_qc
HRESULT QualityControlImpl_Create(struct strmbase_pin *pin, struct strmbase_qc **out);
void QualityControlImpl_Destroy(struct strmbase_qc *qc);
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv);
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface);
ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface);
HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm);
HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify);
void QualityControlRender_Start(struct strmbase_qc *This, REFERENCE_TIME tStart);
void QualityControlRender_DoQOS(struct strmbase_qc *priv);
......
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