Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/renderer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 5634ab1905b..051230186d2 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -407,7 +407,7 @@ HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface) EnterCriticalSection(&This->csRenderLock); { RendererPosPassThru_ResetMediaTime(This->pPosition); - if (This->pFuncsTable->renderer_stop_stream) + if (This->sink.pin.pConnectedTo && This->pFuncsTable->renderer_stop_stream) This->pFuncsTable->renderer_stop_stream(This); This->filter.state = State_Stopped; SetEvent(This->state_event); @@ -449,7 +449,7 @@ HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart) if (SUCCEEDED(hr)) { QualityControlRender_Start(This->qcimpl, This->filter.rtStreamStart); - if (This->pFuncsTable->renderer_start_stream) + if (This->sink.pin.pConnectedTo && This->pFuncsTable->renderer_start_stream) This->pFuncsTable->renderer_start_stream(This); if (This->filter.state == State_Stopped) BaseRendererImpl_ClearPendingSample(This); @@ -477,7 +477,7 @@ HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface) ResetEvent(This->state_event); This->sink.end_of_stream = FALSE; } - else if (This->pFuncsTable->renderer_stop_stream) + else if (This->sink.pin.pConnectedTo && This->pFuncsTable->renderer_stop_stream) This->pFuncsTable->renderer_stop_stream(This);
if (This->filter.state == State_Stopped)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/acmwrapper.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/avidec.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/avisplit.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/dsoundrender.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/filesource.c | 61 ++++++++++++++----------------- dlls/quartz/tests/mpegsplit.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/videorenderer.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/vmr7.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/vmr9.c | 58 +++++++++++++++++++++++++++++ dlls/quartz/tests/waveparser.c | 58 +++++++++++++++++++++++++++++ 10 files changed, 549 insertions(+), 34 deletions(-)
diff --git a/dlls/quartz/tests/acmwrapper.c b/dlls/quartz/tests/acmwrapper.c index 1f07e507830..035968b9e3e 100644 --- a/dlls/quartz/tests/acmwrapper.c +++ b/dlls/quartz/tests/acmwrapper.c @@ -441,6 +441,63 @@ todo_wine ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_acm_wrapper(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(acmwrapper) { CoInitialize(NULL); @@ -450,6 +507,7 @@ START_TEST(acmwrapper) test_enum_pins(); test_find_pin(); test_pin_info(); + test_unconnected_filter_state();
CoUninitialize(); } diff --git a/dlls/quartz/tests/avidec.c b/dlls/quartz/tests/avidec.c index 19997e3c172..40d7b64f5f7 100644 --- a/dlls/quartz/tests/avidec.c +++ b/dlls/quartz/tests/avidec.c @@ -618,6 +618,63 @@ static void test_enum_media_types(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_avi_dec(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(avidec) { BOOL ret; @@ -634,6 +691,7 @@ START_TEST(avidec) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state();
CoUninitialize();
diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index ce0ea16a8e0..e17173b4cfc 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -1015,6 +1015,63 @@ fail: DeleteFileW(filename); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_avi_splitter(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(avisplit) { IBaseFilter *filter; @@ -1036,6 +1093,7 @@ START_TEST(avisplit) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state(); test_filter_graph();
CoUninitialize(); diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c index 8b7a1a52364..4f094e2c963 100644 --- a/dlls/quartz/tests/dsoundrender.c +++ b/dlls/quartz/tests/dsoundrender.c @@ -631,6 +631,63 @@ static void test_basefilter(void) IBaseFilter_Release(base); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_dsound_render(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(dsoundrender) { IBaseFilter *filter; @@ -657,6 +714,7 @@ START_TEST(dsoundrender) test_pin_info(); test_basic_audio(); test_enum_media_types(); + test_unconnected_filter_state(); test_basefilter();
CoUninitialize(); diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c index 37f8dd97cd0..f33ae1f971f 100644 --- a/dlls/quartz/tests/filesource.c +++ b/dlls/quartz/tests/filesource.c @@ -691,66 +691,59 @@ static void test_pin_info(void) ok(ret, "Failed to delete file, error %u.\n", GetLastError()); }
-static void test_filter_state(void) +static void test_unconnected_filter_state(void) { IBaseFilter *filter = create_file_source(); - IMediaControl *control; - IFilterGraph2 *graph; FILTER_STATE state; HRESULT hr; ULONG ref;
- CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, - &IID_IFilterGraph2, (void **)&graph); - IFilterGraph2_AddFilter(graph, filter, NULL); - IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); - hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Stopped, "Got state %d.\n", state); + ok(state == State_Stopped, "Got state %u.\n", state);
- hr = IMediaControl_Run(control); -todo_wine + hr = IBaseFilter_Pause(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Running, "Got state %d.\n", state); + ok(state == State_Paused, "Got state %u.\n", state);
- hr = IMediaControl_Stop(control); + hr = IBaseFilter_Run(filter, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Stopped, "Got state %d.\n", state); + ok(state == State_Running, "Got state %u.\n", state);
- hr = IMediaControl_Pause(control); -todo_wine + hr = IBaseFilter_Pause(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Paused, "Got state %d.\n", state); + ok(state == State_Paused, "Got state %u.\n", state);
- hr = IMediaControl_Run(control); -todo_wine + hr = IBaseFilter_Stop(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Running, "Got state %d.\n", state); + ok(state == State_Stopped, "Got state %u.\n", state);
- hr = IMediaControl_Pause(control); -todo_wine + hr = IBaseFilter_Run(filter, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Paused, "Got state %d.\n", state); + ok(state == State_Running, "Got state %u.\n", state);
- hr = IMediaControl_Stop(control); + hr = IBaseFilter_Stop(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IBaseFilter_GetState(filter, 1000, &state); + + hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(state == State_Stopped, "Got state %d.\n", state); + ok(state == State_Stopped, "Got state %u.\n", state);
- IMediaControl_Release(control); - IFilterGraph2_Release(graph); ref = IBaseFilter_Release(filter); ok(!ref, "Got outstanding refcount %d.\n", ref); } @@ -1197,7 +1190,7 @@ START_TEST(filesource) test_enum_pins(); test_find_pin(); test_pin_info(); - test_filter_state(); + test_unconnected_filter_state(); test_file_source_filter(); test_async_reader(); test_enum_media_types(); diff --git a/dlls/quartz/tests/mpegsplit.c b/dlls/quartz/tests/mpegsplit.c index 0281b67ce21..89e387a443b 100644 --- a/dlls/quartz/tests/mpegsplit.c +++ b/dlls/quartz/tests/mpegsplit.c @@ -997,6 +997,63 @@ static void test_enum_media_types(void) ok(ret, "Failed to delete file, error %u.\n", GetLastError()); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_mpeg_splitter(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(mpegsplit) { IBaseFilter *filter; @@ -1018,6 +1075,7 @@ START_TEST(mpegsplit) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state();
CoUninitialize(); } diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 985154f238b..7d3b2776177 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -528,6 +528,63 @@ static void test_basefilter(void) IBaseFilter_Release(base); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_video_renderer(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(videorenderer) { CoInitialize(NULL); @@ -539,6 +596,7 @@ START_TEST(videorenderer) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state(); test_basefilter();
CoUninitialize(); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index f9ca8930f30..53f979601e9 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -775,6 +775,63 @@ static void test_enum_media_types(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_vmr7(0); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(vmr7) { CoInitialize(NULL); @@ -787,6 +844,7 @@ START_TEST(vmr7) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state();
CoUninitialize(); } diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index f4a3017d3f7..80bb9303780 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -779,6 +779,63 @@ static void test_enum_media_types(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_vmr9(0); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(vmr9) { IBaseFilter *filter; @@ -802,6 +859,7 @@ START_TEST(vmr9) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state();
CoUninitialize(); } diff --git a/dlls/quartz/tests/waveparser.c b/dlls/quartz/tests/waveparser.c index 2e4cc914618..d1acaa531e4 100644 --- a/dlls/quartz/tests/waveparser.c +++ b/dlls/quartz/tests/waveparser.c @@ -761,6 +761,63 @@ static void test_enum_media_types(void) ok(ret, "Failed to delete file, error %u.\n", GetLastError()); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_wave_parser(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(waveparser) { IBaseFilter *filter; @@ -782,6 +839,7 @@ START_TEST(waveparser) test_pin_info(); test_media_types(); test_enum_media_types(); + test_unconnected_filter_state();
CoUninitialize(); }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avico.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 89e8dda08f8..ea98b2a6553 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -148,8 +148,8 @@ static HRESULT WINAPI AVICompressor_Run(IBaseFilter *iface, REFERENCE_TIME tStar if(This->filter.state == State_Running) return S_OK;
- hres = IMemAllocator_Commit(This->source.pAllocator); - if(FAILED(hres)) { + if (This->source.pAllocator && FAILED(hres = IMemAllocator_Commit(This->source.pAllocator))) + { FIXME("Commit failed: %08x\n", hres); return hres; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/tests/audiorecord.c | 53 +++++++++++++++++++++++++++++ dlls/qcap/tests/avico.c | 53 +++++++++++++++++++++++++++++ dlls/qcap/tests/avimux.c | 58 ++++++++++++++++++++++++++++++++ dlls/qcap/tests/smartteefilter.c | 58 ++++++++++++++++++++++++++++++++ 4 files changed, 222 insertions(+)
diff --git a/dlls/qcap/tests/audiorecord.c b/dlls/qcap/tests/audiorecord.c index e599165d191..11ef690b99d 100644 --- a/dlls/qcap/tests/audiorecord.c +++ b/dlls/qcap/tests/audiorecord.c @@ -245,6 +245,58 @@ static void test_property_bag(IMoniker *mon) IPropertyBag_Release(devenum_bag); }
+static void test_unconnected_filter_state(IBaseFilter *filter) +{ + FILTER_STATE state; + HRESULT hr; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + todo_wine ok(hr == VFW_S_CANT_CUE, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + todo_wine ok(hr == VFW_S_CANT_CUE, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); +} + START_TEST(audiorecord) { ICreateDevEnum *devenum; @@ -285,6 +337,7 @@ START_TEST(audiorecord) ok(hr == S_OK, "Got hr %#x.\n", hr);
test_interfaces(filter); + test_unconnected_filter_state(filter);
ref = IBaseFilter_Release(filter); ok(!ref, "Got outstanding refcount %d.\n", ref); diff --git a/dlls/qcap/tests/avico.c b/dlls/qcap/tests/avico.c index dbc15e3f15d..5c6d4aa54f4 100644 --- a/dlls/qcap/tests/avico.c +++ b/dlls/qcap/tests/avico.c @@ -655,6 +655,58 @@ static void test_enum_media_types(IBaseFilter *filter) IPin_Release(pin); }
+static void test_unconnected_filter_state(IBaseFilter *filter) +{ + FILTER_STATE state; + HRESULT hr; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); +} + START_TEST(avico) { static const WCHAR test_display_name[] = {'@','d','e','v','i','c','e',':', @@ -697,6 +749,7 @@ START_TEST(avico) test_pin_info(filter); test_media_types(filter); test_enum_media_types(filter); + test_unconnected_filter_state(filter);
ref = IBaseFilter_Release(filter); ok(!ref, "Got outstanding refcount %d.\n", ref); diff --git a/dlls/qcap/tests/avimux.c b/dlls/qcap/tests/avimux.c index 85ebd5c82c7..572314f8ab3 100644 --- a/dlls/qcap/tests/avimux.c +++ b/dlls/qcap/tests/avimux.c @@ -798,6 +798,63 @@ static void test_seeking(void) ok(!ref, "Got unexpected refcount %d.\n", ref); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_avi_mux(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(avimux) { CoInitialize(NULL); @@ -810,6 +867,7 @@ START_TEST(avimux) test_media_types(); test_enum_media_types(); test_seeking(); + test_unconnected_filter_state();
CoUninitialize(); } diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index 487c8eca3c1..437f3f4a7f2 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -2154,6 +2154,63 @@ end: IEnumMediaTypes_Release(enumMediaTypes); }
+static void test_unconnected_filter_state(void) +{ + IBaseFilter *filter = create_smart_tee(); + FILTER_STATE state; + HRESULT hr; + ULONG ref; + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + todo_wine ok(hr == VFW_S_CANT_CUE, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Pause(filter); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + todo_wine ok(hr == VFW_S_CANT_CUE, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Paused, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IBaseFilter_Run(filter, 0); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(state == State_Running, "Got state %u.\n", state); + + hr = IBaseFilter_Stop(filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IBaseFilter_GetState(filter, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + static void test_smart_tee_filter_aggregation(void) { SourceFilter *sourceFilter = create_video_SourceFilter(); @@ -2381,6 +2438,7 @@ START_TEST(smartteefilter) test_find_pin(); test_pin_info(); test_enum_media_types(); + test_unconnected_filter_state();
test_smart_tee_filter_aggregation(); test_smart_tee_filter();
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/smartteefilter.c | 48 ++------------------------------ dlls/qcap/tests/smartteefilter.c | 16 +++++------ 2 files changed, 11 insertions(+), 53 deletions(-)
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index b2e5496b7dd..d7e9e8b5f15 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -46,61 +46,19 @@ static inline SmartTeeFilter *impl_from_strmbase_filter(struct strmbase_filter * return CONTAINING_RECORD(filter, SmartTeeFilter, filter); }
-static inline SmartTeeFilter *impl_from_IBaseFilter(IBaseFilter *iface) -{ - struct strmbase_filter *filter = CONTAINING_RECORD(iface, struct strmbase_filter, IBaseFilter_iface); - return impl_from_strmbase_filter(filter); -} - static inline SmartTeeFilter *impl_from_strmbase_pin(struct strmbase_pin *pin) { return impl_from_strmbase_filter(pin->filter); }
-static HRESULT WINAPI SmartTeeFilter_Stop(IBaseFilter *iface) -{ - SmartTeeFilter *This = impl_from_IBaseFilter(iface); - TRACE("(%p)\n", This); - EnterCriticalSection(&This->filter.csFilter); - This->filter.state = State_Stopped; - LeaveCriticalSection(&This->filter.csFilter); - return S_OK; -} - -static HRESULT WINAPI SmartTeeFilter_Pause(IBaseFilter *iface) -{ - SmartTeeFilter *This = impl_from_IBaseFilter(iface); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI SmartTeeFilter_Run(IBaseFilter *iface, REFERENCE_TIME tStart) -{ - SmartTeeFilter *This = impl_from_IBaseFilter(iface); - HRESULT hr = S_OK; - TRACE("(%p, %s)\n", This, wine_dbgstr_longlong(tStart)); - EnterCriticalSection(&This->filter.csFilter); - if(This->filter.state != State_Running) { - /* We share an allocator among all pins, an allocator can only get committed - * once, state transitions occur in upstream order, and only output pins - * commit allocators, so let the filter attached to the input pin worry about it. */ - if (This->sink.pin.pConnectedTo) - This->filter.state = State_Running; - else - hr = VFW_E_NOT_CONNECTED; - } - LeaveCriticalSection(&This->filter.csFilter); - return hr; -} - static const IBaseFilterVtbl SmartTeeFilterVtbl = { BaseFilterImpl_QueryInterface, BaseFilterImpl_AddRef, BaseFilterImpl_Release, BaseFilterImpl_GetClassID, - SmartTeeFilter_Stop, - SmartTeeFilter_Pause, - SmartTeeFilter_Run, + BaseFilterImpl_Stop, + BaseFilterImpl_Pause, + BaseFilterImpl_Run, BaseFilterImpl_GetState, BaseFilterImpl_SetSyncSource, BaseFilterImpl_GetSyncSource, diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index 437f3f4a7f2..4eac344d537 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -2166,25 +2166,25 @@ static void test_unconnected_filter_state(void) ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); todo_wine ok(hr == VFW_S_CANT_CUE, "Got hr %#x.\n", hr); - todo_wine ok(state == State_Paused, "Got state %u.\n", state); + ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(state == State_Running, "Got state %u.\n", state); + ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Pause(filter); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); todo_wine ok(hr == VFW_S_CANT_CUE, "Got hr %#x.\n", hr); - todo_wine ok(state == State_Paused, "Got state %u.\n", state); + ok(state == State_Paused, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -2194,11 +2194,11 @@ static void test_unconnected_filter_state(void) ok(state == State_Stopped, "Got state %u.\n", state);
hr = IBaseFilter_Run(filter, 0); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IBaseFilter_GetState(filter, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(state == State_Running, "Got state %u.\n", state); + ok(state == State_Running, "Got state %u.\n", state);
hr = IBaseFilter_Stop(filter); ok(hr == S_OK, "Got hr %#x.\n", hr);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avimux.c | 16 +++++++------- dlls/qcap/smartteefilter.c | 8 +++---- dlls/qcap/vfwcapture.c | 10 ++++----- dlls/quartz/dsoundrender.c | 2 +- dlls/quartz/filesource.c | 10 ++++----- dlls/quartz/videorenderer.c | 2 +- dlls/quartz/vmr9.c | 4 ++-- dlls/strmbase/outputqueue.c | 4 ++-- dlls/strmbase/pin.c | 38 ++++++++++++++++----------------- dlls/strmbase/renderer.c | 14 ++++++------ dlls/strmbase/transform.c | 12 +++++------ dlls/strmbase/video.c | 6 +++--- dlls/winegstreamer/gstdemux.c | 38 ++++++++++++++++----------------- dlls/wineqtdecoder/qtsplitter.c | 20 ++++++++--------- include/wine/strmbase.h | 2 +- 15 files changed, 93 insertions(+), 93 deletions(-)
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 42b198deea4..596016cf77d 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -470,7 +470,7 @@ static HRESULT WINAPI AviMux_Stop(IBaseFilter *iface) return hr;
for(i=0; i<This->input_pin_no; i++) { - if(!This->in[i]->pin.pin.pConnectedTo) + if(!This->in[i]->pin.pin.peer) continue;
hr = out_seek(This, This->in[i]->ix_off); @@ -515,7 +515,7 @@ static HRESULT WINAPI AviMux_Stop(IBaseFilter *iface) return hr;
for(i=0; i<This->input_pin_no; i++) { - if(!This->in[i]->pin.pin.pConnectedTo) + if(!This->in[i]->pin.pin.peer) continue;
rl.cb = sizeof(FOURCC) + sizeof(AVISTREAMHEADER) + sizeof(RIFFCHUNK) + @@ -593,10 +593,10 @@ static HRESULT WINAPI AviMux_Run(IBaseFilter *iface, REFERENCE_TIME tStart) IMediaSeeking *ms; LONGLONG cur, stop;
- if(!This->in[i]->pin.pin.pConnectedTo) + if(!This->in[i]->pin.pin.peer) continue;
- hr = IPin_QueryInterface(This->in[i]->pin.pin.pConnectedTo, + hr = IPin_QueryInterface(This->in[i]->pin.pin.peer, &IID_IMediaSeeking, (void**)&ms); if(FAILED(hr)) continue; @@ -632,7 +632,7 @@ static HRESULT WINAPI AviMux_Run(IBaseFilter *iface, REFERENCE_TIME tStart) This->stop = -1; memset(&This->avih, 0, sizeof(This->avih)); for(i=0; i<This->input_pin_no; i++) { - if(!This->in[i]->pin.pin.pConnectedTo) + if(!This->in[i]->pin.pin.peer) continue;
This->avih.dwStreams++; @@ -660,7 +660,7 @@ static HRESULT WINAPI AviMux_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
stream_id = 0; for(i=0; i<This->input_pin_no; i++) { - if(!This->in[i]->pin.pin.pConnectedTo) + if(!This->in[i]->pin.pin.peer) continue;
This->in[i]->ix_off = This->size; @@ -815,7 +815,7 @@ static HRESULT WINAPI ConfigInterleaving_put_Mode( return E_INVALIDARG;
if(This->mode != mode) { - if(This->source.pin.pConnectedTo) { + if(This->source.pin.peer) { HRESULT hr = IFilterGraph_Reconnect(This->filter.filterInfo.pGraph, &This->source.pin.IPin_iface); if(FAILED(hr)) @@ -1267,7 +1267,7 @@ static HRESULT WINAPI AviMuxOut_Connect(IPin *iface, return hr;
for(i=0; i<This->input_pin_no; i++) { - if(!This->in[i]->pin.pin.pConnectedTo) + if(!This->in[i]->pin.pin.peer) continue;
hr = IFilterGraph_Reconnect(This->filter.filterInfo.pGraph, &This->in[i]->pin.pin.IPin_iface); diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index d7e9e8b5f15..26f32559670 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -141,7 +141,7 @@ static HRESULT sink_get_media_type(struct strmbase_pin *base, if (iPosition) return S_FALSE; EnterCriticalSection(&This->filter.csFilter); - if (This->sink.pin.pConnectedTo) + if (This->sink.pin.peer) { CopyMediaType(amt, &This->sink.pin.mtCurrent); hr = S_OK; @@ -259,7 +259,7 @@ static HRESULT WINAPI SmartTeeFilterInput_Receive(BaseInputPin *base, IMediaSamp
/* FIXME: we should ideally do each of these in a separate thread */ EnterCriticalSection(&This->filter.csFilter); - if (This->capture.pin.pConnectedTo) + if (This->capture.pin.peer) hrCapture = copy_sample(inputSample, This->capture.pAllocator, &captureSample); LeaveCriticalSection(&This->filter.csFilter); if (SUCCEEDED(hrCapture)) @@ -268,7 +268,7 @@ static HRESULT WINAPI SmartTeeFilterInput_Receive(BaseInputPin *base, IMediaSamp IMediaSample_Release(captureSample);
EnterCriticalSection(&This->filter.csFilter); - if (This->preview.pin.pConnectedTo) + if (This->preview.pin.peer) hrPreview = copy_sample(inputSample, This->preview.pAllocator, &previewSample); LeaveCriticalSection(&This->filter.csFilter); /* No timestamps on preview stream: */ @@ -329,7 +329,7 @@ static HRESULT source_get_media_type(struct strmbase_pin *iface,
EnterCriticalSection(&filter->filter.csFilter);
- if (!filter->sink.pin.pConnectedTo) + if (!filter->sink.pin.peer) hr = VFW_E_NOT_CONNECTED; else if (!index) CopyMediaType(mt, &filter->sink.pin.mtCurrent); diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index e2608f43581..6fbe721a313 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -103,9 +103,9 @@ static void vfw_capture_destroy(struct strmbase_filter *iface) qcap_driver_destroy(filter->driver_info); }
- if (filter->source.pin.pConnectedTo) + if (filter->source.pin.peer) { - IPin_Disconnect(filter->source.pin.pConnectedTo); + IPin_Disconnect(filter->source.pin.peer); IPin_Disconnect(&filter->source.pin.IPin_iface); } strmbase_source_cleanup(&filter->source); @@ -221,16 +221,16 @@ AMStreamConfig_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *pmt)
dump_AM_MEDIA_TYPE(pmt);
- if (This->source.pin.pConnectedTo) + if (This->source.pin.peer) { - hr = IPin_QueryAccept(This->source.pin.pConnectedTo, pmt); + hr = IPin_QueryAccept(This->source.pin.peer, pmt); TRACE("Would accept: %d\n", hr); if (hr == S_FALSE) return VFW_E_INVALIDMEDIATYPE; }
hr = qcap_driver_set_format(This->driver_info, pmt); - if (SUCCEEDED(hr) && This->filter.filterInfo.pGraph && This->source.pin.pConnectedTo) + if (SUCCEEDED(hr) && This->filter.filterInfo.pGraph && This->source.pin.peer) { hr = IFilterGraph_Reconnect(This->filter.filterInfo.pGraph, &This->source.pin.IPin_iface); if (SUCCEEDED(hr)) diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index dbb5b523fa8..b6eb7ba2587 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -436,7 +436,7 @@ static void dsound_render_start_stream(BaseRenderer *iface)
TRACE("(%p)\n", This);
- if (This->renderer.sink.pin.pConnectedTo) + if (This->renderer.sink.pin.peer) { IDirectSoundBuffer_Play(This->dsbuffer, 0, 0, DSBPLAY_LOOPING); } diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 0c58ecaa2a9..36b7e95ad6f 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -358,8 +358,8 @@ static void async_reader_destroy(struct strmbase_filter *iface) { unsigned int i;
- if (filter->source.pin.pConnectedTo) - IPin_Disconnect(filter->source.pin.pConnectedTo); + if (filter->source.pin.peer) + IPin_Disconnect(filter->source.pin.peer);
IPin_Disconnect(&filter->source.pin.IPin_iface);
@@ -649,7 +649,7 @@ static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(struct strmbase_sourc
/* FIXME: call queryacceptproc */
- This->pin.pConnectedTo = pReceivePin; + This->pin.peer = pReceivePin; IPin_AddRef(pReceivePin); CopyMediaType(&This->pin.mtCurrent, pmt);
@@ -657,8 +657,8 @@ static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(struct strmbase_sourc
if (FAILED(hr)) { - IPin_Release(This->pin.pConnectedTo); - This->pin.pConnectedTo = NULL; + IPin_Release(This->pin.peer); + This->pin.peer = NULL; FreeMediaType(&This->pin.mtCurrent); }
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index aee362c7ef2..a7b3159ebcc 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -419,7 +419,7 @@ static void video_renderer_start_stream(BaseRenderer *iface)
TRACE("(%p)\n", This);
- if (This->renderer.sink.pin.pConnectedTo + if (This->renderer.sink.pin.peer && (This->renderer.filter.state == State_Stopped || !This->renderer.sink.end_of_stream)) { if (This->renderer.filter.state == State_Stopped) diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index d81c3252b05..2c9c825b505 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -377,7 +377,7 @@ static HRESULT VMR9_maybe_init(struct quartz_vmr *This, BOOL force) HRESULT hr;
TRACE("my mode: %u, my window: %p, my last window: %p\n", This->mode, This->baseControlWindow.baseWindow.hWnd, This->hWndClippingWindow); - if (This->baseControlWindow.baseWindow.hWnd || !This->renderer.sink.pin.pConnectedTo) + if (This->baseControlWindow.baseWindow.hWnd || !This->renderer.sink.pin.peer) return S_OK;
if (This->mode == VMR9Mode_Windowless && !This->hWndClippingWindow) @@ -482,7 +482,7 @@ static HRESULT WINAPI VMR9_BreakConnect(BaseRenderer *This)
if (!pVMR9->mode) return S_FALSE; - if (This->sink.pin.pConnectedTo && pVMR9->allocator && pVMR9->presenter) + if (This->sink.pin.peer && pVMR9->allocator && pVMR9->presenter) { if (pVMR9->renderer.filter.state != State_Stopped) { diff --git a/dlls/strmbase/outputqueue.c b/dlls/strmbase/outputqueue.c index 6cb74f3e26c..ee05653d7a1 100644 --- a/dlls/strmbase/outputqueue.c +++ b/dlls/strmbase/outputqueue.c @@ -118,7 +118,7 @@ HRESULT WINAPI OutputQueue_ReceiveMultiple(OutputQueue *pOutputQueue, IMediaSamp HRESULT hr = S_OK; int i;
- if (!pOutputQueue->pInputPin->pin.pConnectedTo || !pOutputQueue->pInputPin->pMemInputPin) + if (!pOutputQueue->pInputPin->pin.peer || !pOutputQueue->pInputPin->pMemInputPin) return VFW_E_NOT_CONNECTED;
if (!pOutputQueue->hThread) @@ -241,7 +241,7 @@ DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue) HeapFree(GetProcessHeap(),0,qev); }
- if (pOutputQueue->pInputPin->pin.pConnectedTo && pOutputQueue->pInputPin->pMemInputPin) + if (pOutputQueue->pInputPin->pin.peer && pOutputQueue->pInputPin->pMemInputPin) { IMemInputPin_AddRef(pOutputQueue->pInputPin->pMemInputPin); LeaveCriticalSection(&pOutputQueue->csQueue); diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 190c9078fab..cc7db119fae 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -203,10 +203,10 @@ HRESULT WINAPI BasePinImpl_Disconnect(IPin * iface)
EnterCriticalSection(&This->filter->csFilter); { - if (This->pConnectedTo) + if (This->peer) { - IPin_Release(This->pConnectedTo); - This->pConnectedTo = NULL; + IPin_Release(This->peer); + This->peer = NULL; FreeMediaType(&This->mtCurrent); ZeroMemory(&This->mtCurrent, sizeof(This->mtCurrent)); hr = S_OK; @@ -228,9 +228,9 @@ HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin)
EnterCriticalSection(&This->filter->csFilter); { - if (This->pConnectedTo) + if (This->peer) { - *ppPin = This->pConnectedTo; + *ppPin = This->peer; IPin_AddRef(*ppPin); hr = S_OK; } @@ -254,7 +254,7 @@ HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt
EnterCriticalSection(&This->filter->csFilter); { - if (This->pConnectedTo) + if (This->peer) { CopyMediaType(pmt, &This->mtCurrent); hr = S_OK; @@ -467,10 +467,10 @@ HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface) IMemInputPin_Release(This->pMemInputPin); This->pMemInputPin = NULL; } - if (This->pin.pConnectedTo) + if (This->pin.peer) { - IPin_Release(This->pin.pConnectedTo); - This->pin.pConnectedTo = NULL; + IPin_Release(This->pin.peer); + This->pin.peer = NULL; FreeMediaType(&This->pin.mtCurrent); ZeroMemory(&This->pin.mtCurrent, sizeof(This->pin.mtCurrent)); hr = S_OK; @@ -517,7 +517,7 @@ HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *This,
TRACE("(%p)->(%p, %p, %p, %x)\n", This, ppSample, tStart, tStop, dwFlags);
- if (!This->pin.pConnectedTo) + if (!This->pin.peer) hr = VFW_E_NOT_CONNECTED; else { @@ -539,7 +539,7 @@ HRESULT WINAPI BaseOutputPinImpl_Deliver(struct strmbase_source *This, IMediaSam
EnterCriticalSection(&This->pin.filter->csFilter); { - if (!This->pin.pConnectedTo || !This->pMemInputPin) + if (!This->pin.peer || !This->pMemInputPin) hr = VFW_E_NOT_CONNECTED; else { @@ -548,7 +548,7 @@ HRESULT WINAPI BaseOutputPinImpl_Deliver(struct strmbase_source *This, IMediaSam * using it. Same with its filter. */ pMemConnected = This->pMemInputPin; IMemInputPin_AddRef(pMemConnected); - hr = IPin_QueryPinInfo(This->pin.pConnectedTo, &pinInfo); + hr = IPin_QueryPinInfo(This->pin.peer, &pinInfo); } } LeaveCriticalSection(&This->pin.filter->csFilter); @@ -579,7 +579,7 @@ HRESULT WINAPI BaseOutputPinImpl_Active(struct strmbase_source *This)
EnterCriticalSection(&This->pin.filter->csFilter); { - if (!This->pin.pConnectedTo || !This->pMemInputPin) + if (!This->pin.peer || !This->pMemInputPin) hr = VFW_E_NOT_CONNECTED; else hr = IMemAllocator_Commit(This->pAllocator); @@ -599,7 +599,7 @@ HRESULT WINAPI BaseOutputPinImpl_Inactive(struct strmbase_source *This)
EnterCriticalSection(&This->pin.filter->csFilter); { - if (!This->pin.pConnectedTo || !This->pMemInputPin) + if (!This->pin.peer || !This->pMemInputPin) hr = VFW_E_NOT_CONNECTED; else hr = IMemAllocator_Decommit(This->pAllocator); @@ -657,7 +657,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This, if ((hr = This->pFuncsTable->base.pin_query_accept(&This->pin, pmt)) != S_OK) return hr;
- This->pin.pConnectedTo = pReceivePin; + This->pin.peer = pReceivePin; IPin_AddRef(pReceivePin); CopyMediaType(&This->pin.mtCurrent, pmt);
@@ -692,8 +692,8 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This,
if (FAILED(hr)) { - IPin_Release(This->pin.pConnectedTo); - This->pin.pConnectedTo = NULL; + IPin_Release(This->pin.peer); + This->pin.peer = NULL; FreeMediaType(&This->pin.mtCurrent); }
@@ -747,7 +747,7 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP
EnterCriticalSection(&This->pin.filter->csFilter); { - if (This->pin.pConnectedTo) + if (This->pin.peer) hr = VFW_E_ALREADY_CONNECTED;
if (SUCCEEDED(hr) && This->pin.pFuncsTable->pin_query_accept(&This->pin, pmt) != S_OK) @@ -768,7 +768,7 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP if (SUCCEEDED(hr)) { CopyMediaType(&This->pin.mtCurrent, pmt); - This->pin.pConnectedTo = pReceivePin; + This->pin.peer = pReceivePin; IPin_AddRef(pReceivePin); } } diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 051230186d2..038cb48b57b 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -282,8 +282,8 @@ HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, const IBaseFilterVtb
void strmbase_renderer_cleanup(BaseRenderer *filter) { - if (filter->sink.pin.pConnectedTo) - IPin_Disconnect(filter->sink.pin.pConnectedTo); + if (filter->sink.pin.peer) + IPin_Disconnect(filter->sink.pin.peer); IPin_Disconnect(&filter->sink.pin.IPin_iface); strmbase_sink_cleanup(&filter->sink);
@@ -407,7 +407,7 @@ HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface) EnterCriticalSection(&This->csRenderLock); { RendererPosPassThru_ResetMediaTime(This->pPosition); - if (This->sink.pin.pConnectedTo && This->pFuncsTable->renderer_stop_stream) + if (This->sink.pin.peer && This->pFuncsTable->renderer_stop_stream) This->pFuncsTable->renderer_stop_stream(This); This->filter.state = State_Stopped; SetEvent(This->state_event); @@ -431,7 +431,7 @@ HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
SetEvent(This->state_event);
- if (This->sink.pin.pConnectedTo) + if (This->sink.pin.peer) { This->sink.end_of_stream = FALSE; } @@ -449,7 +449,7 @@ HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart) if (SUCCEEDED(hr)) { QualityControlRender_Start(This->qcimpl, This->filter.rtStreamStart); - if (This->sink.pin.pConnectedTo && This->pFuncsTable->renderer_start_stream) + if (This->sink.pin.peer && This->pFuncsTable->renderer_start_stream) This->pFuncsTable->renderer_start_stream(This); if (This->filter.state == State_Stopped) BaseRendererImpl_ClearPendingSample(This); @@ -473,11 +473,11 @@ HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface) { if (This->filter.state == State_Stopped) { - if (This->sink.pin.pConnectedTo) + if (This->sink.pin.peer) ResetEvent(This->state_event); This->sink.end_of_stream = FALSE; } - else if (This->sink.pin.pConnectedTo && This->pFuncsTable->renderer_stop_stream) + else if (This->sink.pin.peer && This->pFuncsTable->renderer_stop_stream) This->pFuncsTable->renderer_stop_stream(This);
if (This->filter.state == State_Stopped) diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index 04acf63c9a5..77de1227dd9 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -135,12 +135,12 @@ static void transform_destroy(struct strmbase_filter *iface) { TransformFilter *filter = impl_from_strmbase_filter(iface);
- if (filter->sink.pin.pConnectedTo) - IPin_Disconnect(filter->sink.pin.pConnectedTo); + if (filter->sink.pin.peer) + IPin_Disconnect(filter->sink.pin.peer); IPin_Disconnect(&filter->sink.pin.IPin_iface);
- if (filter->source.pin.pConnectedTo) - IPin_Disconnect(filter->source.pin.pConnectedTo); + if (filter->source.pin.peer) + IPin_Disconnect(filter->source.pin.peer); IPin_Disconnect(&filter->source.pin.IPin_iface);
strmbase_sink_cleanup(&filter->sink); @@ -379,8 +379,8 @@ static HRESULT WINAPI TransformFilter_InputPin_EndOfStream(IPin * iface)
TRACE("iface %p.\n", iface);
- if (filter->source.pin.pConnectedTo) - return IPin_EndOfStream(filter->source.pin.pConnectedTo); + if (filter->source.pin.peer) + return IPin_EndOfStream(filter->source.pin.peer); return VFW_E_NOT_CONNECTED; }
diff --git a/dlls/strmbase/video.c b/dlls/strmbase/video.c index 4be4b2380f9..d1ebbdf235a 100644 --- a/dlls/strmbase/video.c +++ b/dlls/strmbase/video.c @@ -132,7 +132,7 @@ static HRESULT WINAPI basic_video_get_AvgTimePerFrame(IBasicVideo *iface, REFTIM
if (!pAvgTimePerFrame) return E_POINTER; - if (!This->pPin->pConnectedTo) + if (!This->pPin->peer) return VFW_E_NOT_CONNECTED;
TRACE("(%p/%p)->(%p)\n", This, iface, pAvgTimePerFrame); @@ -151,7 +151,7 @@ static HRESULT WINAPI basic_video_get_BitRate(IBasicVideo *iface, LONG *pBitRate
if (!pBitRate) return E_POINTER; - if (!This->pPin->pConnectedTo) + if (!This->pPin->peer) return VFW_E_NOT_CONNECTED;
vih = This->pFuncsTable->pfnGetVideoFormat(This); @@ -168,7 +168,7 @@ static HRESULT WINAPI basic_video_get_BitErrorRate(IBasicVideo *iface, LONG *pBi
if (!pBitErrorRate) return E_POINTER; - if (!This->pPin->pConnectedTo) + if (!This->pPin->peer) return VFW_E_NOT_CONNECTED;
vih = This->pFuncsTable->pfnGetVideoFormat(This); diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index de3bc996877..cee90d195bf 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -523,14 +523,14 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event) if (stop > 0) stop /= 100;
- if (pin->pin.pin.pConnectedTo) - IPin_NewSegment(pin->pin.pin.pConnectedTo, pos, stop, rate*applied_rate); + if (pin->pin.pin.peer) + IPin_NewSegment(pin->pin.pin.peer, pos, stop, rate*applied_rate);
return TRUE; } case GST_EVENT_EOS: - if (pin->pin.pin.pConnectedTo) - IPin_EndOfStream(pin->pin.pin.pConnectedTo); + if (pin->pin.pin.peer) + IPin_EndOfStream(pin->pin.pin.peer); return TRUE; case GST_EVENT_FLUSH_START: if (impl_from_strmbase_filter(pin->pin.pin.filter)->ignore_flush) { @@ -544,13 +544,13 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event) GST_PAD_UNSET_FLUSHING (pad); return TRUE; } - if (pin->pin.pin.pConnectedTo) - IPin_BeginFlush(pin->pin.pin.pConnectedTo); + if (pin->pin.pin.peer) + IPin_BeginFlush(pin->pin.pin.peer); return TRUE; case GST_EVENT_FLUSH_STOP: gst_segment_init(pin->segment, GST_FORMAT_TIME); - if (pin->pin.pin.pConnectedTo) - IPin_EndFlush(pin->pin.pin.pConnectedTo); + if (pin->pin.pin.peer) + IPin_EndFlush(pin->pin.pin.peer); return TRUE; case GST_EVENT_CAPS: { GstCaps *caps; @@ -731,7 +731,7 @@ static GstFlowReturn got_data_sink(GstPad *pad, GstObject *parent, GstBuffer *bu IMediaSample_SetPreroll(sample, GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLAG_LIVE)); IMediaSample_SetSyncPoint(sample, !GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLAG_DELTA_UNIT));
- if (!pin->pin.pin.pConnectedTo) + if (!pin->pin.pin.peer) hr = VFW_E_NOT_CONNECTED; else hr = IMemInputPin_Receive(pin->pin.pMemInputPin, sample); @@ -1208,9 +1208,9 @@ static void gstdemux_destroy(struct strmbase_filter *iface) CloseHandle(filter->duration_event);
/* Don't need to clean up output pins, disconnecting input pin will do that */ - if (filter->sink.pConnectedTo) + if (filter->sink.peer) { - hr = IPin_Disconnect(filter->sink.pConnectedTo); + hr = IPin_Disconnect(filter->sink.peer); assert(hr == S_OK); hr = IPin_Disconnect(&filter->sink.IPin_iface); assert(hr == S_OK); @@ -1847,10 +1847,10 @@ static HRESULT WINAPI GSTOutPin_DecideAllocator(struct strmbase_source *base,
static void free_source_pin(struct gstdemux_source *pin) { - if (pin->pin.pin.pConnectedTo) + if (pin->pin.pin.peer) { if (SUCCEEDED(IMemAllocator_Decommit(pin->pin.pAllocator))) - IPin_Disconnect(pin->pin.pin.pConnectedTo); + IPin_Disconnect(pin->pin.pin.peer); IPin_Disconnect(&pin->pin.pin.IPin_iface); }
@@ -1986,7 +1986,7 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, mark_wine_thread();
EnterCriticalSection(&filter->filter.csFilter); - if (!filter->sink.pConnectedTo) + if (!filter->sink.peer) { ALLOCATOR_PROPERTIES props; IMemAllocator *pAlloc = NULL; @@ -2028,7 +2028,7 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, IMemAllocator_Release(pAlloc); if (SUCCEEDED(hr)) { CopyMediaType(&filter->sink.mtCurrent, pmt); - filter->sink.pConnectedTo = pReceivePin; + filter->sink.peer = pReceivePin; IPin_AddRef(pReceivePin); hr = IMemAllocator_Commit(filter->alloc); } else { @@ -2059,13 +2059,13 @@ static HRESULT WINAPI GSTInPin_Disconnect(IPin *iface)
hr = IBaseFilter_GetState(&filter->filter.IBaseFilter_iface, INFINITE, &state); EnterCriticalSection(&filter->filter.csFilter); - if (filter->sink.pConnectedTo) + if (filter->sink.peer) { if (SUCCEEDED(hr) && state == State_Stopped) { IMemAllocator_Decommit(filter->alloc); - IPin_Disconnect(filter->sink.pConnectedTo); - IPin_Release(filter->sink.pConnectedTo); - filter->sink.pConnectedTo = NULL; + IPin_Disconnect(filter->sink.peer); + IPin_Release(filter->sink.peer); + filter->sink.peer = NULL; hr = GST_RemoveOutputPins(filter); } else hr = VFW_E_NOT_STOPPED; diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index d3b9596375d..218ed5dad70 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -340,7 +340,7 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr) This->pInputPin.pin.filter = &This->filter; lstrcpynW(This->pInputPin.pin.name, wcsInputPinName, ARRAY_SIZE(This->pInputPin.pin.name)); This->pInputPin.pin.IPin_iface.lpVtbl = &QT_InputPin_Vtbl; - This->pInputPin.pin.pConnectedTo = NULL; + This->pInputPin.pin.peer = NULL; This->pInputPin.pin.pFuncsTable = &sink_ops;
SourceSeeking_Init(&This->sourceSeeking, &QT_Seeking_Vtbl, QTSplitter_ChangeStop, QTSplitter_ChangeStart, QTSplitter_ChangeRate, &This->filter.csFilter); @@ -586,7 +586,7 @@ static DWORD WINAPI QTSplitter_thread(LPVOID data) tStop = time * 10000000;
/* Deliver Audio */ - if (This->pAudio_Pin && This->pAudio_Pin->pin.pin.pConnectedTo && This->aSession) + if (This->pAudio_Pin && This->pAudio_Pin->pin.pin.peer && This->aSession) { int data_size=0; BYTE* ptr; @@ -802,10 +802,10 @@ static const IBaseFilterVtbl QT_Vtbl = {
static void free_source_pin(QTOutPin *pin) { - if (pin->pin.pin.pConnectedTo) + if (pin->pin.pin.peer) { if (SUCCEEDED(IMemAllocator_Decommit(pin->pin.pAllocator))) - IPin_Disconnect(pin->pin.pin.pConnectedTo); + IPin_Disconnect(pin->pin.pin.peer); IPin_Disconnect(&pin->pin.pin.IPin_iface); }
@@ -1064,7 +1064,7 @@ static HRESULT WINAPI QTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, EnterCriticalSection(&filter->filter.csFilter); This->pReader = NULL;
- if (This->pin.pConnectedTo) + if (This->pin.peer) hr = VFW_E_ALREADY_CONNECTED; else if (IPin_QueryAccept(iface, pmt) != S_OK) hr = VFW_E_TYPE_NOT_ACCEPTED; @@ -1122,7 +1122,7 @@ static HRESULT WINAPI QTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, if (SUCCEEDED(hr)) { CopyMediaType(&This->pin.mtCurrent, pmt); - This->pin.pConnectedTo = pReceivePin; + This->pin.peer = pReceivePin; IPin_AddRef(pReceivePin); hr = IMemAllocator_Commit(This->pAlloc); } @@ -1152,16 +1152,16 @@ static HRESULT WINAPI QTInPin_Disconnect(IPin *iface)
hr = IBaseFilter_GetState(&filter->filter.IBaseFilter_iface, INFINITE, &state); EnterCriticalSection(&filter->filter.csFilter); - if (This->pin.pConnectedTo) + if (This->pin.peer) { QTSplitter *Parser = impl_from_strmbase_filter(This->pin.filter);
if (SUCCEEDED(hr) && state == State_Stopped) { IMemAllocator_Decommit(This->pAlloc); - IPin_Disconnect(This->pin.pConnectedTo); - IPin_Release(This->pin.pConnectedTo); - This->pin.pConnectedTo = NULL; + IPin_Disconnect(This->pin.peer); + IPin_Release(This->pin.peer); + This->pin.peer = NULL; hr = QT_RemoveOutputPins(Parser); } else diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 85c5486f6b4..6a358decfc7 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -34,7 +34,7 @@ struct strmbase_pin struct strmbase_filter *filter; PIN_DIRECTION dir; WCHAR name[128]; - IPin *pConnectedTo; + IPin *peer; AM_MEDIA_TYPE mtCurrent; REFERENCE_TIME tStart, tStop; double dRate;