Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50668 Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/unixlib.h | 2 +- dlls/winegstreamer/wg_parser.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 90101893541..82bb534b938 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -63,7 +63,7 @@ struct wg_format
WG_VIDEO_FORMAT_CINEPAK, } format; - uint32_t width, height; + int32_t width, height; uint32_t fps_n, fps_d; } video; struct diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index c3c9051a174..0178538fa81 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -450,7 +450,7 @@ static GstCaps *wg_format_to_caps_video(const struct wg_format *format) if ((video_format = wg_video_format_to_gst(format->u.video.format)) == GST_VIDEO_FORMAT_UNKNOWN) return NULL;
- gst_video_info_set_format(&info, video_format, format->u.video.width, format->u.video.height); + gst_video_info_set_format(&info, video_format, format->u.video.width, abs(format->u.video.height)); if ((caps = gst_video_info_to_caps(&info))) { /* Clear some fields that shouldn't prevent us from connecting. */ @@ -497,7 +497,7 @@ static bool wg_format_compare(const struct wg_format *a, const struct wg_format /* Do not compare FPS. */ return a->u.video.format == b->u.video.format && a->u.video.width == b->u.video.width - && a->u.video.height == b->u.video.height; + && abs(a->u.video.height) == abs(b->u.video.height); }
assert(0); @@ -611,6 +611,8 @@ static NTSTATUS wg_parser_stream_enable(void *args)
if (format->major_type == WG_MAJOR_TYPE_VIDEO) { + bool flip = (format->u.video.height < 0); + switch (format->u.video.format) { case WG_VIDEO_FORMAT_BGRA: @@ -618,7 +620,7 @@ static NTSTATUS wg_parser_stream_enable(void *args) case WG_VIDEO_FORMAT_BGR: case WG_VIDEO_FORMAT_RGB15: case WG_VIDEO_FORMAT_RGB16: - gst_util_set_object_arg(G_OBJECT(stream->flip), "method", "vertical-flip"); + flip = !flip; break;
case WG_VIDEO_FORMAT_AYUV: @@ -630,9 +632,10 @@ static NTSTATUS wg_parser_stream_enable(void *args) case WG_VIDEO_FORMAT_YVYU: case WG_VIDEO_FORMAT_UNKNOWN: case WG_VIDEO_FORMAT_CINEPAK: - gst_util_set_object_arg(G_OBJECT(stream->flip), "method", "none"); break; } + + gst_util_set_object_arg(G_OBJECT(stream->flip), "method", flip ? "vertical-flip" : "none"); }
gst_pad_push_event(stream->my_sink, gst_event_new_reconfigure());
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/qcap/avimux.c | 7 +++++-- dlls/qcap/tests/avimux.c | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index c3dbf71d2da..fe4add83b7c 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -1110,9 +1110,12 @@ static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, vo return S_OK; }
-static HRESULT source_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) +static HRESULT source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) { - FIXME("(%p) stub\n", base); + if (!IsEqualGUID(&mt->majortype, &GUID_NULL) && !IsEqualGUID(&mt->majortype, &MEDIATYPE_Stream)) + return S_FALSE; + if (!IsEqualGUID(&mt->subtype, &GUID_NULL) && !IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_Avi)) + return S_FALSE; return S_OK; }
diff --git a/dlls/qcap/tests/avimux.c b/dlls/qcap/tests/avimux.c index 3f43ff569cf..70575281cee 100644 --- a/dlls/qcap/tests/avimux.c +++ b/dlls/qcap/tests/avimux.c @@ -468,6 +468,7 @@ static void test_media_types(void) pmt->bFixedSizeSamples = FALSE; pmt->bTemporalCompression = TRUE; pmt->lSampleSize = 123; + pmt->formattype = FORMAT_VideoInfo; hr = IPin_QueryAccept(pin, pmt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -476,7 +477,7 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#x.\n", hr); pmt->majortype = MEDIATYPE_Video; hr = IPin_QueryAccept(pin, pmt); - todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); pmt->majortype = MEDIATYPE_Stream;
pmt->subtype = GUID_NULL; @@ -484,7 +485,7 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#x.\n", hr); pmt->subtype = MEDIASUBTYPE_RGB8; hr = IPin_QueryAccept(pin, pmt); - todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); pmt->subtype = MEDIASUBTYPE_Avi;
CoTaskMemFree(pmt);
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/quartz/tests/avidec.c | 22 +++++++++++++--------- dlls/quartz/tests/avisplit.c | 16 +++++++--------- dlls/quartz/tests/mpegsplit.c | 24 ++++++++++++++---------- 3 files changed, 34 insertions(+), 28 deletions(-)
diff --git a/dlls/quartz/tests/avidec.c b/dlls/quartz/tests/avidec.c index 71f974806ea..10aa9711982 100644 --- a/dlls/quartz/tests/avidec.c +++ b/dlls/quartz/tests/avidec.c @@ -854,14 +854,6 @@ static HRESULT testsink_query_interface(struct strmbase_pin *iface, REFIID iid, return S_OK; }
-static HRESULT testsink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) -{ - struct testfilter *filter = impl_from_strmbase_filter(iface->filter); - if (filter->mt && !compare_media_types(mt, filter->mt)) - return S_FALSE; - return S_OK; -} - static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt) { struct testfilter *filter = impl_from_strmbase_filter(iface->filter); @@ -873,6 +865,14 @@ static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int return VFW_S_NO_MORE_ITEMS; }
+static HRESULT testsink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + if (filter->mt && !IsEqualGUID(&mt->majortype, &filter->mt->majortype)) + return VFW_E_TYPE_NOT_ACCEPTED; + return S_OK; +} + static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample *sample) { struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); @@ -958,8 +958,8 @@ static HRESULT testsink_end_flush(struct strmbase_sink *iface) static const struct strmbase_sink_ops testsink_ops = { .base.pin_query_interface = testsink_query_interface, - .base.pin_query_accept = testsink_query_accept, .base.pin_get_media_type = testsink_get_media_type, + .sink_connect = testsink_connect, .pfnReceive = testsink_Receive, .sink_new_segment = testsink_new_segment, .sink_eos = testsink_eos, @@ -1501,6 +1501,8 @@ static void test_connect_pin(void) hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
+ /* Test enumeration of sink media types. */ + /* Our sink's proposed media type is sort of broken, but Windows 8+ returns * VFW_E_INVALIDMEDIATYPE for even perfectly reasonable ones. */ testsink.mt = &req_mt; @@ -1511,8 +1513,10 @@ static void test_connect_pin(void) req_mt.majortype = MEDIATYPE_Video; req_mt.subtype = MEDIASUBTYPE_I420; req_mt.formattype = FORMAT_VideoInfo; + req_mt.lSampleSize = 444; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n");
hr = IFilterGraph2_Disconnect(graph, sink); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index 80ee6607279..47f20b70d61 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -894,14 +894,6 @@ static HRESULT testsink_query_interface(struct strmbase_pin *iface, REFIID iid, return S_OK; }
-static HRESULT testsink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) -{ - struct testfilter *filter = impl_from_strmbase_filter(iface->filter); - if (filter->mt && !compare_media_types(mt, filter->mt)) - return S_FALSE; - return S_OK; -} - static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt) { struct testfilter *filter = impl_from_strmbase_filter(iface->filter); @@ -915,6 +907,7 @@ static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int
static HRESULT testsink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt) { + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); AM_MEDIA_TYPE mt2; IPin *peer2; HRESULT hr; @@ -929,6 +922,8 @@ static HRESULT testsink_connect(struct strmbase_sink *iface, IPin *peer, const A ok(compare_media_types(mt, &mt2), "Media types didn't match.\n"); FreeMediaType(&mt2);
+ if (filter->mt && !IsEqualGUID(&mt->majortype, &filter->mt->majortype)) + return VFW_E_TYPE_NOT_ACCEPTED; return S_OK; }
@@ -993,7 +988,6 @@ static HRESULT testsink_new_segment(struct strmbase_sink *iface, static const struct strmbase_sink_ops testsink_ops = { .base.pin_query_interface = testsink_query_interface, - .base.pin_query_accept = testsink_query_accept, .base.pin_get_media_type = testsink_get_media_type, .sink_connect = testsink_connect, .pfnReceive = testsink_Receive, @@ -1359,6 +1353,8 @@ static void test_connect_pin(void) hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
+ /* Test enumeration of sink media types. */ + testsink.mt = &req_mt; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); @@ -1366,8 +1362,10 @@ static void test_connect_pin(void) req_mt.majortype = MEDIATYPE_Video; req_mt.subtype = MEDIASUBTYPE_I420; req_mt.formattype = FORMAT_VideoInfo; + req_mt.lSampleSize = 444; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n");
IPin_Release(source); hr = IFilterGraph2_Disconnect(graph, sink); diff --git a/dlls/quartz/tests/mpegsplit.c b/dlls/quartz/tests/mpegsplit.c index 9c0c34d6c9c..0809c5f861f 100644 --- a/dlls/quartz/tests/mpegsplit.c +++ b/dlls/quartz/tests/mpegsplit.c @@ -1183,14 +1183,6 @@ static HRESULT testsink_query_interface(struct strmbase_pin *iface, REFIID iid, return S_OK; }
-static HRESULT testsink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) -{ - struct testfilter *filter = impl_from_strmbase_filter(iface->filter); - if (filter->mt && !compare_media_types(mt, filter->mt)) - return S_FALSE; - return S_OK; -} - static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt) { struct testfilter *filter = impl_from_strmbase_filter(iface->filter); @@ -1202,6 +1194,14 @@ static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int return VFW_S_NO_MORE_ITEMS; }
+static HRESULT testsink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + if (filter->mt && !IsEqualGUID(&mt->majortype, &filter->mt->majortype)) + return VFW_E_TYPE_NOT_ACCEPTED; + return S_OK; +} + static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample *sample) { struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); @@ -1263,8 +1263,8 @@ static HRESULT testsink_new_segment(struct strmbase_sink *iface, static const struct strmbase_sink_ops testsink_ops = { .base.pin_query_interface = testsink_query_interface, - .base.pin_query_accept = testsink_query_accept, .base.pin_get_media_type = testsink_get_media_type, + .sink_connect = testsink_connect, .pfnReceive = testsink_Receive, .sink_eos = testsink_eos, .sink_new_segment = testsink_new_segment, @@ -1576,6 +1576,8 @@ static void test_connect_pin(void) hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
+ /* Test enumeration of sink media types. */ + testsink.mt = &req_mt; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); @@ -1583,8 +1585,10 @@ static void test_connect_pin(void) req_mt.majortype = MEDIATYPE_Audio; req_mt.subtype = MEDIASUBTYPE_MPEG1AudioPayload; req_mt.formattype = FORMAT_WaveFormatEx; + req_mt.lSampleSize = 444; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n");
IPin_Release(source); hr = IFilterGraph2_Disconnect(graph, sink);
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/qcap/tests/smartteefilter.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index 6842fccb863..c8a66f1370a 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -757,14 +757,6 @@ static HRESULT testsink_query_interface(struct strmbase_pin *iface, REFIID iid, return S_OK; }
-static HRESULT testsink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) -{ - struct testfilter *filter = impl_from_strmbase_filter(iface->filter); - if (filter->sink_mt && !compare_media_types(mt, filter->sink_mt)) - return S_FALSE; - return S_OK; -} - static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt) { struct testfilter *filter = impl_from_strmbase_filter(iface->filter); @@ -776,6 +768,14 @@ static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int return VFW_S_NO_MORE_ITEMS; }
+static HRESULT testsink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + if (filter->sink_mt && !IsEqualGUID(&mt->majortype, &filter->sink_mt->majortype)) + return VFW_E_TYPE_NOT_ACCEPTED; + return S_OK; +} + static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample *sample) { struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); @@ -866,8 +866,8 @@ static HRESULT testsink_end_flush(struct strmbase_sink *iface) static const struct strmbase_sink_ops testsink_ops = { .base.pin_query_interface = testsink_query_interface, - .base.pin_query_accept = testsink_query_accept, .base.pin_get_media_type = testsink_get_media_type, + .sink_connect = testsink_connect, .pfnReceive = testsink_Receive, .sink_new_segment = testsink_new_segment, .sink_eos = testsink_eos, @@ -1080,6 +1080,8 @@ static void test_source_connection(AM_MEDIA_TYPE req_mt, IFilterGraph2 *graph, hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
+ /* Test enumeration of sink media types. */ + testsink->sink_mt = &req_mt; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, NULL); todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); @@ -1093,7 +1095,7 @@ static void test_source_connection(AM_MEDIA_TYPE req_mt, IFilterGraph2 *graph, req_mt.lSampleSize = 3; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(compare_media_types(&testsink->sink.pin.mt, &req_mt), "Media types didn't match.\n"); + todo_wine ok(compare_media_types(&testsink->sink.pin.mt, &req_mt), "Media types didn't match.\n"); IFilterGraph2_Disconnect(graph, source); IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface);
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/qedit/tests/samplegrabber.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index 6a58d5ea7e6..4c930e0c87a 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -712,14 +712,6 @@ static HRESULT testsink_query_interface(struct strmbase_pin *iface, REFIID iid, return S_OK; }
-static HRESULT testsink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) -{ - struct testfilter *filter = impl_from_strmbase_filter(iface->filter); - if (filter->sink_mt && !compare_media_types(mt, filter->sink_mt)) - return S_FALSE; - return S_OK; -} - static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt) { struct testfilter *filter = impl_from_strmbase_filter(iface->filter); @@ -731,6 +723,14 @@ static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int return VFW_S_NO_MORE_ITEMS; }
+static HRESULT testsink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + if (filter->sink_mt && !IsEqualGUID(&mt->majortype, &filter->sink_mt->majortype)) + return VFW_E_TYPE_NOT_ACCEPTED; + return S_OK; +} + static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample *sample) { struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); @@ -807,8 +807,8 @@ static HRESULT testsink_end_flush(struct strmbase_sink *iface) static const struct strmbase_sink_ops testsink_ops = { .base.pin_query_interface = testsink_query_interface, - .base.pin_query_accept = testsink_query_accept, .base.pin_get_media_type = testsink_get_media_type, + .sink_connect = testsink_connect, .pfnReceive = testsink_Receive, .sink_new_segment = testsink_new_segment, .sink_eos = testsink_eos, @@ -1248,15 +1248,20 @@ static void test_connect_pin(void) ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); req_mt.formattype = GUID_NULL;
+ /* Test enumeration of sink media types. */ + testsink.sink_mt = &req_mt; + req_mt.majortype = MEDIATYPE_Audio; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); + req_mt.majortype = GUID_NULL;
req_mt.bTemporalCompression = TRUE; + req_mt.lSampleSize = 444; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); - ok(compare_media_types(&testsource.source.pin.mt, &testsink.sink.pin.mt), "Media types didn't match.\n"); + todo_wine ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsource.source.pin.mt, &testsource.source_mt), "Media types didn't match.\n");
hr = IPin_EnumMediaTypes(sink, &enummt); ok(hr == S_OK, "Got hr %#x.\n", hr);
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50668 Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/qcap/tests/smartteefilter.c | 2 +- dlls/qedit/tests/samplegrabber.c | 4 ++-- dlls/quartz/tests/avidec.c | 2 +- dlls/quartz/tests/avisplit.c | 2 +- libs/strmbase/pin.c | 32 ++++++++++++++++---------------- 5 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index c8a66f1370a..b6ba3ca75c9 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -1095,7 +1095,7 @@ static void test_source_connection(AM_MEDIA_TYPE req_mt, IFilterGraph2 *graph, req_mt.lSampleSize = 3; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(compare_media_types(&testsink->sink.pin.mt, &req_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsink->sink.pin.mt, &req_mt), "Media types didn't match.\n"); IFilterGraph2_Disconnect(graph, source); IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface);
diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index 4c930e0c87a..13ec04cdc1c 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -1260,8 +1260,8 @@ static void test_connect_pin(void) req_mt.lSampleSize = 444; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); - ok(compare_media_types(&testsource.source.pin.mt, &testsource.source_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsource.source.pin.mt, &testsink.sink.pin.mt), "Media types didn't match.\n");
hr = IPin_EnumMediaTypes(sink, &enummt); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/tests/avidec.c b/dlls/quartz/tests/avidec.c index 10aa9711982..ac1078bf59b 100644 --- a/dlls/quartz/tests/avidec.c +++ b/dlls/quartz/tests/avidec.c @@ -1516,7 +1516,7 @@ static void test_connect_pin(void) req_mt.lSampleSize = 444; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n");
hr = IFilterGraph2_Disconnect(graph, sink); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index 47f20b70d61..06c2f5fed3c 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -1365,7 +1365,7 @@ static void test_connect_pin(void) req_mt.lSampleSize = 444; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n");
IPin_Release(source); hr = IFilterGraph2_Disconnect(graph, sink); diff --git a/libs/strmbase/pin.c b/libs/strmbase/pin.c index efce0155a9e..36b3fdf1425 100644 --- a/libs/strmbase/pin.c +++ b/libs/strmbase/pin.c @@ -516,22 +516,6 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP return hr; }
- if (pin->pFuncsTable->base.pin_get_media_type) - { - for (i = 0; pin->pFuncsTable->base.pin_get_media_type(&pin->pin, i, &candidate) == S_OK; ++i) - { - strmbase_dump_media_type(&candidate); - if (compare_media_types(mt, &candidate) - && pin->pFuncsTable->pfnAttemptConnection(pin, peer, &candidate) == S_OK) - { - LeaveCriticalSection(&pin->pin.filter->filter_cs); - FreeMediaType(&candidate); - return S_OK; - } - FreeMediaType(&candidate); - } - } - if (SUCCEEDED(IPin_EnumMediaTypes(peer, &enummt))) { while (IEnumMediaTypes_Next(enummt, 1, &candidate_ptr, &count) == S_OK) @@ -550,6 +534,22 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP IEnumMediaTypes_Release(enummt); }
+ if (pin->pFuncsTable->base.pin_get_media_type) + { + for (i = 0; pin->pFuncsTable->base.pin_get_media_type(&pin->pin, i, &candidate) == S_OK; ++i) + { + strmbase_dump_media_type(&candidate); + if (compare_media_types(mt, &candidate) + && pin->pFuncsTable->pfnAttemptConnection(pin, peer, &candidate) == S_OK) + { + LeaveCriticalSection(&pin->pin.filter->filter_cs); + FreeMediaType(&candidate); + return S_OK; + } + FreeMediaType(&candidate); + } + } + LeaveCriticalSection(&pin->pin.filter->filter_cs);
return VFW_E_NO_ACCEPTABLE_TYPES;