strmbase: Pass a strmbase_pin pointer to QualityControlImpl_Create().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8655691a8a
commit
db7eb33275
|
@ -27,16 +27,14 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(strmbase_qc);
|
WINE_DEFAULT_DEBUG_CHANNEL(strmbase_qc);
|
||||||
|
|
||||||
HRESULT QualityControlImpl_Create(IPin *input, IBaseFilter *self, QualityControlImpl **ppv)
|
HRESULT QualityControlImpl_Create(struct strmbase_pin *pin, QualityControlImpl **ppv)
|
||||||
{
|
{
|
||||||
QualityControlImpl *This;
|
QualityControlImpl *This;
|
||||||
TRACE("%p, %p, %p\n", input, self, ppv);
|
|
||||||
*ppv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(QualityControlImpl));
|
*ppv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(QualityControlImpl));
|
||||||
if (!*ppv)
|
if (!*ppv)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
This = *ppv;
|
This = *ppv;
|
||||||
This->input = input;
|
This->pin = pin;
|
||||||
This->self = self;
|
|
||||||
This->tonotify = NULL;
|
This->tonotify = NULL;
|
||||||
This->clock = NULL;
|
This->clock = NULL;
|
||||||
This->current_rstart = This->current_rstop = -1;
|
This->current_rstart = This->current_rstop = -1;
|
||||||
|
@ -57,19 +55,19 @@ static inline QualityControlImpl *impl_from_IQualityControl(IQualityControl *ifa
|
||||||
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv)
|
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv)
|
||||||
{
|
{
|
||||||
QualityControlImpl *This = impl_from_IQualityControl(iface);
|
QualityControlImpl *This = impl_from_IQualityControl(iface);
|
||||||
return IBaseFilter_QueryInterface(This->self, riid, ppv);
|
return IBaseFilter_QueryInterface(&This->pin->filter->IBaseFilter_iface, riid, ppv);
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface)
|
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface)
|
||||||
{
|
{
|
||||||
QualityControlImpl *This = impl_from_IQualityControl(iface);
|
QualityControlImpl *This = impl_from_IQualityControl(iface);
|
||||||
return IBaseFilter_AddRef(This->self);
|
return IBaseFilter_AddRef(&This->pin->filter->IBaseFilter_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface)
|
ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface)
|
||||||
{
|
{
|
||||||
QualityControlImpl *This = impl_from_IQualityControl(iface);
|
QualityControlImpl *This = impl_from_IQualityControl(iface);
|
||||||
return IBaseFilter_Release(This->self);
|
return IBaseFilter_Release(&This->pin->filter->IBaseFilter_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
|
HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
|
||||||
|
@ -81,19 +79,16 @@ HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *se
|
||||||
iface, sender, qm.Type, qm.Proportion, debugstr_time(qm.Late), debugstr_time(qm.TimeStamp));
|
iface, sender, qm.Type, qm.Proportion, debugstr_time(qm.Late), debugstr_time(qm.TimeStamp));
|
||||||
|
|
||||||
if (This->tonotify)
|
if (This->tonotify)
|
||||||
return IQualityControl_Notify(This->tonotify, This->self, qm);
|
return IQualityControl_Notify(This->tonotify, &This->pin->filter->IBaseFilter_iface, qm);
|
||||||
|
|
||||||
if (This->input) {
|
if (This->pin->peer)
|
||||||
IPin *to = NULL;
|
{
|
||||||
IPin_ConnectedTo(This->input, &to);
|
IQualityControl *qc = NULL;
|
||||||
if (to) {
|
IPin_QueryInterface(This->pin->peer, &IID_IQualityControl, (void **)&qc);
|
||||||
IQualityControl *qc = NULL;
|
if (qc)
|
||||||
IPin_QueryInterface(to, &IID_IQualityControl, (void**)&qc);
|
{
|
||||||
if (qc) {
|
hr = IQualityControl_Notify(qc, &This->pin->filter->IBaseFilter_iface, qm);
|
||||||
hr = IQualityControl_Notify(qc, This->self, qm);
|
IQualityControl_Release(qc);
|
||||||
IQualityControl_Release(qc);
|
|
||||||
}
|
|
||||||
IPin_Release(to);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +265,7 @@ void QualityControlRender_DoQOS(QualityControlImpl *priv)
|
||||||
q.Late = priv->current_jitter;
|
q.Late = priv->current_jitter;
|
||||||
q.TimeStamp = priv->current_rstart;
|
q.TimeStamp = priv->current_rstart;
|
||||||
TRACE("Late: %s from %s, rate: %g\n", debugstr_time(q.Late), debugstr_time(q.TimeStamp), 1./priv->avg_rate);
|
TRACE("Late: %s from %s, rate: %g\n", debugstr_time(q.Late), debugstr_time(q.TimeStamp), 1./priv->avg_rate);
|
||||||
hr = IQualityControl_Notify(&priv->IQualityControl_iface, priv->self, q);
|
hr = IQualityControl_Notify(&priv->IQualityControl_iface, &priv->pin->filter->IBaseFilter_iface, q);
|
||||||
priv->qos_handled = hr == S_OK;
|
priv->qos_handled = hr == S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -545,7 +545,7 @@ HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown
|
||||||
filter->advise_event = CreateEventW(NULL, FALSE, FALSE, NULL);
|
filter->advise_event = CreateEventW(NULL, FALSE, FALSE, NULL);
|
||||||
filter->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL);
|
filter->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL);
|
||||||
|
|
||||||
QualityControlImpl_Create(&filter->sink.pin.IPin_iface, &filter->filter.IBaseFilter_iface, &filter->qcimpl);
|
QualityControlImpl_Create(&filter->sink.pin, &filter->qcimpl);
|
||||||
filter->qcimpl->IQualityControl_iface.lpVtbl = &Renderer_QualityControl_Vtbl;
|
filter->qcimpl->IQualityControl_iface.lpVtbl = &Renderer_QualityControl_Vtbl;
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
|
@ -53,8 +53,7 @@ static inline const char *debugstr_time(REFERENCE_TIME time)
|
||||||
/* Quality Control */
|
/* Quality Control */
|
||||||
typedef struct QualityControlImpl {
|
typedef struct QualityControlImpl {
|
||||||
IQualityControl IQualityControl_iface;
|
IQualityControl IQualityControl_iface;
|
||||||
IPin *input;
|
struct strmbase_pin *pin;
|
||||||
IBaseFilter *self;
|
|
||||||
IQualityControl *tonotify;
|
IQualityControl *tonotify;
|
||||||
|
|
||||||
/* Render stuff */
|
/* Render stuff */
|
||||||
|
@ -66,7 +65,7 @@ typedef struct QualityControlImpl {
|
||||||
BOOL qos_handled, is_dropped;
|
BOOL qos_handled, is_dropped;
|
||||||
} QualityControlImpl;
|
} QualityControlImpl;
|
||||||
|
|
||||||
HRESULT QualityControlImpl_Create(IPin *input, IBaseFilter *self, QualityControlImpl **ppv);
|
HRESULT QualityControlImpl_Create(struct strmbase_pin *pin, QualityControlImpl **out);
|
||||||
void QualityControlImpl_Destroy(QualityControlImpl *This);
|
void QualityControlImpl_Destroy(QualityControlImpl *This);
|
||||||
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv);
|
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv);
|
||||||
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface);
|
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface);
|
||||||
|
|
|
@ -286,8 +286,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid,
|
||||||
strmbase_source_init(&filter->source, &TransformFilter_OutputPin_Vtbl, &filter->filter,
|
strmbase_source_init(&filter->source, &TransformFilter_OutputPin_Vtbl, &filter->filter,
|
||||||
wcsOutputPinName, &source_ops);
|
wcsOutputPinName, &source_ops);
|
||||||
|
|
||||||
QualityControlImpl_Create(&filter->sink.pin.IPin_iface,
|
QualityControlImpl_Create(&filter->sink.pin, &filter->qcimpl);
|
||||||
&filter->filter.IBaseFilter_iface, &filter->qcimpl);
|
|
||||||
filter->qcimpl->IQualityControl_iface.lpVtbl = &TransformFilter_QualityControl_Vtbl;
|
filter->qcimpl->IQualityControl_iface.lpVtbl = &TransformFilter_QualityControl_Vtbl;
|
||||||
|
|
||||||
filter->seekthru_unk = NULL;
|
filter->seekthru_unk = NULL;
|
||||||
|
@ -483,7 +482,7 @@ static const IPinVtbl TransformFilter_OutputPin_Vtbl =
|
||||||
|
|
||||||
static HRESULT WINAPI TransformFilter_QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) {
|
static HRESULT WINAPI TransformFilter_QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) {
|
||||||
QualityControlImpl *qc = (QualityControlImpl*)iface;
|
QualityControlImpl *qc = (QualityControlImpl*)iface;
|
||||||
TransformFilter *This = impl_from_IBaseFilter(qc->self);
|
TransformFilter *This = impl_from_source_IPin(&qc->pin->IPin_iface);
|
||||||
|
|
||||||
if (This->pFuncsTable->pfnNotify)
|
if (This->pFuncsTable->pfnNotify)
|
||||||
return This->pFuncsTable->pfnNotify(This, sender, qm);
|
return This->pFuncsTable->pfnNotify(This, sender, qm);
|
||||||
|
|
Loading…
Reference in New Issue