Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/filtergraph.c | 92 +++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 36 deletions(-)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 8e9d17e..44f306e 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -346,6 +346,58 @@ static void test_mediacontrol(IFilterGraph2 *graph) IMediaFilter_Release(filter); }
+static void test_state_change(IFilterGraph2 *graph) +{ + IMediaControl *control; + OAFilterState state; + HRESULT hr; + + hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + ok(hr == S_OK, "QueryInterface(IMediaControl) failed: %x\n", hr); + + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "GetState() failed: %x\n", hr); + ok(state == State_Stopped, "wrong state %d\n", state); + + hr = IMediaControl_Run(control); + ok(SUCCEEDED(hr), "Run() failed: %x\n", hr); + hr = IMediaControl_GetState(control, INFINITE, &state); + ok(SUCCEEDED(hr), "GetState() failed: %x\n", hr); + ok(state == State_Running, "wrong state %d\n", state); + + hr = IMediaControl_Stop(control); + ok(SUCCEEDED(hr), "Stop() failed: %x\n", hr); + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "GetState() failed: %x\n", hr); + ok(state == State_Stopped, "wrong state %d\n", state); + + hr = IMediaControl_Pause(control); + ok(SUCCEEDED(hr), "Pause() failed: %x\n", hr); + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "GetState() failed: %x\n", hr); + ok(state == State_Paused, "wrong state %d\n", state); + + hr = IMediaControl_Run(control); + ok(SUCCEEDED(hr), "Run() failed: %x\n", hr); + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "GetState() failed: %x\n", hr); + ok(state == State_Running, "wrong state %d\n", state); + + hr = IMediaControl_Pause(control); + ok(SUCCEEDED(hr), "Pause() failed: %x\n", hr); + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "GetState() failed: %x\n", hr); + ok(state == State_Paused, "wrong state %d\n", state); + + hr = IMediaControl_Stop(control); + ok(SUCCEEDED(hr), "Stop() failed: %x\n", hr); + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "GetState() failed: %x\n", hr); + ok(state == State_Stopped, "wrong state %d\n", state); + + IMediaControl_Release(control); +} + static void rungraph(IFilterGraph2 *graph) { HRESULT hr; @@ -354,6 +406,10 @@ static void rungraph(IFilterGraph2 *graph) IMediaFilter* pmf; HANDLE hEvent;
+ test_basic_video(graph); + test_mediacontrol(graph); + test_state_change(graph); + hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&pmc); ok(hr==S_OK, "Cannot get IMediaControl interface returned: %x\n", hr);
@@ -366,9 +422,6 @@ static void rungraph(IFilterGraph2 *graph)
IMediaFilter_Release(pmf);
- test_basic_video(graph); - test_mediacontrol(graph); - hr = IMediaControl_Run(pmc); ok(hr==S_FALSE, "Cannot run the graph returned: %x\n", hr);
@@ -380,39 +433,6 @@ static void rungraph(IFilterGraph2 *graph)
IFilterGraph2_SetDefaultSyncSource(graph);
- Sleep(10); - trace("stop -> pause\n"); - hr = IMediaControl_Pause(pmc); - ok(hr==S_OK || hr == S_FALSE, "Cannot pause the graph returned: %x\n", hr); - - Sleep(10); - trace("pause -> run\n"); - hr = IMediaControl_Run(pmc); - ok(hr==S_OK || hr == S_FALSE, "Cannot start the graph returned: %x\n", hr); - - Sleep(10); - trace("run -> pause\n"); - hr = IMediaControl_Pause(pmc); - ok(hr==S_OK || hr == S_FALSE, "Cannot pause the graph returned: %x\n", hr); - - Sleep(10); - trace("pause -> stop\n"); - hr = IMediaControl_Stop(pmc); - ok(hr==S_OK || hr == S_FALSE, "Cannot stop the graph returned: %x\n", hr); - - Sleep(10); - trace("pause -> run\n"); - hr = IMediaControl_Run(pmc); - ok(hr==S_OK || hr == S_FALSE, "Cannot start the graph returned: %x\n", hr); - - trace("run -> stop\n"); - hr = IMediaControl_Stop(pmc); - ok(hr==S_OK || hr == S_FALSE, "Cannot stop the graph returned: %x\n", hr); - - trace("stop -> run\n"); - hr = IMediaControl_Run(pmc); - ok(hr==S_OK || hr == S_FALSE, "Cannot start the graph returned: %x\n", hr); - hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaEvent, (LPVOID*)&pme); ok(hr==S_OK, "Cannot get IMediaEvent interface returned: %x\n", hr);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/filtergraph.c | 133 ++++++++++++++++++++++++++-------------- 1 file changed, 87 insertions(+), 46 deletions(-)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 44f306e..704ef75 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -398,57 +398,98 @@ static void test_state_change(IFilterGraph2 *graph) IMediaControl_Release(control); }
+static void test_media_event(IFilterGraph2 *graph) +{ + IMediaEvent *media_event; + IMediaSeeking *seeking; + IMediaControl *control; + IMediaFilter *filter; + LONG_PTR lparam1, lparam2; + LONGLONG current, stop; + OAFilterState state; + int got_eos = 0; + HANDLE event; + HRESULT hr; + LONG code; + + hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaFilter, (void **)&filter); + ok(hr == S_OK, "QueryInterface(IMediaFilter) failed: %#x\n", hr); + + hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + ok(hr == S_OK, "QueryInterface(IMediaControl) failed: %#x\n", hr); + + hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaEvent, (void **)&media_event); + ok(hr == S_OK, "QueryInterface(IMediaEvent) failed: %#x\n", hr); + + hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaSeeking, (void **)&seeking); + ok(hr == S_OK, "QueryInterface(IMediaEvent) failed: %#x\n", hr); + + hr = IMediaControl_Stop(control); + ok(SUCCEEDED(hr), "Stop() failed: %#x\n", hr); + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "GetState() timed out\n"); + + hr = IMediaSeeking_GetDuration(seeking, &stop); + ok(hr == S_OK, "GetDuration() failed: %#x\n", hr); + current = 0; + hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning, &stop, AM_SEEKING_AbsolutePositioning); + ok(hr == S_OK, "SetPositions() failed: %#x\n", hr); + + hr = IMediaFilter_SetSyncSource(filter, NULL); + ok(hr == S_OK, "SetSyncSource() failed: %#x\n", hr); + + hr = IMediaEvent_GetEventHandle(media_event, (OAEVENT *)&event); + ok(hr == S_OK, "GetEventHandle() failed: %#x\n", hr); + + /* flush existing events */ + while ((hr = IMediaEvent_GetEvent(media_event, &code, &lparam1, &lparam2, 0)) == S_OK); + + ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "event should not be signaled\n"); + + hr = IMediaControl_Run(control); + ok(SUCCEEDED(hr), "Run() failed: %#x\n", hr); + + while (!got_eos) + { + if (WaitForSingleObject(event, 1000) == WAIT_TIMEOUT) + break; + + while ((hr = IMediaEvent_GetEvent(media_event, &code, &lparam1, &lparam2, 0)) == S_OK) + { + if (code == EC_COMPLETE) + { + got_eos = 1; + break; + } + } + } + ok(got_eos, "didn't get EOS\n"); + + hr = IMediaSeeking_GetCurrentPosition(seeking, ¤t); + ok(hr == S_OK, "GetCurrentPosition() failed: %#x\n", hr); +todo_wine + ok(current == stop, "expected %s, got %s\n", wine_dbgstr_longlong(stop), wine_dbgstr_longlong(current)); + + hr = IMediaControl_Stop(control); + ok(SUCCEEDED(hr), "Run() failed: %#x\n", hr); + hr = IMediaControl_GetState(control, 1000, &state); + ok(hr == S_OK, "GetState() timed out\n"); + + hr = IFilterGraph2_SetDefaultSyncSource(graph); + ok(hr == S_OK, "SetDefaultSinkSource() failed: %#x\n", hr); + + IMediaSeeking_Release(seeking); + IMediaEvent_Release(media_event); + IMediaControl_Release(control); + IMediaFilter_Release(filter); +} + static void rungraph(IFilterGraph2 *graph) { - HRESULT hr; - IMediaControl* pmc; - IMediaEvent* pme; - IMediaFilter* pmf; - HANDLE hEvent; - test_basic_video(graph); test_mediacontrol(graph); test_state_change(graph); - - hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&pmc); - ok(hr==S_OK, "Cannot get IMediaControl interface returned: %x\n", hr); - - hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaFilter, (void **)&pmf); - ok(hr==S_OK, "Cannot get IMediaFilter interface returned: %x\n", hr); - - IMediaControl_Stop(pmc); - - IMediaFilter_SetSyncSource(pmf, NULL); - - IMediaFilter_Release(pmf); - - hr = IMediaControl_Run(pmc); - ok(hr==S_FALSE, "Cannot run the graph returned: %x\n", hr); - - Sleep(10); - /* Crash fun */ - trace("run -> stop\n"); - hr = IMediaControl_Stop(pmc); - ok(hr==S_OK || hr == S_FALSE, "Cannot stop the graph returned: %x\n", hr); - - IFilterGraph2_SetDefaultSyncSource(graph); - - hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaEvent, (LPVOID*)&pme); - ok(hr==S_OK, "Cannot get IMediaEvent interface returned: %x\n", hr); - - hr = IMediaEvent_GetEventHandle(pme, (OAEVENT*)&hEvent); - ok(hr==S_OK, "Cannot get event handle returned: %x\n", hr); - - ok(WaitForSingleObject(hEvent, 2000) == WAIT_OBJECT_0, "Wait failed\n"); - - hr = IMediaEvent_Release(pme); - ok(hr==2, "Releasing mediaevent returned: %x\n", hr); - - hr = IMediaControl_Stop(pmc); - ok(hr==S_OK, "Cannot stop the graph returned: %x\n", hr); - - hr = IMediaControl_Release(pmc); - ok(hr==1, "Releasing mediacontrol returned: %x\n", hr); + test_media_event(graph); }
static void test_graph_builder_connect(WCHAR *filename)
Use CoCreateInstance directly, and try to run the graph on a real file.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/filtergraph.c | 67 ++++++++--------------------------------- 1 file changed, 12 insertions(+), 55 deletions(-)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 704ef75..ce319cf 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -579,78 +579,35 @@ static void test_render_run(const WCHAR *file)
static DWORD WINAPI call_RenderFile_multithread(LPVOID lParam) { - IFilterGraph2 *filter_graph = lParam; + WCHAR *filename = load_resource(avifile); + IFilterGraph2 *graph = lParam; HRESULT hr; - WCHAR mp3file[] = {'t','e','s','t','.','m','p','3',0}; - HANDLE handle;
- handle = CreateFileW(mp3file, 0, 0, NULL, CREATE_ALWAYS, 0, NULL); - if (handle == INVALID_HANDLE_VALUE) - { - skip("Could not read test file %s, skipping test\n", wine_dbgstr_w(mp3file)); - return 1; - } - CloseHandle(handle); + hr = IFilterGraph2_RenderFile(graph, filename, NULL); +todo_wine + ok(SUCCEEDED(hr), "RenderFile failed: %x\n", hr);
- hr = IFilterGraph2_RenderFile(filter_graph, mp3file, NULL); - todo_wine ok(hr == VFW_E_CANNOT_RENDER || /* xp or older + DirectX 9 */ - hr == VFW_E_NO_TRANSPORT || /* win7 or newer */ - broken(hr == CLASS_E_CLASSNOTAVAILABLE), /* xp or older + DirectX 8 or older */ - "Expected 0x%08x or 0x%08x, returned 0x%08x\n", VFW_E_CANNOT_RENDER, VFW_E_NO_TRANSPORT, hr); + if (SUCCEEDED(hr)) + rungraph(graph);
- DeleteFileW(mp3file); return 0; }
static void test_render_with_multithread(void) { - HRESULT hr; - HMODULE hmod; - static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID rclsid, REFIID riid, void **out); - IClassFactory *classfactory = NULL; - static IGraphBuilder *graph_builder; - static IFilterGraph2 *filter_graph; + IFilterGraph2 *graph; HANDLE thread;
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
- hmod = LoadLibraryA("quartz.dll"); - if (!hmod) - { - skip("Fail to load quartz.dll.\n"); - return; - } + graph = create_graph();
- pDllGetClassObject = (void*)GetProcAddress(hmod, "DllGetClassObject"); - if (!pDllGetClassObject) - { - skip("Fail to get DllGetClassObject.\n"); - return; - } + thread = CreateThread(NULL, 0, call_RenderFile_multithread, graph, 0, NULL);
- hr = pDllGetClassObject(&CLSID_FilterGraph, &IID_IClassFactory, (void **)&classfactory); - ok(hr == S_OK, "DllGetClassObject failed 0x%08x\n", hr); - if (FAILED(hr)) - { - skip("Can't create IClassFactory 0x%08x.\n", hr); - return; - } - - hr = IClassFactory_CreateInstance(classfactory, NULL, &IID_IUnknown, (LPVOID*)&graph_builder); - ok(hr == S_OK, "IClassFactory_CreateInstance failed 0x%08x\n", hr); - - hr = IGraphBuilder_QueryInterface(graph_builder, &IID_IFilterGraph2, (void**)&filter_graph); - ok(hr == S_OK, "IGraphBuilder_QueryInterface failed 0x%08x\n", hr); - - thread = CreateThread(NULL, 0, call_RenderFile_multithread, filter_graph, 0, NULL); - - WaitForSingleObject(thread, 1000); - IFilterGraph2_Release(filter_graph); - IGraphBuilder_Release(graph_builder); - IClassFactory_Release(classfactory); + ok(WaitForSingleObject(thread, 1000) == WAIT_OBJECT_0, "wait failed\n"); + IFilterGraph2_Release(graph); CloseHandle(thread); CoUninitialize(); - return; }
static void test_graph_builder(void)
Also remove uninteresting IMediaControl test.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/filtergraph.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index ce319cf..8f510da 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -284,12 +284,11 @@ static void test_basic_video(IFilterGraph2 *graph) IBasicVideo_Release(pbv); }
-static void test_mediacontrol(IFilterGraph2 *graph) +static void test_media_seeking(IFilterGraph2 *graph) { IMediaSeeking *seeking; IMediaFilter *filter; - IMediaControl *control; - LONGLONG pos; + LONGLONG pos, stop, duration; GUID format; HRESULT hr;
@@ -300,9 +299,6 @@ static void test_mediacontrol(IFilterGraph2 *graph) hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaFilter, (void **)&filter); ok(hr == S_OK, "QueryInterface(IMediaFilter) failed: %08x\n", hr);
- hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); - ok(hr == S_OK, "QueryInterface(IMediaControl) failed: %08x\n", hr); - format = GUID_NULL; hr = IMediaSeeking_GetTimeFormat(seeking, &format); ok(hr == S_OK, "GetTimeFormat failed: %#x\n", hr); @@ -327,21 +323,31 @@ static void test_mediacontrol(IFilterGraph2 *graph) ok(hr == S_OK, "GetCurrentPosition failed: %#x\n", hr); ok(pos == 0, "got %s\n", wine_dbgstr_longlong(pos));
+ hr = IMediaSeeking_GetDuration(seeking, &duration); + ok(hr == S_OK, "GetDuration failed: %#x\n", hr); + ok(duration > 0, "got %s\n", wine_dbgstr_longlong(duration)); + + hr = IMediaSeeking_GetStopPosition(seeking, &stop); + ok(hr == S_OK, "GetCurrentPosition failed: %08x\n", hr); + ok(stop == duration || stop == duration + 1, "expected %s, got %s\n", + wine_dbgstr_longlong(duration), wine_dbgstr_longlong(stop)); + hr = IMediaSeeking_SetPositions(seeking, NULL, AM_SEEKING_ReturnTime, NULL, AM_SEEKING_NoPositioning); ok(hr == S_OK, "SetPositions failed: %#x\n", hr); hr = IMediaSeeking_SetPositions(seeking, NULL, AM_SEEKING_NoPositioning, NULL, AM_SEEKING_ReturnTime); ok(hr == S_OK, "SetPositions failed: %#x\n", hr);
+ pos = 0; + hr = IMediaSeeking_SetPositions(seeking, &pos, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); + ok(hr == S_OK, "SetPositions failed: %08x\n", hr); + IMediaFilter_SetSyncSource(filter, NULL); pos = 0xdeadbeef; hr = IMediaSeeking_GetCurrentPosition(seeking, &pos); - ok(hr == S_OK, "GetCurrentPosition failed: %#x\n", hr); - ok(pos == 0, "got %s\n", wine_dbgstr_longlong(pos)); + ok(hr == S_OK, "GetCurrentPosition failed: %08x\n", hr); + ok(pos == 0, "Position != 0 (%s)\n", wine_dbgstr_longlong(pos)); + IFilterGraph2_SetDefaultSyncSource(graph);
- hr = IMediaControl_GetState(control, 1000, NULL); - ok(hr == E_POINTER, "expected E_POINTER, got %#x\n", hr); - - IMediaControl_Release(control); IMediaSeeking_Release(seeking); IMediaFilter_Release(filter); } @@ -487,7 +493,7 @@ todo_wine static void rungraph(IFilterGraph2 *graph) { test_basic_video(graph); - test_mediacontrol(graph); + test_media_seeking(graph); test_state_change(graph); test_media_event(graph); }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/filtergraph.c | 60 +++-------------------------------------- 1 file changed, 3 insertions(+), 57 deletions(-)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 8f510da..a2856e6 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -1816,12 +1816,10 @@ static HRESULT get_connected_filter_name(TestFilterImpl *pFilter, char *FilterNa
hr = IPin_ConnectedTo(pFilter->ppPins[0], &pin); ok(hr == S_OK, "IPin_ConnectedTo failed with %x\n", hr); - if (FAILED(hr)) return hr;
hr = IPin_QueryPinInfo(pin, &pinInfo); ok(hr == S_OK, "IPin_QueryPinInfo failed with %x\n", hr); IPin_Release(pin); - if (FAILED(hr)) return hr;
SetLastError(0xdeadbeef); hr = IBaseFilter_QueryFilterInfo(pinInfo.pFilter, &filterInfo); @@ -1832,7 +1830,6 @@ static HRESULT get_connected_filter_name(TestFilterImpl *pFilter, char *FilterNa } ok(hr == S_OK, "IBaseFilter_QueryFilterInfo failed with %x\n", hr); IBaseFilter_Release(pinInfo.pFilter); - if (FAILED(hr)) return hr;
IFilterGraph_Release(filterInfo.pGraph);
@@ -1932,28 +1929,23 @@ static void test_render_filter_priority(void) * on the order in which filters are added to the graph, thus indicating * no preference given to exact match. */ pgraph2 = create_graph(); - if (!pgraph2) return;
hr = createtestfilter(&GUID_NULL, PinData1, &ptestfilter); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter->IBaseFilter_iface, wszFilterInstanceName1); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr);
hr = createtestfilter(&GUID_NULL, PinData2, &ptestfilter2); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter2->IBaseFilter_iface, wszFilterInstanceName2); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr);
IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - ptestfilter2 = NULL;
hr = createtestfilter(&GUID_NULL, PinData3, &ptestfilter2); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter2->IBaseFilter_iface, wszFilterInstanceName3); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr); @@ -1964,41 +1956,27 @@ static void test_render_filter_priority(void) hr = get_connected_filter_name(ptestfilter, ConnectedFilterName1);
IFilterGraph2_Release(pgraph2); - pgraph2 = NULL; IBaseFilter_Release(&ptestfilter->IBaseFilter_iface); - ptestfilter = NULL; IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - ptestfilter2 = NULL; - - if (hr == E_NOTIMPL) - { - win_skip("Needed functions are not implemented\n"); - return; - }
pgraph2 = create_graph(); - if (!pgraph2) goto out;
hr = createtestfilter(&GUID_NULL, PinData1, &ptestfilter); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter->IBaseFilter_iface, wszFilterInstanceName1); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr);
hr = createtestfilter(&GUID_NULL, PinData3, &ptestfilter2); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter2->IBaseFilter_iface, wszFilterInstanceName3); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr);
IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - ptestfilter2 = NULL;
hr = createtestfilter(&GUID_NULL, PinData2, &ptestfilter2); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter2->IBaseFilter_iface, wszFilterInstanceName2); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr); @@ -2014,49 +1992,39 @@ static void test_render_filter_priority(void) "expected connected filters to be different but got %s both times\n", ConnectedFilterName1);
IFilterGraph2_Release(pgraph2); - pgraph2 = NULL; IBaseFilter_Release(&ptestfilter->IBaseFilter_iface); - ptestfilter = NULL; IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - ptestfilter2 = NULL;
/* Test if any preference is given to existing renderer which renders the pin directly vs an existing renderer which renders the pin indirectly, through an additional middle filter, again trying different orders of creation. Native appears not to give a preference. */
pgraph2 = create_graph(); - if (!pgraph2) goto out;
hr = createtestfilter(&GUID_NULL, PinData1, &ptestfilter); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter->IBaseFilter_iface, wszFilterInstanceName1); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr);
hr = createtestfilter(&GUID_NULL, PinData2, &ptestfilter2); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter2->IBaseFilter_iface, wszFilterInstanceName2); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr);
IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - ptestfilter2 = NULL;
hr = createtestfilter(&GUID_NULL, PinData4, &ptestfilter2); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter2->IBaseFilter_iface, wszFilterInstanceName3); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr);
IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - ptestfilter2 = NULL;
hr = createtestfilter(&GUID_NULL, PinData5, &ptestfilter2); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter2->IBaseFilter_iface, wszFilterInstanceName4); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr); @@ -2069,45 +2037,35 @@ static void test_render_filter_priority(void) "unexpected connected filter: %s\n", ConnectedFilterName1);
IFilterGraph2_Release(pgraph2); - pgraph2 = NULL; IBaseFilter_Release(&ptestfilter->IBaseFilter_iface); - ptestfilter = NULL; IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - ptestfilter2 = NULL;
pgraph2 = create_graph(); - if (!pgraph2) goto out;
hr = createtestfilter(&GUID_NULL, PinData1, &ptestfilter); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter->IBaseFilter_iface, wszFilterInstanceName1); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr);
hr = createtestfilter(&GUID_NULL, PinData4, &ptestfilter2); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter2->IBaseFilter_iface, wszFilterInstanceName3); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr);
IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - ptestfilter2 = NULL;
hr = createtestfilter(&GUID_NULL, PinData5, &ptestfilter2); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter2->IBaseFilter_iface, wszFilterInstanceName4); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr);
IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - ptestfilter2 = NULL;
hr = createtestfilter(&GUID_NULL, PinData2, &ptestfilter2); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter2->IBaseFilter_iface, wszFilterInstanceName2); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr); @@ -2122,23 +2080,17 @@ static void test_render_filter_priority(void) "expected connected filters to be different but got %s both times\n", ConnectedFilterName1);
IFilterGraph2_Release(pgraph2); - pgraph2 = NULL; IBaseFilter_Release(&ptestfilter->IBaseFilter_iface); - ptestfilter = NULL; IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - ptestfilter2 = NULL;
/* Test if renderers are tried before non-renderers (intermediary filters). */ pgraph2 = create_graph(); - if (!pgraph2) goto out;
hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&pMapper2); ok(hr == S_OK, "CoCreateInstance failed with %08x\n", hr); - if (!pMapper2) goto out;
hr = createtestfilter(&GUID_NULL, PinData1, &ptestfilter); ok(hr == S_OK, "createtestfilter failed with %08x\n", hr); - if (FAILED(hr)) goto out;
hr = IFilterGraph2_AddFilter(pgraph2, &ptestfilter->IBaseFilter_iface, wszFilterInstanceName1); ok(hr == S_OK, "IFilterGraph2_AddFilter failed with %08x\n", hr); @@ -2148,17 +2100,14 @@ static void test_render_filter_priority(void) (IUnknown *)&Filter1ClassFactory.IClassFactory_iface, CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &cookie1); ok(hr == S_OK, "CoRegisterClassObject failed with %08x\n", hr); - if (FAILED(hr)) goto out; hr = CoRegisterClassObject(Filter2ClassFactory.clsid, (IUnknown *)&Filter2ClassFactory.IClassFactory_iface, CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &cookie2); ok(hr == S_OK, "CoRegisterClassObject failed with %08x\n", hr); - if (FAILED(hr)) goto out; hr = CoRegisterClassObject(Filter3ClassFactory.clsid, (IUnknown *)&Filter3ClassFactory.IClassFactory_iface, CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &cookie3); ok(hr == S_OK, "CoRegisterClassObject failed with %08x\n", hr); - if (FAILED(hr)) goto out;
rgf2.dwVersion = 2; rgf2.dwMerit = MERIT_UNLIKELY; @@ -2225,12 +2174,9 @@ static void test_render_filter_priority(void) ok(hr == S_OK, "IFilterMapper2_UnregisterFilter failed with %x\n", hr); }
- out: - - if (ptestfilter) IBaseFilter_Release(&ptestfilter->IBaseFilter_iface); - if (ptestfilter2) IBaseFilter_Release(&ptestfilter2->IBaseFilter_iface); - if (pgraph2) IFilterGraph2_Release(pgraph2); - if (pMapper2) IFilterMapper2_Release(pMapper2); + IBaseFilter_Release(&ptestfilter->IBaseFilter_iface); + IFilterGraph2_Release(pgraph2); + IFilterMapper2_Release(pMapper2);
hr = CoRevokeClassObject(cookie1); ok(hr == S_OK, "CoRevokeClassObject failed with %08x\n", hr);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=36248
Your paranoid android.
=== w2003std (32 bit filtergraph) === filtergraph.c:442: Test failed: Wait failed
=== wvistau64 (32 bit filtergraph) === filtergraph.c:442: Test failed: Wait failed
=== w8 (32 bit filtergraph) === filtergraph.c:442: Test failed: Wait failed
=== w864 (32 bit filtergraph) === filtergraph.c:442: Test failed: Wait failed
=== w1064 (32 bit filtergraph) === filtergraph.c:442: Test failed: Wait failed
=== w1064 (64 bit filtergraph) === filtergraph.c:442: Test failed: Wait failed
Zebediah Figura z.figura12@gmail.com writes:
Signed-off-by: Zebediah Figura z.figura12@gmail.com
dlls/quartz/tests/filtergraph.c | 92 +++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 36 deletions(-)
Hi Zeb,
For the past couple of days I've been getting the following failure in the filtergraph test. It works in a clean prefix, but fails after the filtermapper test has been run once, apparently because of the test filter that filtermapper registers. Could you please have a look?
../../../tools/runtest -q -P wine -T ../../.. -M quartz.dll -p quartz_test.exe.so filtergraph && touch filtergraph.ok filtergraph.c:499: Tests skipped: L"test.avi": codec not supported; skipping test filtergraph.c:465: Test failed: Connect failed: 0x80040154 wine: Unhandled page fault on read access to 0x00000038 at address 0x7e1b7358 (thread 0009), starting debugger... Unhandled exception: page fault on read access to 0x00000038 in 32-bit code (0x7e1b7358). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:7e1b7358 ESP:0032fba4 EBP:0032fbd8 EFLAGS:00010202( R- -- I - - - ) EAX:00000000 EBX:7e202000 ECX:0032fba0 EDX:0032fcbc ESI:00161720 EDI:0032fcb8 Stack dump: 0x0032fba4: 00161720 00000000 00000000 0015abd0 0x0032fbb4: 7e14f7c6 0032fbe0 0032fcbc 00161548 0x0032fbc4: 7e1b7326 0032fbf0 0015ac8c 7e202000 0x0032fbd4: 0032fcbc 0032fc38 7e14cfa5 0015ac8c 0x0032fbe4: 0000000d 7e148b9f 7e14cfa5 00161720 0x0032fbf4: 0032fcb8 0032fcbc 7e14cf8e 00000001 Backtrace: =>0 0x7e1b7358 BaseControlVideoImpl_GetVideoSize+0x48(iface=<couldn't compute location>, pWidth=<couldn't compute location>, pHeight=<couldn't compute location>) [/home/julliard/wine/wine/dlls/strmbase/video.c:558] in quartz (0x0032fbd8) 1 0x7e14cfa5 BasicVideo_GetVideoSize+0x74(iface=<couldn't compute location>, pWidth=<couldn't compute location>, pHeight=<couldn't compute location>) [/home/julliard/wine/wine/dlls/quartz/../../include/control.h:1518] in quartz (0x0032fc38) 2 0x7ecbde1d rungraph+0x1dc(graph=0x15abd4) [/home/julliard/wine/wine/dlls/quartz/tests/../../../include/control.h:1518] in quartz_test (0x0032fcf8) 3 0x7ecc026d test_render_run+0x43c(file=<is not available>) [/home/julliard/wine/wine/dlls/quartz/tests/filtergraph.c:466] in quartz_test (0x0032fd68) 4 0x7ecc3030 func_filtergraph+0x2f() [/home/julliard/wine/wine/dlls/quartz/tests/filtergraph.c:2315] in quartz_test (0x0032fdc8) 5 0x7ecba3d6 main+0x2e5(argc=<is not available>, argv=<is not available>) [/home/julliard/wine/wine/dlls/quartz/tests/../../../include/wine/test.h:603] in quartz_test (0x0032fe78) 6 0x7ecc8b54 __wine_spec_exe_entry+0x63(peb=<couldn't compute location>) [/home/julliard/wine/wine/dlls/winecrt0/exe_entry.c:36] in quartz_test (0x0032feb8) 7 0x7b45fcbc call_process_entry+0xb() in kernel32 (0x0032fed8) 8 0x7b4615d2 start_process+0x1b1(entry=<couldn't compute location>, peb=<couldn't compute location>) [/home/julliard/wine/wine/dlls/kernel32/process.c:1098] in kernel32 (0x0032ffd8) 9 0x7b45fcca start_process_wrapper+0x9() in kernel32 (0x0032ffec) 0x7e1b7358 BaseControlVideoImpl_GetVideoSize+0x48 [/home/julliard/wine/wine/dlls/strmbase/video.c:558] in quartz: movl 0x38(%eax),%ecx 558 *pHeight = vih->bmiHeader.biHeight;
On 28/02/18 12:28, Alexandre Julliard wrote:
Zebediah Figura z.figura12@gmail.com writes:
Signed-off-by: Zebediah Figura z.figura12@gmail.com
dlls/quartz/tests/filtergraph.c | 92 +++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 36 deletions(-)
Hi Zeb,
For the past couple of days I've been getting the following failure in the filtergraph test. It works in a clean prefix, but fails after the filtermapper test has been run once, apparently because of the test filter that filtermapper registers. Could you please have a look?
../../../tools/runtest -q -P wine -T ../../.. -M quartz.dll -p quartz_test.exe.so filtergraph && touch filtergraph.ok filtergraph.c:499: Tests skipped: L"test.avi": codec not supported; skipping test filtergraph.c:465: Test failed: Connect failed: 0x80040154 wine: Unhandled page fault on read access to 0x00000038 at address 0x7e1b7358 (thread 0009), starting debugger... Unhandled exception: page fault on read access to 0x00000038 in 32-bit code (0x7e1b7358). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:7e1b7358 ESP:0032fba4 EBP:0032fbd8 EFLAGS:00010202( R- -- I - - - ) EAX:00000000 EBX:7e202000 ECX:0032fba0 EDX:0032fcbc ESI:00161720 EDI:0032fcb8 Stack dump: 0x0032fba4: 00161720 00000000 00000000 0015abd0 0x0032fbb4: 7e14f7c6 0032fbe0 0032fcbc 00161548 0x0032fbc4: 7e1b7326 0032fbf0 0015ac8c 7e202000 0x0032fbd4: 0032fcbc 0032fc38 7e14cfa5 0015ac8c 0x0032fbe4: 0000000d 7e148b9f 7e14cfa5 00161720 0x0032fbf4: 0032fcb8 0032fcbc 7e14cf8e 00000001 Backtrace: =>0 0x7e1b7358 BaseControlVideoImpl_GetVideoSize+0x48(iface=<couldn't compute location>, pWidth=<couldn't compute location>, pHeight=<couldn't compute location>) [/home/julliard/wine/wine/dlls/strmbase/video.c:558] in quartz (0x0032fbd8) 1 0x7e14cfa5 BasicVideo_GetVideoSize+0x74(iface=<couldn't compute location>, pWidth=<couldn't compute location>, pHeight=<couldn't compute location>) [/home/julliard/wine/wine/dlls/quartz/../../include/control.h:1518] in quartz (0x0032fc38) 2 0x7ecbde1d rungraph+0x1dc(graph=0x15abd4) [/home/julliard/wine/wine/dlls/quartz/tests/../../../include/control.h:1518] in quartz_test (0x0032fcf8) 3 0x7ecc026d test_render_run+0x43c(file=<is not available>) [/home/julliard/wine/wine/dlls/quartz/tests/filtergraph.c:466] in quartz_test (0x0032fd68) 4 0x7ecc3030 func_filtergraph+0x2f() [/home/julliard/wine/wine/dlls/quartz/tests/filtergraph.c:2315] in quartz_test (0x0032fdc8) 5 0x7ecba3d6 main+0x2e5(argc=<is not available>, argv=<is not available>) [/home/julliard/wine/wine/dlls/quartz/tests/../../../include/wine/test.h:603] in quartz_test (0x0032fe78) 6 0x7ecc8b54 __wine_spec_exe_entry+0x63(peb=<couldn't compute location>) [/home/julliard/wine/wine/dlls/winecrt0/exe_entry.c:36] in quartz_test (0x0032feb8) 7 0x7b45fcbc call_process_entry+0xb() in kernel32 (0x0032fed8) 8 0x7b4615d2 start_process+0x1b1(entry=<couldn't compute location>, peb=<couldn't compute location>) [/home/julliard/wine/wine/dlls/kernel32/process.c:1098] in kernel32 (0x0032ffd8) 9 0x7b45fcca start_process_wrapper+0x9() in kernel32 (0x0032ffec) 0x7e1b7358 BaseControlVideoImpl_GetVideoSize+0x48 [/home/julliard/wine/wine/dlls/strmbase/video.c:558] in quartz: movl 0x38(%eax),%ecx 558 *pHeight = vih->bmiHeader.biHeight;
Thanks. Unfortunately I can't reproduce this on my machine, so could you please attach +quartz logs?
Zebediah Figura z.figura12@gmail.com writes:
Thanks. Unfortunately I can't reproduce this on my machine, so could you please attach +quartz logs?
On 28/02/18 13:35, Alexandre Julliard wrote:
Zebediah Figura z.figura12@gmail.com writes:
Thanks. Unfortunately I can't reproduce this on my machine, so could you please attach +quartz logs?
Thanks. I've added a patch to fix this on the filtergraph end.
Fixing the filter mapper unregistration will take a bit more work, but this should at least let the filtergraph tests pass.
Zebediah Figura z.figura12@gmail.com writes:
On 28/02/18 13:35, Alexandre Julliard wrote:
Zebediah Figura z.figura12@gmail.com writes:
Thanks. Unfortunately I can't reproduce this on my machine, so could you please attach +quartz logs?
Thanks. I've added a patch to fix this on the filtergraph end.
It works for me, thanks!