Commit 31639627 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/tests: Store a testfilter pointer inside the testpin structure.

parent d19aac6e
......@@ -789,7 +789,7 @@ struct testpin
IPin IPin_iface;
LONG ref;
PIN_DIRECTION dir;
IBaseFilter *filter;
struct testfilter *filter;
IPin *peer;
AM_MEDIA_TYPE *mt;
WCHAR name[10];
......@@ -806,6 +806,40 @@ struct testpin
HRESULT QueryInternalConnections_hr;
};
struct testfilter
{
IBaseFilter IBaseFilter_iface;
LONG ref;
IFilterGraph *graph;
WCHAR *name;
IReferenceClock *clock;
IEnumPins IEnumPins_iface;
struct testpin *pins;
unsigned int pin_count, enum_idx;
FILTER_STATE state;
REFERENCE_TIME start_time;
HRESULT state_hr, GetState_hr, seek_hr;
FILTER_STATE expect_stop_prev, expect_run_prev;
IAMFilterMiscFlags IAMFilterMiscFlags_iface;
ULONG misc_flags;
IMediaSeeking IMediaSeeking_iface;
LONG seeking_ref;
DWORD seek_caps;
BOOL support_testguid, support_media_time;
GUID time_format;
LONGLONG seek_duration, seek_current, seek_stop;
double seek_rate;
IReferenceClock IReferenceClock_iface;
IFileSourceFilter IFileSourceFilter_iface;
WCHAR filename[MAX_PATH];
};
static inline struct testpin *impl_from_IEnumMediaTypes(IEnumMediaTypes *iface)
{
return CONTAINING_RECORD(iface, struct testpin, IEnumMediaTypes_iface);
......@@ -954,8 +988,8 @@ static HRESULT WINAPI testpin_QueryPinInfo(IPin *iface, PIN_INFO *info)
struct testpin *pin = impl_from_IPin(iface);
if (winetest_debug > 1) trace("%p->QueryPinInfo()\n", pin);
info->pFilter = pin->filter;
IBaseFilter_AddRef(pin->filter);
info->pFilter = &pin->filter->IBaseFilter_iface;
IBaseFilter_AddRef(info->pFilter);
info->dir = pin->dir;
wcscpy(info->achName, pin->name);
return S_OK;
......@@ -1158,40 +1192,6 @@ static void testsource_init(struct testpin *pin, const AM_MEDIA_TYPE *types, int
pin->type_count = type_count;
}
struct testfilter
{
IBaseFilter IBaseFilter_iface;
LONG ref;
IFilterGraph *graph;
WCHAR *name;
IReferenceClock *clock;
IEnumPins IEnumPins_iface;
struct testpin *pins;
unsigned int pin_count, enum_idx;
FILTER_STATE state;
REFERENCE_TIME start_time;
HRESULT state_hr, GetState_hr, seek_hr;
FILTER_STATE expect_stop_prev, expect_run_prev;
IAMFilterMiscFlags IAMFilterMiscFlags_iface;
ULONG misc_flags;
IMediaSeeking IMediaSeeking_iface;
LONG seeking_ref;
DWORD seek_caps;
BOOL support_testguid, support_media_time;
GUID time_format;
LONGLONG seek_duration, seek_current, seek_stop;
double seek_rate;
IReferenceClock IReferenceClock_iface;
IFileSourceFilter IFileSourceFilter_iface;
WCHAR filename[MAX_PATH];
};
static inline struct testfilter *impl_from_IEnumPins(IEnumPins *iface)
{
return CONTAINING_RECORD(iface, struct testfilter, IEnumPins_iface);
......@@ -1842,7 +1842,7 @@ static void testfilter_init(struct testfilter *filter, struct testpin *pins, int
filter->pins = pins;
filter->pin_count = pin_count;
for (i = 0; i < pin_count; i++)
pins[i].filter = &filter->IBaseFilter_iface;
pins[i].filter = filter;
filter->state = State_Stopped;
filter->expect_stop_prev = filter->expect_run_prev = State_Paused;
......@@ -3232,9 +3232,6 @@ static void test_filter_state(void)
IFilterGraph2_QueryInterface(graph, &IID_IMediaFilter, (void **)&filter);
IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
source_pin.filter = &source.IBaseFilter_iface;
sink_pin.filter = &sink.IBaseFilter_iface;
IFilterGraph2_AddFilter(graph, &source.IBaseFilter_iface, NULL);
IFilterGraph2_AddFilter(graph, &sink.IBaseFilter_iface, NULL);
IFilterGraph2_AddFilter(graph, &dummy.IBaseFilter_iface, NULL);
......
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