Commit 6f7d1065 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

strmbase/renderer: Share pin and filter reference counts.

parent 19470fc8
......@@ -122,9 +122,9 @@ static void test_enum_pins(void)
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pins[0]);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
IPin_Release(pins[0]);
......@@ -226,7 +226,7 @@ static void test_pin_info(void)
hr = IBaseFilter_FindPin(filter, sink_id, &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
......@@ -236,9 +236,9 @@ static void test_pin_info(void)
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
ok(!lstrcmpW(info.achName, sink_id), "Got name %s.\n", wine_dbgstr_w(info.achName));
ref = get_refcount(filter);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
......
......@@ -288,10 +288,8 @@ static void test_enum_pins(void)
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pins[0]);
todo_wine
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
......@@ -399,7 +397,7 @@ static void test_pin_info(void)
hr = IBaseFilter_FindPin(filter, sink_id, &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
......@@ -409,9 +407,9 @@ static void test_pin_info(void)
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
ok(!lstrcmpW(info.achName, sink_id), "Got name %s.\n", wine_dbgstr_w(info.achName));
ref = get_refcount(filter);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
......
......@@ -221,10 +221,8 @@ static void test_enum_pins(void)
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pins[0]);
todo_wine
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
......@@ -329,7 +327,7 @@ static void test_pin_info(void)
hr = IBaseFilter_FindPin(filter, sink_id, &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
......@@ -340,9 +338,9 @@ static void test_pin_info(void)
todo_wine
ok(!lstrcmpW(info.achName, sink_name), "Got name %s.\n", wine_dbgstr_w(info.achName));
ref = get_refcount(filter);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
......
......@@ -427,9 +427,9 @@ static void test_enum_pins(void)
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pins[0]);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
IPin_Release(pins[0]);
......
......@@ -435,9 +435,9 @@ static void test_enum_pins(void)
hr = IEnumPins_Next(enum1, 1, pins, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pins[0]);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
IPin_Release(pins[0]);
......
......@@ -45,6 +45,18 @@ static const IQualityControlVtbl Renderer_QualityControl_Vtbl = {
QualityControlImpl_SetSink
};
static ULONG WINAPI BaseRenderer_InputPin_AddRef(IPin *iface)
{
BaseInputPin *pin = impl_BaseInputPin_from_IPin(iface);
return IBaseFilter_AddRef(pin->pin.pinInfo.pFilter);
}
static ULONG WINAPI BaseRenderer_InputPin_Release(IPin *iface)
{
BaseInputPin *pin = impl_BaseInputPin_from_IPin(iface);
return IBaseFilter_Release(pin->pin.pinInfo.pFilter);
}
static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt)
{
BaseInputPin *This = impl_BaseInputPin_from_IPin(iface);
......@@ -164,8 +176,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface)
static const IPinVtbl BaseRenderer_InputPin_Vtbl =
{
BaseInputPinImpl_QueryInterface,
BasePinImpl_AddRef,
BaseInputPinImpl_Release,
BaseRenderer_InputPin_AddRef,
BaseRenderer_InputPin_Release,
BaseInputPinImpl_Connect,
BaseRenderer_InputPin_ReceiveConnection,
BaseRenderer_InputPin_Disconnect,
......@@ -298,7 +310,7 @@ void strmbase_renderer_cleanup(BaseRenderer *filter)
IPin_Release(peer);
}
IPin_Disconnect(&filter->pInputPin->pin.IPin_iface);
IPin_Release(&filter->pInputPin->pin.IPin_iface);
BaseInputPin_Destroy(filter->pInputPin);
if (filter->pPosition)
IUnknown_Release(filter->pPosition);
......
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