Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/acmwrapper.c | 7 +++++-- dlls/quartz/avidec.c | 9 +++++++-- 2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/quartz/acmwrapper.c b/dlls/quartz/acmwrapper.c index 6df04595bb5..23ad235327a 100644 --- a/dlls/quartz/acmwrapper.c +++ b/dlls/quartz/acmwrapper.c @@ -500,8 +500,10 @@ static void acm_wrapper_destroy(struct strmbase_filter *iface) static HRESULT acm_wrapper_init_stream(struct strmbase_filter *iface) { struct acm_wrapper *filter = impl_from_strmbase_filter(iface); + HRESULT hr;
- BaseOutputPinImpl_Active(&filter->source); + if (filter->source.pin.peer && FAILED(hr = IMemAllocator_Commit(filter->source.pAllocator))) + ERR("Failed to commit allocator, hr %#x.\n", hr); return S_OK; }
@@ -509,7 +511,8 @@ static HRESULT acm_wrapper_cleanup_stream(struct strmbase_filter *iface) { struct acm_wrapper *filter = impl_from_strmbase_filter(iface);
- BaseOutputPinImpl_Inactive(&filter->source); + if (filter->source.pin.peer) + IMemAllocator_Decommit(filter->source.pAllocator); return S_OK; }
diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c index ada3a1c7e62..ef232673e56 100644 --- a/dlls/quartz/avidec.c +++ b/dlls/quartz/avidec.c @@ -564,6 +564,7 @@ static HRESULT avi_decompressor_init_stream(struct strmbase_filter *iface) struct avi_decompressor *filter = impl_from_strmbase_filter(iface); VIDEOINFOHEADER *source_format; LRESULT res; + HRESULT hr;
filter->late = -1;
@@ -574,7 +575,9 @@ static HRESULT avi_decompressor_init_stream(struct strmbase_filter *iface) return E_FAIL; }
- BaseOutputPinImpl_Active(&filter->source); + if (filter->source.pin.peer && FAILED(hr = IMemAllocator_Commit(filter->source.pAllocator))) + ERR("Failed to commit allocator, hr %#x.\n", hr); + return S_OK; }
@@ -589,7 +592,9 @@ static HRESULT avi_decompressor_cleanup_stream(struct strmbase_filter *iface) return E_FAIL; }
- BaseOutputPinImpl_Inactive(&filter->source); + if (filter->source.pin.peer) + IMemAllocator_Decommit(filter->source.pAllocator); + return S_OK; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/amstream/tests/amstream.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index c5fd5abe620..676b5d4f386 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -1007,9 +1007,13 @@ static void testfilter_destroy(struct strmbase_filter *iface) static HRESULT testfilter_init_stream(struct strmbase_filter *iface) { struct testfilter *filter = impl_from_BaseFilter(iface); + HRESULT hr;
- if (SUCCEEDED(filter->init_stream_hr)) - BaseOutputPinImpl_Active(&filter->source); + if (SUCCEEDED(filter->init_stream_hr) && filter->source.pin.peer) + { + hr = IMemAllocator_Commit(filter->source.pAllocator); + ok(hr == S_OK, "Got hr %#x.\n", hr); + }
return filter->init_stream_hr; } @@ -1017,9 +1021,13 @@ static HRESULT testfilter_init_stream(struct strmbase_filter *iface) static HRESULT testfilter_cleanup_stream(struct strmbase_filter *iface) { struct testfilter *filter = impl_from_BaseFilter(iface); + HRESULT hr;
- if (SUCCEEDED(filter->cleanup_stream_hr)) - BaseOutputPinImpl_Inactive(&filter->source); + if (SUCCEEDED(filter->cleanup_stream_hr) && filter->source.pin.peer) + { + hr = IMemAllocator_Decommit(filter->source.pAllocator); + ok(hr == S_OK, "Got hr %#x.\n", hr); + }
return filter->cleanup_stream_hr; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/pin.c | 40 ---------------------------------------- include/wine/strmbase.h | 2 -- 2 files changed, 42 deletions(-)
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index e5017c2ff98..406fba4165d 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -702,46 +702,6 @@ HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *This, return hr; }
-/* replaces OutputPin_CommitAllocator */ -HRESULT WINAPI BaseOutputPinImpl_Active(struct strmbase_source *This) -{ - HRESULT hr; - - TRACE("(%p)->()\n", This); - - EnterCriticalSection(&This->pin.filter->csFilter); - { - if (!This->pin.peer || !This->pMemInputPin) - hr = VFW_E_NOT_CONNECTED; - else - hr = IMemAllocator_Commit(This->pAllocator); - } - LeaveCriticalSection(&This->pin.filter->csFilter); - - TRACE("--> %08x\n", hr); - return hr; -} - -/* replaces OutputPin_DecommitAllocator */ -HRESULT WINAPI BaseOutputPinImpl_Inactive(struct strmbase_source *This) -{ - HRESULT hr; - - TRACE("(%p)->()\n", This); - - EnterCriticalSection(&This->pin.filter->csFilter); - { - if (!This->pin.peer || !This->pMemInputPin) - hr = VFW_E_NOT_CONNECTED; - else - hr = IMemAllocator_Decommit(This->pAllocator); - } - LeaveCriticalSection(&This->pin.filter->csFilter); - - TRACE("--> %08x\n", hr); - return hr; -} - HRESULT WINAPI BaseOutputPinImpl_InitAllocator(struct strmbase_source *This, IMemAllocator **pMemAlloc) { return CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (LPVOID*)pMemAlloc); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 24bb97702b5..39c556193ac 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -110,8 +110,6 @@ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *pin, IMediaSample **sample, REFERENCE_TIME *start, REFERENCE_TIME *stop, DWORD flags); -HRESULT WINAPI BaseOutputPinImpl_Active(struct strmbase_source *pin); -HRESULT WINAPI BaseOutputPinImpl_Inactive(struct strmbase_source *pin); HRESULT WINAPI BaseOutputPinImpl_InitAllocator(struct strmbase_source *pin, IMemAllocator **allocator); HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(struct strmbase_source *pin, IMemInputPin *peer, IMemAllocator **allocator); HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt);
Hi,
While running your changed tests, 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=82017
Your paranoid android.
=== debiant (64 bit WoW report) ===
quartz: dsoundrender.c:807: Test failed: Got hr 0x103.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avico.c | 1 - dlls/qcap/avimux.c | 1 - dlls/quartz/acmwrapper.c | 1 - dlls/quartz/avidec.c | 1 - dlls/quartz/dsoundrender.c | 1 - dlls/strmbase/pin.c | 5 ----- include/wine/strmbase.h | 2 -- 7 files changed, 12 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 7b3c1ea3697..01a43c9577d 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -410,7 +410,6 @@ static void sink_disconnect(struct strmbase_sink *iface) static const struct strmbase_sink_ops sink_ops = { .base.pin_query_accept = sink_query_accept, - .base.pin_get_media_type = strmbase_pin_get_media_type, .base.pin_query_interface = sink_query_interface, .pfnReceive = AVICompressorIn_Receive, .sink_connect = sink_connect, diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 3f4d0f2cd6e..7ae2d673676 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -1475,7 +1475,6 @@ static const struct strmbase_sink_ops sink_ops = { .base.pin_query_interface = sink_query_interface, .base.pin_query_accept = sink_query_accept, - .base.pin_get_media_type = strmbase_pin_get_media_type, .pfnReceive = AviMuxIn_Receive, .sink_connect = avi_mux_sink_connect, .sink_disconnect = avi_mux_sink_disconnect, diff --git a/dlls/quartz/acmwrapper.c b/dlls/quartz/acmwrapper.c index 23ad235327a..ada8c474640 100644 --- a/dlls/quartz/acmwrapper.c +++ b/dlls/quartz/acmwrapper.c @@ -324,7 +324,6 @@ static const struct strmbase_sink_ops sink_ops = { .base.pin_query_interface = acm_wrapper_sink_query_interface, .base.pin_query_accept = acm_wrapper_sink_query_accept, - .base.pin_get_media_type = strmbase_pin_get_media_type, .pfnReceive = acm_wrapper_sink_Receive, .sink_connect = acm_wrapper_sink_connect, .sink_disconnect = acm_wrapper_sink_disconnect, diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c index ef232673e56..72f69ef7c5a 100644 --- a/dlls/quartz/avidec.c +++ b/dlls/quartz/avidec.c @@ -287,7 +287,6 @@ static const struct strmbase_sink_ops sink_ops = { .base.pin_query_interface = avi_decompressor_sink_query_interface, .base.pin_query_accept = avi_decompressor_sink_query_accept, - .base.pin_get_media_type = strmbase_pin_get_media_type, .pfnReceive = avi_decompressor_sink_Receive, .sink_connect = avi_decompressor_sink_connect, .sink_disconnect = avi_decompressor_sink_disconnect, diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 974d1e1dee0..a444297f568 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -586,7 +586,6 @@ static const struct strmbase_sink_ops sink_ops = { .base.pin_query_interface = dsound_render_sink_query_interface, .base.pin_query_accept = dsound_render_sink_query_accept, - .base.pin_get_media_type = strmbase_pin_get_media_type, .pfnReceive = dsound_render_sink_Receive, .sink_connect = dsound_render_sink_connect, .sink_disconnect = dsound_render_sink_disconnect, diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 406fba4165d..c08f04730e7 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -265,11 +265,6 @@ static HRESULT SendFurther(struct strmbase_sink *sink, SendPinFunc func, void *a return hr; }
-HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt) -{ - return VFW_S_NO_MORE_ITEMS; -} - static HRESULT WINAPI pin_QueryInterface(IPin *iface, REFIID iid, void **out) { struct strmbase_pin *pin = impl_from_IPin(iface); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 39c556193ac..5bd181746a1 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -106,8 +106,6 @@ struct strmbase_sink_ops };
/* Base Pin */ -HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt); - HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *pin, IMediaSample **sample, REFERENCE_TIME *start, REFERENCE_TIME *stop, DWORD flags); HRESULT WINAPI BaseOutputPinImpl_InitAllocator(struct strmbase_source *pin, IMemAllocator **allocator);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr7.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 1101a98ab7d..0a72cbb9b74 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -1300,11 +1300,8 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input, ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); - if (0) /* FIXME: Rendering is currently broken on Wine. */ - { - for (i = 0; i < 32 * 16; ++i) - ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); - } + for (i = 0; i < 32 * 16; ++i) + ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i);
hr = IMediaControl_Run(control); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -1316,11 +1313,8 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input, ok(hr == S_OK, "Got hr %#x.\n", hr); ok(size == sizeof(buffer), "Got size %d.\n", size); ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n"); - if (0) /* FIXME: Rendering is currently broken on Wine. */ - { - for (i = 0; i < 32 * 16; ++i) - ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i); - } + for (i = 0; i < 32 * 16; ++i) + ok((data[i] & 0xffffff) == 0x555555, "Got unexpected color %08x at %u.\n", data[i], i);
hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr);
Hi,
While running your changed tests, 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=82019
Your paranoid android.
=== w10pro64_ar (64 bit report) ===
quartz: vmr7.c:2102: Test failed: Got unexpected status 0. vmr7.c:2105: Test failed: Wait timed out. vmr7.c:2113: Test failed: Got unexpected status 0x400040.
=== w10pro64_ja (64 bit report) ===
quartz: vmr7.c:1185: Test failed: Got hr 0x40237. vmr7.c:1191: Test failed: Got hr 0x1.