From 7b32c6a57ff4986f4bfca191f73c6d4292257ad4 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 28 Sep 2020 12:38:14 +1000 Subject: [PATCH] Updated mfplat-streaming-support patchset --- ...d-a-GstPad-wrapping-the-media-source.patch | 148 +++---- ...e-decodebin-to-initialize-media-stre.patch | 187 ++++---- ...plement-IMFMediaStream-GetStreamDesc.patch | 404 +++++------------- ...sert-parser-into-pipeline-to-rectify.patch | 117 ++++- ...sert-videoconvert-into-decoded-video.patch | 54 ++- ...sert-audioconvert-into-decoded-audio.patch | 8 +- ...r-Translate-H.264-caps-to-attributes.patch | 53 ++- ...mer-Translate-WMV-caps-to-attributes.patch | 16 +- ...mer-Translate-AAC-caps-to-attributes.patch | 12 +- ...anslate-MPEG-4-Section-2-caps-to-att.patch | 9 +- ...mer-Translate-WMA-caps-to-attributes.patch | 8 +- ...plement-IMFMediaSource-CreatePresent.patch | 24 +- ...troduce-IMFMediaType-GstCaps-convert.patch | 23 +- ...r-Translate-H.264-attributes-to-caps.patch | 8 +- ...mer-Translate-WMV-attributes-to-caps.patch | 10 +- ...mer-Translate-AAC-attributes-to-caps.patch | 8 +- ...anslate-MPEG-4-Section-2-attributes-.patch | 9 +- ...mer-Translate-WMA-attributes-to-caps.patch | 8 +- ...eamer-Implement-IMFMediaSource-Start.patch | 42 +- ...plement-IMFMediaStream-RequestSample.patch | 36 +- ...plement-IMFMediaSource-GetCharacteri.patch | 9 +- ...lculate-the-MF_PD_DURATION-of-the-me.patch | 10 +- ...port-for-multiple-parent-directories.patch | 8 +- .../0024-mf-Introduce-handler-helper.patch | 31 +- ...roduce-IMFSample-GstBuffer-converter.patch | 20 +- ...r-Implement-decoder-MFT-on-gstreamer.patch | 48 +-- ...ct-all-streams-when-creating-a-sourc.patch | 4 +- .../0028-Miscellaneous.patch | 36 +- .../mfplat-streaming-support/0029-WMV.patch | 8 +- ...samples-from-upstream-node-when-upon.patch | 4 +- ...plement-IMFMedisStream-GetMediaSourc.patch | 9 +- ...xpose-PCM-output-type-on-AAC-decoder.patch | 4 +- ...3-mfplat-Add-I420-format-information.patch | 4 +- ...reamer-Implement-Color-Converter-MFT.patch | 10 +- ...CK-Set-BPS-to-16-for-output-template.patch | 4 +- .../0036-Improve-tests.patch | 4 +- .../0037-Revert-Improve-tests.patch | 4 +- ...ackwards-and-only-select-one-of-each.patch | 16 +- ...reamer-Implement-IMFMediaSource-Stop.patch | 14 +- ...troduce-MPEG-4-Section-2-video-decod.patch | 9 +- ...een-all-selection-streams-on-MF_SOUR.patch | 4 +- ...streamer-Introduce-WMA-audio-decoder.patch | 8 +- .../0043-Support-stereo-down-folding.patch | 4 +- ...negstreamer-Implement-MF_SD_LANGUAGE.patch | 10 +- ...ader-Add-a-structure-for-iterative-b.patch | 10 +- ...ader-Clone-source-nodes-as-a-first-l.patch | 6 +- ...ader-Switch-to-public-interface-for-.patch | 6 +- ...tially-implement-the-topology-loader.patch | 10 +- ...laneous-fixes-to-topology-resolution.patch | 4 +- .../0050-Rewrite-branch-resolver.patch | 4 +- ...gainst-native-media-type-in-IsMediaT.patch | 4 +- ...eamer-Implement-audio-conversion-MFT.patch | 12 +- ...winegstreamer-Support-older-versions.patch | 18 +- patches/mfplat-streaming-support/definition | 1 - patches/patchinstall.sh | 76 ++++ 55 files changed, 795 insertions(+), 822 deletions(-) diff --git a/patches/mfplat-streaming-support/0001-winegstreamer-Add-a-GstPad-wrapping-the-media-source.patch b/patches/mfplat-streaming-support/0001-winegstreamer-Add-a-GstPad-wrapping-the-media-source.patch index 07e36e44..ccbda270 100644 --- a/patches/mfplat-streaming-support/0001-winegstreamer-Add-a-GstPad-wrapping-the-media-source.patch +++ b/patches/mfplat-streaming-support/0001-winegstreamer-Add-a-GstPad-wrapping-the-media-source.patch @@ -1,19 +1,19 @@ -From 139b483754aee0188f68109dc593df6eb9e083c4 Mon Sep 17 00:00:00 2001 +From 76ebf639f8c353cba828c0dfb26fdc0e01318098 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Mon, 30 Mar 2020 14:19:35 -0500 -Subject: [PATCH 01/52] winegstreamer: Add a GstPad wrapping the media source's +Subject: [PATCH] winegstreamer: Add a GstPad wrapping the media source's bytestream. Signed-off-by: Derek Lesho --- - dlls/winegstreamer/gst_cbs.c | 58 ++++++++ + dlls/winegstreamer/gst_cbs.c | 58 +++++++++ dlls/winegstreamer/gst_cbs.h | 12 +- dlls/winegstreamer/main.c | 3 + - dlls/winegstreamer/media_source.c | 219 +++++++++++++++++++++++++++++- - 4 files changed, 288 insertions(+), 4 deletions(-) + dlls/winegstreamer/media_source.c | 189 +++++++++++++++++++++++++++++- + 4 files changed, 258 insertions(+), 4 deletions(-) diff --git a/dlls/winegstreamer/gst_cbs.c b/dlls/winegstreamer/gst_cbs.c -index bf7103b1606..8f48368c96a 100644 +index bf7103b1606..12b53bc5d68 100644 --- a/dlls/winegstreamer/gst_cbs.c +++ b/dlls/winegstreamer/gst_cbs.c @@ -49,6 +49,8 @@ static void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user) @@ -30,10 +30,10 @@ index bf7103b1606..8f48368c96a 100644 return cbdata.u.query_sink_data.ret; } + -+GstFlowReturn pull_from_bytestream_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len, ++GstFlowReturn bytestream_wrapper_pull_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len, + GstBuffer **buf) +{ -+ struct cb_data cbdata = { PULL_FROM_BYTESTREAM }; ++ struct cb_data cbdata = { BYTESTREAM_WRAPPER_PULL }; + + cbdata.u.getrange_data.pad = pad; + cbdata.u.getrange_data.parent = parent; @@ -46,9 +46,9 @@ index bf7103b1606..8f48368c96a 100644 + return cbdata.u.getrange_data.ret; +} + -+gboolean query_bytestream_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) ++gboolean bytestream_query_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) +{ -+ struct cb_data cbdata = { QUERY_BYTESTREAM }; ++ struct cb_data cbdata = { BYTESTREAM_QUERY }; + + cbdata.u.query_function_data.pad = pad; + cbdata.u.query_function_data.parent = parent; @@ -59,9 +59,9 @@ index bf7103b1606..8f48368c96a 100644 + return cbdata.u.query_function_data.ret; +} + -+gboolean activate_bytestream_pad_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) ++gboolean bytestream_pad_mode_activate_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) +{ -+ struct cb_data cbdata = { ACTIVATE_BYTESTREAM_PAD_MODE }; ++ struct cb_data cbdata = { BYTESTREAM_PAD_MODE_ACTIVATE }; + + cbdata.u.activate_mode_data.pad = pad; + cbdata.u.activate_mode_data.parent = parent; @@ -73,9 +73,9 @@ index bf7103b1606..8f48368c96a 100644 + return cbdata.u.activate_mode_data.ret; +} + -+gboolean process_bytestream_pad_event_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) ++gboolean bytestream_pad_event_process_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) +{ -+ struct cb_data cbdata = { PROCESS_BYTESTREAM_PAD_EVENT }; ++ struct cb_data cbdata = { BYTESTREAM_PAD_EVENT_PROCESS }; + + cbdata.u.event_src_data.pad = pad; + cbdata.u.event_src_data.parent = parent; @@ -86,7 +86,7 @@ index bf7103b1606..8f48368c96a 100644 + return cbdata.u.event_src_data.ret; +} diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h -index 4725f23ad1a..10e999feea7 100644 +index 4725f23ad1a..3459a9ef8ee 100644 --- a/dlls/winegstreamer/gst_cbs.h +++ b/dlls/winegstreamer/gst_cbs.h @@ -43,7 +43,12 @@ enum CB_TYPE { @@ -95,10 +95,10 @@ index 4725f23ad1a..10e999feea7 100644 QUERY_SINK, - GSTDEMUX_MAX + GSTDEMUX_MAX, -+ PULL_FROM_BYTESTREAM, -+ QUERY_BYTESTREAM, -+ ACTIVATE_BYTESTREAM_PAD_MODE, -+ PROCESS_BYTESTREAM_PAD_EVENT, ++ BYTESTREAM_WRAPPER_PULL, ++ BYTESTREAM_QUERY, ++ BYTESTREAM_PAD_MODE_ACTIVATE, ++ BYTESTREAM_PAD_EVENT_PROCESS, + MEDIA_SOURCE_MAX, }; @@ -115,10 +115,10 @@ index 4725f23ad1a..10e999feea7 100644 void unknown_type_wrapper(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer user) DECLSPEC_HIDDEN; void Gstreamer_transform_pad_added_wrapper(GstElement *filter, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; gboolean query_sink_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN; -+GstFlowReturn pull_from_bytestream_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len, GstBuffer **buf) DECLSPEC_HIDDEN; -+gboolean query_bytestream_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN; -+gboolean activate_bytestream_pad_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN; -+gboolean process_bytestream_pad_event_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) DECLSPEC_HIDDEN; ++GstFlowReturn bytestream_wrapper_pull_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len, GstBuffer **buf) DECLSPEC_HIDDEN; ++gboolean bytestream_query_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN; ++gboolean bytestream_pad_mode_activate_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN; ++gboolean bytestream_pad_event_process_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) DECLSPEC_HIDDEN; #endif diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c @@ -136,10 +136,10 @@ index 2872710b3e2..4ca371d58bd 100644 return hr; diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 84ecf305d4c..6b3bd4a7869 100644 +index f365c8a1827..1accf55c6a2 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -17,7 +17,12 @@ +@@ -17,9 +17,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ @@ -151,8 +151,11 @@ index 84ecf305d4c..6b3bd4a7869 100644 +#include "gst_cbs.h" #include ++#include -@@ -27,6 +32,7 @@ + #define COBJMACROS + #define NONAMELESSUNION +@@ -27,6 +33,7 @@ #include "mfapi.h" #include "mferror.h" #include "mfidl.h" @@ -160,7 +163,7 @@ index 84ecf305d4c..6b3bd4a7869 100644 #include "wine/debug.h" #include "wine/heap.h" -@@ -39,6 +45,8 @@ struct media_source +@@ -39,6 +46,8 @@ struct media_source IMFMediaSource IMFMediaSource_iface; LONG ref; IMFMediaEventQueue *event_queue; @@ -169,11 +172,11 @@ index 84ecf305d4c..6b3bd4a7869 100644 enum { SOURCE_OPENING, -@@ -52,6 +60,154 @@ static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *ifac +@@ -52,6 +61,127 @@ static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *ifac return CONTAINING_RECORD(iface, struct media_source, IMFMediaSource_iface); } -+GstFlowReturn pull_from_bytestream(GstPad *pad, GstObject *parent, guint64 ofs, guint len, ++static GstFlowReturn bytestream_wrapper_pull(GstPad *pad, GstObject *parent, guint64 ofs, guint len, + GstBuffer **buf) +{ + struct media_source *source = gst_pad_get_element_private(pad); @@ -183,7 +186,7 @@ index 84ecf305d4c..6b3bd4a7869 100644 + BOOL is_eof; + HRESULT hr; + -+ TRACE("gstreamer requesting %u bytes at %s from source %p into buffer %p\n", len, wine_dbgstr_longlong(ofs), source, buf); ++ TRACE("requesting %u bytes at %s from source %p into buffer %p\n", len, wine_dbgstr_longlong(ofs), source, *buf); + + if (ofs != GST_BUFFER_OFFSET_NONE) + { @@ -205,14 +208,11 @@ index 84ecf305d4c..6b3bd4a7869 100644 + gst_buffer_set_size(*buf, bytes_read); + + if (FAILED(hr)) -+ { + return GST_FLOW_ERROR; -+ } -+ GST_BUFFER_OFFSET(*buf) = ofs; + return GST_FLOW_OK; +} + -+static gboolean query_bytestream(GstPad *pad, GstObject *parent, GstQuery *query) ++static gboolean bytestream_query(GstPad *pad, GstObject *parent, GstQuery *query) +{ + struct media_source *source = gst_pad_get_element_private(pad); + GstFormat format; @@ -227,16 +227,17 @@ index 84ecf305d4c..6b3bd4a7869 100644 + { + case GST_QUERY_DURATION: + { -+ gst_query_parse_duration (query, &format, NULL); -+ if (format == GST_FORMAT_PERCENT) { -+ gst_query_set_duration (query, GST_FORMAT_PERCENT, GST_FORMAT_PERCENT_MAX); ++ gst_query_parse_duration(query, &format, NULL); ++ if (format == GST_FORMAT_PERCENT) ++ { ++ gst_query_set_duration(query, GST_FORMAT_PERCENT, GST_FORMAT_PERCENT_MAX); + return TRUE; + } + else if (format == GST_FORMAT_BYTES) + { + QWORD length; + IMFByteStream_GetLength(source->byte_stream, &length); -+ gst_query_set_duration (query, GST_FORMAT_BYTES, length); ++ gst_query_set_duration(query, GST_FORMAT_BYTES, length); + return TRUE; + } + return FALSE; @@ -258,25 +259,6 @@ index 84ecf305d4c..6b3bd4a7869 100644 + gst_query_add_scheduling_mode(query, GST_PAD_MODE_PULL); + return TRUE; + } -+ case GST_QUERY_CAPS: -+ { -+ GstStaticCaps any = GST_STATIC_CAPS_ANY; -+ GstCaps *caps, *filter; -+ -+ caps = gst_static_caps_get(&any); -+ gst_query_parse_caps(query, &filter); -+ -+ if (filter) { -+ GstCaps* filtered; -+ filtered = gst_caps_intersect_full( -+ filter, caps, GST_CAPS_INTERSECT_FIRST); -+ gst_caps_unref(caps); -+ caps = filtered; -+ } -+ gst_query_set_caps_result(query, caps); -+ gst_caps_unref(caps); -+ return TRUE; -+ } + default: + { + WARN("Unhandled query type %s\n", GST_QUERY_TYPE_NAME(query)); @@ -285,23 +267,17 @@ index 84ecf305d4c..6b3bd4a7869 100644 + } +} + -+static gboolean activate_bytestream_pad_mode(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) ++static gboolean bytestream_pad_mode_activate(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) +{ + struct media_source *source = gst_pad_get_element_private(pad); + + TRACE("%s source pad for mediasource %p in %s mode.\n", + activate ? "Activating" : "Deactivating", source, gst_pad_mode_get_name(mode)); + -+ switch (mode) { -+ case GST_PAD_MODE_PULL: -+ return TRUE; -+ default: -+ return FALSE; -+ } -+ return FALSE; ++ return mode == GST_PAD_MODE_PULL; +} + -+static gboolean process_bytestream_pad_event(GstPad *pad, GstObject *parent, GstEvent *event) ++static gboolean bytestream_pad_event_process(GstPad *pad, GstObject *parent, GstEvent *event) +{ + struct media_source *source = gst_pad_get_element_private(pad); + @@ -324,7 +300,7 @@ index 84ecf305d4c..6b3bd4a7869 100644 static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID riid, void **out) { struct media_source *source = impl_from_IMFMediaSource(iface); -@@ -211,8 +367,12 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +@@ -211,8 +341,12 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) source->state = SOURCE_SHUTDOWN; @@ -337,15 +313,12 @@ index 84ecf305d4c..6b3bd4a7869 100644 return S_OK; } -@@ -236,19 +396,34 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl = +@@ -236,19 +370,31 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl = static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_source **out_media_source) { -+ GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE( -+ "mf_src", -+ GST_PAD_SRC, -+ GST_PAD_ALWAYS, -+ GST_STATIC_CAPS_ANY); ++ GstStaticPadTemplate src_template = ++ GST_STATIC_PAD_TEMPLATE("mf_src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); + struct media_source *object = heap_alloc_zero(sizeof(*object)); HRESULT hr; @@ -364,10 +337,10 @@ index 84ecf305d4c..6b3bd4a7869 100644 - object->state = SOURCE_STOPPED; + object->my_src = gst_pad_new_from_static_template(&src_template, "mf-src"); + gst_pad_set_element_private(object->my_src, object); -+ gst_pad_set_getrange_function(object->my_src, pull_from_bytestream_wrapper); -+ gst_pad_set_query_function(object->my_src, query_bytestream_wrapper); -+ gst_pad_set_activatemode_function(object->my_src, activate_bytestream_pad_mode_wrapper); -+ gst_pad_set_event_function(object->my_src, process_bytestream_pad_event_wrapper); ++ gst_pad_set_getrange_function(object->my_src, bytestream_wrapper_pull_wrapper); ++ gst_pad_set_query_function(object->my_src, bytestream_query_wrapper); ++ gst_pad_set_activatemode_function(object->my_src, bytestream_pad_mode_activate_wrapper); ++ gst_pad_set_event_function(object->my_src, bytestream_pad_event_process_wrapper); - object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl; - object->ref = 1; @@ -375,7 +348,7 @@ index 84ecf305d4c..6b3bd4a7869 100644 *out_media_source = object; return S_OK; -@@ -717,3 +892,41 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) +@@ -716,3 +862,40 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) return hr; } @@ -385,35 +358,34 @@ index 84ecf305d4c..6b3bd4a7869 100644 +{ + switch(cbdata->type) + { -+ case PULL_FROM_BYTESTREAM: ++ case BYTESTREAM_WRAPPER_PULL: + { + struct getrange_data *data = &cbdata->u.getrange_data; -+ cbdata->u.getrange_data.ret = pull_from_bytestream(data->pad, data->parent, ++ cbdata->u.getrange_data.ret = bytestream_wrapper_pull(data->pad, data->parent, + data->ofs, data->len, data->buf); + break; + } -+ case QUERY_BYTESTREAM: ++ case BYTESTREAM_QUERY: + { + struct query_function_data *data = &cbdata->u.query_function_data; -+ cbdata->u.query_function_data.ret = query_bytestream(data->pad, data->parent, data->query); ++ cbdata->u.query_function_data.ret = bytestream_query(data->pad, data->parent, data->query); + break; + } -+ case ACTIVATE_BYTESTREAM_PAD_MODE: ++ case BYTESTREAM_PAD_MODE_ACTIVATE: + { + struct activate_mode_data *data = &cbdata->u.activate_mode_data; -+ cbdata->u.activate_mode_data.ret = activate_bytestream_pad_mode(data->pad, data->parent, data->mode, data->activate); ++ cbdata->u.activate_mode_data.ret = bytestream_pad_mode_activate(data->pad, data->parent, data->mode, data->activate); + break; + } -+ case PROCESS_BYTESTREAM_PAD_EVENT: ++ case BYTESTREAM_PAD_EVENT_PROCESS: + { + struct event_src_data *data = &cbdata->u.event_src_data; -+ cbdata->u.event_src_data.ret = process_bytestream_pad_event(data->pad, data->parent, data->event); ++ cbdata->u.event_src_data.ret = bytestream_pad_event_process(data->pad, data->parent, data->event); + break; + } + default: + { -+ ERR("Wrong callback forwarder called\n"); -+ return; ++ assert(0); + } + } +} diff --git a/patches/mfplat-streaming-support/0002-winegstreamer-Use-decodebin-to-initialize-media-stre.patch b/patches/mfplat-streaming-support/0002-winegstreamer-Use-decodebin-to-initialize-media-stre.patch index 74604376..46866765 100644 --- a/patches/mfplat-streaming-support/0002-winegstreamer-Use-decodebin-to-initialize-media-stre.patch +++ b/patches/mfplat-streaming-support/0002-winegstreamer-Use-decodebin-to-initialize-media-stre.patch @@ -1,28 +1,27 @@ -From 27ea26494dfa10570c1d2c838660e2169ac9add3 Mon Sep 17 00:00:00 2001 +From 49b2e0568ffe3e5e2ea7e9c3572ec09ef2cf8ad7 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 31 Mar 2020 13:34:57 -0500 -Subject: [PATCH 02/52] winegstreamer: Use decodebin to initialize media - streams. +Subject: [PATCH] winegstreamer: Use decodebin to initialize media streams. Signed-off-by: Derek Lesho --- dlls/winegstreamer/gst_cbs.c | 45 ++++ dlls/winegstreamer/gst_cbs.h | 8 + - dlls/winegstreamer/media_source.c | 416 +++++++++++++++++++++++++++++- - 3 files changed, 468 insertions(+), 1 deletion(-) + dlls/winegstreamer/media_source.c | 405 +++++++++++++++++++++++++++++- + 3 files changed, 457 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/gst_cbs.c b/dlls/winegstreamer/gst_cbs.c -index 8f48368c96a..4755f5b42f1 100644 +index 12b53bc5d68..51aaefa911d 100644 --- a/dlls/winegstreamer/gst_cbs.c +++ b/dlls/winegstreamer/gst_cbs.c -@@ -359,3 +359,48 @@ gboolean process_bytestream_pad_event_wrapper(GstPad *pad, GstObject *parent, Gs +@@ -359,3 +359,48 @@ gboolean bytestream_pad_event_process_wrapper(GstPad *pad, GstObject *parent, Gs return cbdata.u.event_src_data.ret; } + -+GstBusSyncReply watch_source_bus_wrapper(GstBus *bus, GstMessage *message, gpointer user) ++GstBusSyncReply mf_src_bus_watch_wrapper(GstBus *bus, GstMessage *message, gpointer user) +{ -+ struct cb_data cbdata = { WATCH_SOURCE_BUS }; ++ struct cb_data cbdata = { MF_SRC_BUS_WATCH }; + + cbdata.u.watch_bus_data.bus = bus; + cbdata.u.watch_bus_data.msg = message; @@ -33,9 +32,9 @@ index 8f48368c96a..4755f5b42f1 100644 + return cbdata.u.watch_bus_data.ret; +} + -+void source_stream_added_wrapper(GstElement *bin, GstPad *pad, gpointer user) ++void mf_src_stream_added_wrapper(GstElement *bin, GstPad *pad, gpointer user) +{ -+ struct cb_data cbdata = { SOURCE_STREAM_ADDED }; ++ struct cb_data cbdata = { MF_SRC_STREAM_ADDED }; + + cbdata.u.pad_added_data.element = bin; + cbdata.u.pad_added_data.pad = pad; @@ -44,9 +43,9 @@ index 8f48368c96a..4755f5b42f1 100644 + call_cb(&cbdata); +} + -+void source_stream_removed_wrapper(GstElement *element, GstPad *pad, gpointer user) ++void mf_src_stream_removed_wrapper(GstElement *element, GstPad *pad, gpointer user) +{ -+ struct cb_data cbdata = { SOURCE_STREAM_REMOVED }; ++ struct cb_data cbdata = { MF_SRC_STREAM_REMOVED }; + + cbdata.u.pad_removed_data.element = element; + cbdata.u.pad_removed_data.pad = pad; @@ -55,9 +54,9 @@ index 8f48368c96a..4755f5b42f1 100644 + call_cb(&cbdata); +} + -+void source_all_streams_wrapper(GstElement *element, gpointer user) ++void mf_src_no_more_pads_wrapper(GstElement *element, gpointer user) +{ -+ struct cb_data cbdata = { SOURCE_ALL_STREAMS }; ++ struct cb_data cbdata = { MF_SRC_NO_MORE_PADS }; + + cbdata.u.no_more_pads_data.element = element; + cbdata.u.no_more_pads_data.user = user; @@ -65,32 +64,32 @@ index 8f48368c96a..4755f5b42f1 100644 + call_cb(&cbdata); +} diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h -index 10e999feea7..d87cc8c21e9 100644 +index 3459a9ef8ee..a48999bbf71 100644 --- a/dlls/winegstreamer/gst_cbs.h +++ b/dlls/winegstreamer/gst_cbs.h @@ -48,6 +48,10 @@ enum CB_TYPE { - QUERY_BYTESTREAM, - ACTIVATE_BYTESTREAM_PAD_MODE, - PROCESS_BYTESTREAM_PAD_EVENT, -+ WATCH_SOURCE_BUS, -+ SOURCE_STREAM_ADDED, -+ SOURCE_STREAM_REMOVED, -+ SOURCE_ALL_STREAMS, + BYTESTREAM_QUERY, + BYTESTREAM_PAD_MODE_ACTIVATE, + BYTESTREAM_PAD_EVENT_PROCESS, ++ MF_SRC_BUS_WATCH, ++ MF_SRC_STREAM_ADDED, ++ MF_SRC_STREAM_REMOVED, ++ MF_SRC_NO_MORE_PADS, MEDIA_SOURCE_MAX, }; -@@ -164,5 +168,9 @@ GstFlowReturn pull_from_bytestream_wrapper(GstPad *pad, GstObject *parent, guint - gboolean query_bytestream_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN; - gboolean activate_bytestream_pad_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN; - gboolean process_bytestream_pad_event_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) DECLSPEC_HIDDEN; -+GstBusSyncReply watch_source_bus_wrapper(GstBus *bus, GstMessage *message, gpointer user) DECLSPEC_HIDDEN; -+void source_stream_added_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; -+void source_stream_removed_wrapper(GstElement *element, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; -+void source_all_streams_wrapper(GstElement *element, gpointer user) DECLSPEC_HIDDEN; +@@ -164,5 +168,9 @@ GstFlowReturn bytestream_wrapper_pull_wrapper(GstPad *pad, GstObject *parent, gu + gboolean bytestream_query_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN; + gboolean bytestream_pad_mode_activate_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN; + gboolean bytestream_pad_event_process_wrapper(GstPad *pad, GstObject *parent, GstEvent *event) DECLSPEC_HIDDEN; ++GstBusSyncReply mf_src_bus_watch_wrapper(GstBus *bus, GstMessage *message, gpointer user) DECLSPEC_HIDDEN; ++void mf_src_stream_added_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; ++void mf_src_stream_removed_wrapper(GstElement *element, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; ++void mf_src_no_more_pads_wrapper(GstElement *element, gpointer user) DECLSPEC_HIDDEN; #endif diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 6b3bd4a7869..29af2b72def 100644 +index 1accf55c6a2..f61f84359d5 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -24,6 +24,7 @@ @@ -99,9 +98,9 @@ index 6b3bd4a7869..29af2b72def 100644 +#include #include + #include - #define COBJMACROS -@@ -40,21 +41,48 @@ +@@ -41,21 +42,47 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat); @@ -116,7 +115,6 @@ index 6b3bd4a7869..29af2b72def 100644 + enum + { + STREAM_STUB, -+ STREAM_INACTIVE, + STREAM_SHUTDOWN, + } state; +}; @@ -151,13 +149,13 @@ index 6b3bd4a7869..29af2b72def 100644 static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *iface) { return CONTAINING_RECORD(iface, struct media_source, IMFMediaSource_iface); -@@ -208,6 +236,243 @@ static gboolean process_bytestream_pad_event(GstPad *pad, GstObject *parent, Gst +@@ -182,6 +209,242 @@ static gboolean bytestream_pad_event_process(GstPad *pad, GstObject *parent, Gst return TRUE; } -+GstBusSyncReply watch_source_bus(GstBus *bus, GstMessage *message, gpointer user) ++GstBusSyncReply bus_watch(GstBus *bus, GstMessage *message, gpointer user) +{ -+ struct media_source *source = (struct media_source *) user; ++ struct media_source *source = user; + gchar *dbg_info = NULL; + GError *err = NULL; + @@ -183,7 +181,8 @@ index 6b3bd4a7869..29af2b72def 100644 + break; + } + -+ return GST_BUS_PASS; ++ gst_message_unref(message); ++ return GST_BUS_DROP; +} + +static HRESULT WINAPI media_stream_QueryInterface(IMFMediaStream *iface, REFIID riid, void **out) @@ -342,7 +341,7 @@ index 6b3bd4a7869..29af2b72def 100644 +}; + +/* creates a stub stream */ -+static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD stream_id, struct media_stream **out_stream) ++static HRESULT new_media_stream(struct media_source *source, GstPad *pad, struct media_stream **out_stream) +{ + struct media_stream *object = heap_alloc_zero(sizeof(*object)); + HRESULT hr; @@ -368,10 +367,8 @@ index 6b3bd4a7869..29af2b72def 100644 + } + gst_bin_add(GST_BIN(object->parent_source->container), object->appsink); + -+ g_object_set(object->appsink, "emit-signals", TRUE, NULL); + g_object_set(object->appsink, "sync", FALSE, NULL); + g_object_set(object->appsink, "max-buffers", 5, NULL); -+ g_object_set(object->appsink, "wait-on-eos", FALSE, NULL); + + object->my_sink = gst_element_get_static_pad(object->appsink, "sink"); + gst_pad_set_element_private(object->my_sink, object); @@ -385,7 +382,7 @@ index 6b3bd4a7869..29af2b72def 100644 + + return S_OK; + -+ fail: ++fail: + WARN("Failed to construct media stream, hr %#x.\n", hr); + + IMFMediaStream_Release(&object->IMFMediaStream_iface); @@ -395,7 +392,15 @@ index 6b3bd4a7869..29af2b72def 100644 static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID riid, void **out) { struct media_source *source = impl_from_IMFMediaSource(iface); -@@ -367,13 +632,34 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +@@ -333,6 +596,7 @@ static HRESULT WINAPI media_source_Pause(IMFMediaSource *iface) + static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) + { + struct media_source *source = impl_from_IMFMediaSource(iface); ++ unsigned int i; + + TRACE("(%p)\n", source); + +@@ -341,13 +605,34 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) source->state = SOURCE_SHUTDOWN; @@ -415,7 +420,7 @@ index 6b3bd4a7869..29af2b72def 100644 if (source->byte_stream) IMFByteStream_Release(source->byte_stream); -+ for (unsigned int i = 0; i < source->stream_count; i++) ++ for (i = 0; i < source->stream_count; i++) + { + source->streams[i]->state = STREAM_SHUTDOWN; + IMFMediaStream_Release(&source->streams[i]->IMFMediaStream_iface); @@ -430,71 +435,58 @@ index 6b3bd4a7869..29af2b72def 100644 return S_OK; } -@@ -394,6 +680,63 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl = +@@ -368,6 +653,50 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl = media_source_Shutdown, }; -+static void source_stream_added(GstElement *element, GstPad *pad, gpointer user) ++static void stream_added(GstElement *element, GstPad *pad, gpointer user) +{ -+ struct media_source *source = (struct media_source *) user; ++ struct media_source *source = user; + struct media_stream **new_stream_array; + struct media_stream *stream; -+ gchar *g_stream_id; -+ DWORD stream_id; + + if (gst_pad_get_direction(pad) != GST_PAD_SRC) + return; + -+ /* Most/All seen randomly calculate the initial part of the stream id, the last three digits are the only deterministic part */ -+ g_stream_id = GST_PAD_NAME(pad); -+ sscanf(strstr(g_stream_id, "_"), "_%u", &stream_id); -+ -+ TRACE("stream-id: %u\n", stream_id); -+ -+ if (FAILED(new_media_stream(source, pad, stream_id, &stream))) -+ { -+ goto leave; -+ } ++ if (FAILED(new_media_stream(source, pad, &stream))) ++ return; + + if (!(new_stream_array = heap_realloc(source->streams, (source->stream_count + 1) * (sizeof(*new_stream_array))))) + { + ERR("Failed to add stream to source\n"); -+ goto leave; ++ IMFMediaStream_Release(&stream->IMFMediaStream_iface); ++ return; + } + + source->streams = new_stream_array; + source->streams[source->stream_count++] = stream; -+ -+ leave: -+ return; +} + -+static void source_stream_removed(GstElement *element, GstPad *pad, gpointer user) ++static void stream_removed(GstElement *element, GstPad *pad, gpointer user) +{ -+ struct media_source *source = (struct media_source *)user; ++ struct media_source *source = user; ++ unsigned int i; + -+ for (unsigned int i = 0; i < source->stream_count; i++) ++ for (i = 0; i < source->stream_count; i++) + { + struct media_stream *stream = source->streams[i]; + if (stream->their_src != pad) + continue; + stream->their_src = NULL; -+ if (stream->state != STREAM_INACTIVE) -+ stream->state = STREAM_INACTIVE; + } +} + -+static void source_all_streams(GstElement *element, gpointer user) ++static void no_more_pads(GstElement *element, gpointer user) +{ -+ struct media_source *source = (struct media_source *) user; ++ struct media_source *source = user; + + SetEvent(source->all_streams_event); +} + static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_source **out_media_source) { - GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE( -@@ -404,6 +747,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + GstStaticPadTemplate src_template = +@@ -375,6 +704,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ struct media_source *object = heap_alloc_zero(sizeof(*object)); HRESULT hr; @@ -502,7 +494,7 @@ index 6b3bd4a7869..29af2b72def 100644 if (!object) return E_OUTOFMEMORY; -@@ -412,10 +756,16 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -383,10 +713,16 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ object->ref = 1; object->byte_stream = bytestream; IMFByteStream_AddRef(bytestream); @@ -513,33 +505,36 @@ index 6b3bd4a7869..29af2b72def 100644 + object->container = gst_bin_new(NULL); + object->bus = gst_bus_new(); -+ gst_bus_set_sync_handler(object->bus, watch_source_bus_wrapper, object, NULL); ++ gst_bus_set_sync_handler(object->bus, mf_src_bus_watch_wrapper, object, NULL); + gst_element_set_bus(object->container, object->bus); + object->my_src = gst_pad_new_from_static_template(&src_template, "mf-src"); gst_pad_set_element_private(object->my_src, object); - gst_pad_set_getrange_function(object->my_src, pull_from_bytestream_wrapper); -@@ -423,6 +773,46 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ - gst_pad_set_activatemode_function(object->my_src, activate_bytestream_pad_mode_wrapper); - gst_pad_set_event_function(object->my_src, process_bytestream_pad_event_wrapper); + gst_pad_set_getrange_function(object->my_src, bytestream_wrapper_pull_wrapper); +@@ -394,6 +730,49 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + gst_pad_set_activatemode_function(object->my_src, bytestream_pad_mode_activate_wrapper); + gst_pad_set_event_function(object->my_src, bytestream_pad_event_process_wrapper); -+ object->decodebin = gst_element_factory_make("decodebin", NULL); -+ if (!(object->decodebin)) ++ if (!(object->decodebin = gst_element_factory_make("decodebin", NULL))) + { + WARN("Failed to create decodebin for source\n"); + hr = E_OUTOFMEMORY; + goto fail; + } -+ /* the appsinks determine the maximum amount of buffering instead, this means that if one stream isn't read, a leak will happen, like on windows */ ++ ++ /* In Media Foundation, sources will infinitely leak buffers, when a subset of the selected ++ streams are read from. This behavior is relied upon in the Unity3D engine game, Trailmakers, ++ where Unity selects both the video and audio streams, yet only reads from the video stream. ++ Removing these buffering limits reflects that behavior. */ + g_object_set(object->decodebin, "max-size-buffers", 0, NULL); + g_object_set(object->decodebin, "max-size-time", G_GUINT64_CONSTANT(0), NULL); + g_object_set(object->decodebin, "max-size-bytes", 0, NULL); + + gst_bin_add(GST_BIN(object->container), object->decodebin); + -+ g_signal_connect(object->decodebin, "pad-added", G_CALLBACK(source_stream_added_wrapper), object); -+ g_signal_connect(object->decodebin, "pad-removed", G_CALLBACK(source_stream_removed_wrapper), object); -+ g_signal_connect(object->decodebin, "no-more-pads", G_CALLBACK(source_all_streams_wrapper), object); ++ g_signal_connect(object->decodebin, "pad-added", G_CALLBACK(mf_src_stream_added_wrapper), object); ++ g_signal_connect(object->decodebin, "pad-removed", G_CALLBACK(mf_src_stream_removed_wrapper), object); ++ g_signal_connect(object->decodebin, "no-more-pads", G_CALLBACK(mf_src_no_more_pads_wrapper), object); + + object->their_sink = gst_element_get_static_pad(object->decodebin, "sink"); + @@ -566,37 +561,37 @@ index 6b3bd4a7869..29af2b72def 100644 object->state = SOURCE_STOPPED; *out_media_source = object; -@@ -923,6 +1313,30 @@ void perform_cb_media_source(struct cb_data *cbdata) - cbdata->u.event_src_data.ret = process_bytestream_pad_event(data->pad, data->parent, data->event); +@@ -893,6 +1272,30 @@ void perform_cb_media_source(struct cb_data *cbdata) + cbdata->u.event_src_data.ret = bytestream_pad_event_process(data->pad, data->parent, data->event); break; } -+ case WATCH_SOURCE_BUS: ++ case MF_SRC_BUS_WATCH: + { + struct watch_bus_data *data = &cbdata->u.watch_bus_data; -+ cbdata->u.watch_bus_data.ret = watch_source_bus(data->bus, data->msg, data->user); ++ cbdata->u.watch_bus_data.ret = bus_watch(data->bus, data->msg, data->user); + break; + } -+ case SOURCE_STREAM_ADDED: ++ case MF_SRC_STREAM_ADDED: + { + struct pad_added_data *data = &cbdata->u.pad_added_data; -+ source_stream_added(data->element, data->pad, data->user); ++ stream_added(data->element, data->pad, data->user); + break; + } -+ case SOURCE_STREAM_REMOVED: ++ case MF_SRC_STREAM_REMOVED: + { + struct pad_removed_data *data = &cbdata->u.pad_removed_data; -+ source_stream_removed(data->element, data->pad, data->user); ++ stream_removed(data->element, data->pad, data->user); + break; + } -+ case SOURCE_ALL_STREAMS: ++ case MF_SRC_NO_MORE_PADS: + { + struct no_more_pads_data *data = &cbdata->u.no_more_pads_data; -+ source_all_streams(data->element, data->user); ++ no_more_pads(data->element, data->user); + break; + } default: { - ERR("Wrong callback forwarder called\n"); + assert(0); -- 2.28.0 diff --git a/patches/mfplat-streaming-support/0003-winegstreamer-Implement-IMFMediaStream-GetStreamDesc.patch b/patches/mfplat-streaming-support/0003-winegstreamer-Implement-IMFMediaStream-GetStreamDesc.patch index d917c4d2..9c9d97d3 100644 --- a/patches/mfplat-streaming-support/0003-winegstreamer-Implement-IMFMediaStream-GetStreamDesc.patch +++ b/patches/mfplat-streaming-support/0003-winegstreamer-Implement-IMFMediaStream-GetStreamDesc.patch @@ -1,73 +1,17 @@ -From 2bbf345d820cfb52620bfbde10ce5d920854baf1 Mon Sep 17 00:00:00 2001 +From 5119cb0704635fb1b4e30f4b67f86826b28e6015 Mon Sep 17 00:00:00 2001 From: Derek Lesho -Date: Tue, 31 Mar 2020 11:11:05 -0500 -Subject: [PATCH 03/52] winegstreamer: Implement - IMFMediaStream::GetStreamDescriptor. +Date: Fri, 11 Sep 2020 13:51:20 -0500 +Subject: [PATCH] winegstreamer: Implement IMFMediaStream::GetStreamDescriptor. Signed-off-by: Derek Lesho --- - dlls/winegstreamer/gst_cbs.c | 13 ++ - dlls/winegstreamer/gst_cbs.h | 8 ++ - dlls/winegstreamer/gst_private.h | 5 + - dlls/winegstreamer/media_source.c | 137 +++++++++++++++++++- - dlls/winegstreamer/mfplat.c | 208 ++++++++++++++++++++++++++++++ - 5 files changed, 368 insertions(+), 3 deletions(-) + dlls/winegstreamer/gst_private.h | 4 + + dlls/winegstreamer/media_source.c | 75 +++++++++++++- + dlls/winegstreamer/mfplat.c | 166 ++++++++++++++++++++++++++++++ + 3 files changed, 240 insertions(+), 5 deletions(-) -diff --git a/dlls/winegstreamer/gst_cbs.c b/dlls/winegstreamer/gst_cbs.c -index 4755f5b42f1..e56c987eb38 100644 ---- a/dlls/winegstreamer/gst_cbs.c -+++ b/dlls/winegstreamer/gst_cbs.c -@@ -404,3 +404,16 @@ void source_all_streams_wrapper(GstElement *element, gpointer user) - - call_cb(&cbdata); - } -+ -+GstPadProbeReturn caps_listener_wrapper(GstPad *pad, GstPadProbeInfo *info, gpointer user) -+{ -+ struct cb_data cbdata = { STREAM_PAD_EVENT }; -+ -+ cbdata.u.pad_probe_data.pad = pad; -+ cbdata.u.pad_probe_data.info = info; -+ cbdata.u.pad_probe_data.user = user; -+ -+ call_cb(&cbdata); -+ -+ return cbdata.u.pad_probe_data.ret; -+} -diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h -index d87cc8c21e9..7173c09746e 100644 ---- a/dlls/winegstreamer/gst_cbs.h -+++ b/dlls/winegstreamer/gst_cbs.h -@@ -52,6 +52,7 @@ enum CB_TYPE { - SOURCE_STREAM_ADDED, - SOURCE_STREAM_REMOVED, - SOURCE_ALL_STREAMS, -+ STREAM_PAD_EVENT, - MEDIA_SOURCE_MAX, - }; - -@@ -137,6 +138,12 @@ struct cb_data { - GstQuery *query; - gboolean ret; - } query_sink_data; -+ struct pad_probe_data { -+ GstPad *pad; -+ GstPadProbeInfo *info; -+ gpointer user; -+ GstPadProbeReturn ret; -+ } pad_probe_data; - } u; - - int finished; -@@ -172,5 +179,6 @@ GstBusSyncReply watch_source_bus_wrapper(GstBus *bus, GstMessage *message, gpoin - void source_stream_added_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; - void source_stream_removed_wrapper(GstElement *element, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; - void source_all_streams_wrapper(GstElement *element, gpointer user) DECLSPEC_HIDDEN; -+GstPadProbeReturn caps_listener_wrapper(GstPad *pad, GstPadProbeInfo *info, gpointer user); - - #endif diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index ef07d3591e7..86392eea4e3 100644 +index ef07d3591e7..60b38a48f5a 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -36,6 +36,7 @@ @@ -78,42 +22,39 @@ index ef07d3591e7..86392eea4e3 100644 #include "wine/heap.h" #include "wine/strmbase.h" -@@ -54,6 +55,10 @@ void start_dispatch_thread(void) DECLSPEC_HIDDEN; +@@ -54,6 +55,9 @@ void start_dispatch_thread(void) DECLSPEC_HIDDEN; extern HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) DECLSPEC_HIDDEN; +HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; -+GstCaps *make_mf_compatible_caps(GstCaps *caps); -+IMFMediaType *mf_media_type_from_caps(GstCaps *caps); ++IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) DECLSPEC_HIDDEN; + HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; #endif /* __GST_PRIVATE_INCLUDED__ */ diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 29af2b72def..345b1fe4528 100644 +index f61f84359d5..723f052c10d 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -47,14 +47,19 @@ struct media_stream +@@ -48,13 +48,17 @@ struct media_stream LONG ref; struct media_source *parent_source; IMFMediaEventQueue *event_queue; + IMFStreamDescriptor *descriptor; GstElement *appsink; GstPad *their_src, *my_sink; -+ GstCaps *their_caps; enum { STREAM_STUB, - STREAM_INACTIVE, ++ STREAM_INACTIVE, STREAM_SHUTDOWN, } state; + /* used when in STUB state: */ + DWORD stream_id; -+ HANDLE caps_event; }; struct media_source -@@ -312,6 +317,8 @@ static ULONG WINAPI media_stream_Release(IMFMediaStream *iface) +@@ -286,6 +290,8 @@ static ULONG WINAPI media_stream_Release(IMFMediaStream *iface) { if (stream->my_sink) gst_object_unref(GST_OBJECT(stream->my_sink)); @@ -122,7 +63,7 @@ index 29af2b72def..345b1fe4528 100644 if (stream->event_queue) IMFMediaEventQueue_Release(stream->event_queue); if (stream->parent_source) -@@ -393,7 +400,10 @@ static HRESULT WINAPI media_stream_GetStreamDescriptor(IMFMediaStream* iface, IM +@@ -367,7 +373,10 @@ static HRESULT WINAPI media_stream_GetStreamDescriptor(IMFMediaStream* iface, IM if (stream->state == STREAM_SHUTDOWN) return MF_E_SHUTDOWN; @@ -134,7 +75,16 @@ index 29af2b72def..345b1fe4528 100644 } static HRESULT WINAPI media_stream_RequestSample(IMFMediaStream *iface, IUnknown *token) -@@ -436,9 +446,12 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD +@@ -397,7 +406,7 @@ static const IMFMediaStreamVtbl media_stream_vtbl = + }; + + /* creates a stub stream */ +-static HRESULT new_media_stream(struct media_source *source, GstPad *pad, struct media_stream **out_stream) ++static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD stream_id, struct media_stream **out_stream) + { + struct media_stream *object = heap_alloc_zero(sizeof(*object)); + HRESULT hr; +@@ -410,6 +419,7 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, struct IMFMediaSource_AddRef(&source->IMFMediaSource_iface); object->parent_source = source; object->their_src = pad; @@ -142,38 +92,34 @@ index 29af2b72def..345b1fe4528 100644 object->state = STREAM_STUB; -+ object->caps_event = CreateEventA(NULL, TRUE, FALSE, NULL); -+ - if (FAILED(hr = MFCreateEventQueue(&object->event_queue))) - goto fail; - -@@ -455,10 +468,10 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD - g_object_set(object->appsink, "wait-on-eos", FALSE, NULL); +@@ -427,8 +437,6 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, struct + g_object_set(object->appsink, "max-buffers", 5, NULL); object->my_sink = gst_element_get_static_pad(object->appsink, "sink"); - gst_pad_set_element_private(object->my_sink, object); - gst_pad_link(object->their_src, object->my_sink); -+ gst_pad_add_probe(object->my_sink, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, caps_listener_wrapper, object, NULL); -+ gst_element_sync_state_with_parent(object->appsink); - - TRACE("->(%p)\n", object); -@@ -473,6 +486,43 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD +@@ -445,6 +453,47 @@ fail: return hr; } +static HRESULT media_stream_init_desc(struct media_stream *stream) +{ -+ HRESULT hr; ++ GstCaps *current_caps = gst_pad_get_current_caps(stream->their_src); + IMFMediaTypeHandler *type_handler; + IMFMediaType *stream_type = NULL; ++ HRESULT hr; + -+ stream->their_caps = gst_caps_fixate(stream->their_caps); ++ if (!current_caps) ++ { ++ hr = E_FAIL; ++ goto fail; ++ } + -+ stream_type = mf_media_type_from_caps(stream->their_caps); -+ gst_caps_unref(stream->their_caps); ++ stream_type = mf_media_type_from_caps(current_caps); ++ gst_caps_unref(current_caps); + if (!stream_type) + { + hr = E_FAIL; @@ -195,7 +141,6 @@ index 29af2b72def..345b1fe4528 100644 + + return S_OK; + fail: -+ ERR("media stream initialization failed with %x\n", hr); + if (type_handler) + IMFMediaTypeHandler_Release(type_handler); + return hr; @@ -204,131 +149,54 @@ index 29af2b72def..345b1fe4528 100644 static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID riid, void **out) { struct media_source *source = impl_from_IMFMediaSource(iface); -@@ -680,6 +730,23 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl = - media_source_Shutdown, - }; +@@ -662,7 +711,7 @@ static void stream_added(GstElement *element, GstPad *pad, gpointer user) + if (gst_pad_get_direction(pad) != GST_PAD_SRC) + return; -+/* If this callback is extended to use any significant win32 APIs, a wrapper function -+ should be added */ -+gboolean stream_found(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer user) -+{ -+ GstCaps *target_caps; -+ -+ /* if the stream can be converted into an MF compatible type, we'll go that route -+ otherwise, we'll rely on decodebin for the whole process */ -+ -+ if ((target_caps = make_mf_compatible_caps(caps))) -+ { -+ gst_caps_unref(target_caps); -+ return FALSE; -+ } -+ return TRUE; -+} -+ - static void source_stream_added(GstElement *element, GstPad *pad, gpointer user) - { - struct media_source *source = (struct media_source *) user; -@@ -697,6 +764,36 @@ static void source_stream_added(GstElement *element, GstPad *pad, gpointer user) +- if (FAILED(new_media_stream(source, pad, &stream))) ++ if (FAILED(new_media_stream(source, pad, source->stream_count, &stream))) + return; - TRACE("stream-id: %u\n", stream_id); - -+ /* This codepath is currently never triggered, as we don't need to ever restart the gstreamer pipeline. It is retained in -+ case this becomes necessary in the future, for example in a case where different media types require different -+ post-processing elements. */ -+ for (unsigned int i = 0; i < source->stream_count; i++) -+ { -+ DWORD existing_stream_id; -+ IMFStreamDescriptor *descriptor = source->streams[i]->descriptor; -+ -+ if (source->streams[i]->state == STREAM_STUB) -+ continue; -+ -+ if (FAILED(IMFStreamDescriptor_GetStreamIdentifier(descriptor, &existing_stream_id))) -+ goto leave; -+ -+ if (existing_stream_id == stream_id) -+ { -+ struct media_stream *existing_stream = source->streams[i]; -+ GstPadLinkReturn ret; -+ -+ TRACE("Found existing stream %p\n", existing_stream); -+ -+ existing_stream->their_src = pad; -+ -+ if ((ret = gst_pad_link(existing_stream->their_src, existing_stream->my_sink)) != GST_PAD_LINK_OK) -+ ERR("Error linking decodebin pad to stream %p, err = %d\n", existing_stream, ret); -+ -+ goto leave; -+ } -+ } -+ - if (FAILED(new_media_stream(source, pad, stream_id, &stream))) - { - goto leave; -@@ -737,6 +834,26 @@ static void source_all_streams(GstElement *element, gpointer user) - SetEvent(source->all_streams_event); + if (!(new_stream_array = heap_realloc(source->streams, (source->stream_count + 1) * (sizeof(*new_stream_array))))) +@@ -687,6 +736,8 @@ static void stream_removed(GstElement *element, GstPad *pad, gpointer user) + if (stream->their_src != pad) + continue; + stream->their_src = NULL; ++ if (stream->state != STREAM_INACTIVE) ++ stream->state = STREAM_INACTIVE; + } } -+static GstPadProbeReturn caps_listener(GstPad *pad, GstPadProbeInfo *info, gpointer user) -+{ -+ struct media_stream *stream = (struct media_stream *) user; -+ GstEvent *event = gst_pad_probe_info_get_event(info); -+ -+ if (GST_EVENT_TYPE(event) == GST_EVENT_CAPS) -+ { -+ GstCaps *caps; -+ TRACE("got caps for stream %p\n", stream); -+ -+ gst_event_parse_caps(event, &caps); -+ stream->their_caps = gst_caps_copy(caps); -+ SetEvent(stream->caps_event); -+ -+ return GST_PAD_PROBE_REMOVE; -+ } -+ -+ return GST_PAD_PROBE_OK; -+} -+ - static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_source **out_media_source) - { - GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE( -@@ -787,6 +904,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -703,6 +754,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + GST_STATIC_PAD_TEMPLATE("mf_src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); - gst_bin_add(GST_BIN(object->container), object->decodebin); + struct media_source *object = heap_alloc_zero(sizeof(*object)); ++ unsigned int i; + HRESULT hr; + int ret; -+ if(!GetEnvironmentVariableA("MF_DECODE_IN_SOURCE", NULL, 0)) -+ g_signal_connect(object->decodebin, "autoplug-continue", G_CALLBACK(stream_found), object); - g_signal_connect(object->decodebin, "pad-added", G_CALLBACK(source_stream_added_wrapper), object); - g_signal_connect(object->decodebin, "pad-removed", G_CALLBACK(source_stream_removed_wrapper), object); - g_signal_connect(object->decodebin, "no-more-pads", G_CALLBACK(source_all_streams_wrapper), object); -@@ -812,6 +931,12 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -772,6 +824,19 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ } WaitForSingleObject(object->all_streams_event, INFINITE); -+ for (unsigned int i = 0; i < object->stream_count; i++) ++ for (i = 0; i < object->stream_count; i++) + { -+ WaitForSingleObject(object->streams[i]->caps_event, INFINITE); -+ if (FAILED(hr = media_stream_init_desc(object->streams[i]))) ++ GstSample *preroll; ++ g_signal_emit_by_name(object->streams[i]->appsink, "pull-preroll", &preroll); ++ hr = E_FAIL; ++ if (!preroll || FAILED(hr = media_stream_init_desc(object->streams[i]))) ++ { ++ ERR("Failed to finish initialization of media stream %p, hr %x.\n", object->streams[i], hr); ++ IMFMediaStream_Release(&object->streams[i]->IMFMediaStream_iface); + goto fail; ++ } ++ gst_sample_unref(preroll); + } object->state = SOURCE_STOPPED; -@@ -1337,6 +1462,12 @@ void perform_cb_media_source(struct cb_data *cbdata) - source_all_streams(data->element, data->user); - break; - } -+ case STREAM_PAD_EVENT: -+ { -+ struct pad_probe_data *data = &cbdata->u.pad_probe_data; -+ cbdata->u.pad_probe_data.ret = caps_listener(data->pad, data->info, data->user); -+ break; -+ } - default: - { - ERR("Wrong callback forwarder called\n"); diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index c996f06211e..3667bc3cc38 100644 +index c996f06211e..2c2216f94b6 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -16,6 +16,11 @@ @@ -343,17 +211,17 @@ index c996f06211e..3667bc3cc38 100644 #include #include "gst_private.h" -@@ -436,3 +441,206 @@ HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) +@@ -436,3 +441,164 @@ HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) return CLASS_E_CLASSNOTAVAILABLE; } + -+const static struct ++static const struct +{ + const GUID *subtype; + GstVideoFormat format; +} -+uncompressed_formats[] = ++uncompressed_video_formats[] = +{ + {&MFVideoFormat_ARGB32, GST_VIDEO_FORMAT_BGRA}, + {&MFVideoFormat_RGB32, GST_VIDEO_FORMAT_BGRx}, @@ -362,8 +230,8 @@ index c996f06211e..3667bc3cc38 100644 + {&MFVideoFormat_RGB555, GST_VIDEO_FORMAT_BGR15}, +}; + -+/* caps will be modified to represent the exact type needed for the format */ -+static IMFMediaType* transform_to_media_type(GstCaps *caps) ++/* returns NULL if doesn't match exactly */ ++IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) +{ + IMFMediaType *media_type; + GstStructure *info; @@ -377,18 +245,16 @@ index c996f06211e..3667bc3cc38 100644 + } + + if (FAILED(MFCreateMediaType(&media_type))) -+ { + return NULL; -+ } + + info = gst_caps_get_structure(caps, 0); + mime_type = gst_structure_get_name(info); + -+ if (!(strncmp(mime_type, "video", 5))) ++ if (!strncmp(mime_type, "video", 5)) + { + GstVideoInfo video_info; + -+ if (!(gst_video_info_from_caps(&video_info, caps))) ++ if (!gst_video_info_from_caps(&video_info, caps)) + { + return NULL; + } @@ -399,7 +265,7 @@ index c996f06211e..3667bc3cc38 100644 + + IMFMediaType_SetUINT64(media_type, &MF_MT_FRAME_RATE, ((UINT64)video_info.fps_n << 32) | video_info.fps_d); + -+ if (!(strcmp(mime_type, "video/x-raw"))) ++ if (!strcmp(mime_type, "video/x-raw")) + { + GUID fourcc_subtype = MFVideoFormat_Base; + unsigned int i; @@ -413,26 +279,29 @@ index c996f06211e..3667bc3cc38 100644 + } + else + { -+ for (i = 0; i < ARRAY_SIZE(uncompressed_formats); i++) ++ for (i = 0; i < ARRAY_SIZE(uncompressed_video_formats); i++) + { -+ if (uncompressed_formats[i].format == video_info.finfo->format) ++ if (uncompressed_video_formats[i].format == video_info.finfo->format) + { -+ IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, uncompressed_formats[i].subtype); ++ IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, uncompressed_video_formats[i].subtype); + break; + } + } -+ if (i == ARRAY_SIZE(uncompressed_formats)) -+ FIXME("Unrecognized format.\n"); ++ if (i == ARRAY_SIZE(uncompressed_video_formats)) ++ { ++ FIXME("Unrecognized uncompressed video format %x\n", video_info.finfo->format); ++ IMFMediaType_Release(media_type); ++ return NULL; ++ } + } + } + else + { + FIXME("Unrecognized video format %s\n", mime_type); -+ IMFMediaType_Release(media_type); + return NULL; + } + } -+ else if (!(strncmp(mime_type, "audio", 5))) ++ else if (!strncmp(mime_type, "audio", 5)) + { + gint rate, channels, bitrate; + guint64 channel_mask; @@ -445,57 +314,51 @@ index c996f06211e..3667bc3cc38 100644 + IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_NUM_CHANNELS, channels); + + if (gst_structure_get(info, "channel-mask", GST_TYPE_BITMASK, &channel_mask, NULL)) -+ IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_CHANNEL_MASK, (DWORD)channel_mask); ++ IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_CHANNEL_MASK, channel_mask); + + if (gst_structure_get_int(info, "bitrate", &bitrate)) + IMFMediaType_SetUINT32(media_type, &MF_MT_AVG_BITRATE, bitrate); + -+ if (!(strcmp(mime_type, "audio/x-raw"))) ++ if (!strcmp(mime_type, "audio/x-raw")) + { -+ const char *format; -+ if ((format = gst_structure_get_string(info, "format"))) ++ GstAudioInfo audio_info; ++ ++ if (gst_audio_info_from_caps(&audio_info, caps)) + { -+ char type; -+ unsigned int bits_per_sample; -+ char endian[2]; -+ char new_format[6]; -+ if ((strlen(format) > 5) || (sscanf(format, "%c%u%2c", &type, &bits_per_sample, endian) < 2)) ++ DWORD depth = GST_AUDIO_INFO_DEPTH(&audio_info); ++ ++ /* validation */ ++ if ((audio_info.finfo->flags & GST_AUDIO_FORMAT_FLAG_INTEGER && depth > 8) || ++ (audio_info.finfo->flags & GST_AUDIO_FORMAT_FLAG_SIGNED && depth <= 8) || ++ (audio_info.finfo->endianness != G_LITTLE_ENDIAN && depth > 8)) + { -+ FIXME("Unhandled audio format %s\n", format); + IMFMediaType_Release(media_type); + return NULL; + } + -+ if (type == 'F') ++ /* conversion */ ++ switch (audio_info.finfo->flags) + { -+ IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_Float); -+ } -+ else if (type == 'U' || type == 'S') -+ { -+ IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM); -+ if (bits_per_sample == 8) -+ type = 'U'; -+ else -+ type = 'S'; -+ } -+ else -+ { -+ FIXME("Unrecognized audio format: %s\n", format); -+ IMFMediaType_Release(media_type); -+ return NULL; ++ case GST_AUDIO_FORMAT_FLAG_FLOAT: ++ IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_Float); ++ break; ++ case GST_AUDIO_FORMAT_FLAG_INTEGER: ++ case GST_AUDIO_FORMAT_FLAG_SIGNED: ++ IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM); ++ break; ++ default: ++ FIXME("Unrecognized audio format %x\n", audio_info.finfo->format); ++ IMFMediaType_Release(media_type); ++ return NULL; + } + -+ IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, bits_per_sample); -+ -+ if (endian[0] == 'B') -+ endian[0] = 'L'; -+ -+ sprintf(new_format, "%c%u%.2s", type, bits_per_sample, bits_per_sample > 8 ? endian : 0); -+ gst_caps_set_simple(caps, "format", G_TYPE_STRING, new_format, NULL); ++ IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, depth); + } + else + { -+ ERR("Failed to get audio format\n"); ++ ERR("Failed to get caps audio info\n"); ++ IMFMediaType_Release(media_type); ++ return NULL; + } + } + else @@ -513,43 +376,6 @@ index c996f06211e..3667bc3cc38 100644 + + return media_type; +} -+ -+/* returns NULL if doesn't match exactly */ -+IMFMediaType *mf_media_type_from_caps(GstCaps *caps) -+{ -+ GstCaps *writeable_caps; -+ IMFMediaType *ret; -+ -+ writeable_caps = gst_caps_copy(caps); -+ ret = transform_to_media_type(writeable_caps); -+ -+ if (!(gst_caps_is_equal(caps, writeable_caps))) -+ { -+ IMFMediaType_Release(ret); -+ ret = NULL; -+ } -+ gst_caps_unref(writeable_caps); -+ return ret; -+} -+ -+GstCaps *make_mf_compatible_caps(GstCaps *caps) -+{ -+ GstCaps *ret; -+ IMFMediaType *media_type; -+ -+ ret = gst_caps_copy(caps); -+ -+ if ((media_type = transform_to_media_type(ret))) -+ IMFMediaType_Release(media_type); -+ -+ if (!media_type) -+ { -+ gst_caps_unref(ret); -+ return NULL; -+ } -+ -+ return ret; -+} -- 2.28.0 diff --git a/patches/mfplat-streaming-support/0004-winegstreamer-Insert-parser-into-pipeline-to-rectify.patch b/patches/mfplat-streaming-support/0004-winegstreamer-Insert-parser-into-pipeline-to-rectify.patch index fd203154..1baf6825 100644 --- a/patches/mfplat-streaming-support/0004-winegstreamer-Insert-parser-into-pipeline-to-rectify.patch +++ b/patches/mfplat-streaming-support/0004-winegstreamer-Insert-parser-into-pipeline-to-rectify.patch @@ -1,19 +1,33 @@ -From c8effecf2d89b5169b03f4d71243729b68d4c3ba Mon Sep 17 00:00:00 2001 +From 6f8f29e9f93a2a2a2393bb009e5b16063c036409 Mon Sep 17 00:00:00 2001 From: Derek Lesho -Date: Tue, 31 Mar 2020 15:11:31 -0500 -Subject: [PATCH 04/52] winegstreamer: Insert parser into pipeline to rectify - type differences. +Date: Tue, 15 Sep 2020 14:25:26 -0500 +Subject: [PATCH] winegstreamer: Insert parser into pipeline to rectify type + differences. Signed-off-by: Derek Lesho --- - dlls/winegstreamer/media_source.c | 130 +++++++++++++++++++++++++++++- - 1 file changed, 127 insertions(+), 3 deletions(-) + dlls/winegstreamer/gst_private.h | 1 + + dlls/winegstreamer/media_source.c | 149 +++++++++++++++++++++++++++++- + dlls/winegstreamer/mfplat.c | 22 +++++ + 3 files changed, 169 insertions(+), 3 deletions(-) +diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h +index 60b38a48f5a..7ec71d40800 100644 +--- a/dlls/winegstreamer/gst_private.h ++++ b/dlls/winegstreamer/gst_private.h +@@ -56,6 +56,7 @@ void start_dispatch_thread(void) DECLSPEC_HIDDEN; + extern HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) DECLSPEC_HIDDEN; + + HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; ++GstCaps *make_mf_compatible_caps(GstCaps *caps) DECLSPEC_HIDDEN; + IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) DECLSPEC_HIDDEN; + + HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 345b1fe4528..f1e8c5799f7 100644 +index 723f052c10d..075bba3d551 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -432,6 +432,122 @@ static const IMFMediaStreamVtbl media_stream_vtbl = +@@ -405,6 +405,122 @@ static const IMFMediaStreamVtbl media_stream_vtbl = media_stream_RequestSample }; @@ -136,34 +150,97 @@ index 345b1fe4528..f1e8c5799f7 100644 /* creates a stub stream */ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD stream_id, struct media_stream **out_stream) { -@@ -467,8 +583,7 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD +@@ -436,8 +552,7 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD + g_object_set(object->appsink, "sync", FALSE, NULL); g_object_set(object->appsink, "max-buffers", 5, NULL); - g_object_set(object->appsink, "wait-on-eos", FALSE, NULL); - object->my_sink = gst_element_get_static_pad(object->appsink, "sink"); - gst_pad_link(object->their_src, object->my_sink); + media_stream_align_with_mf(object); - gst_pad_add_probe(object->my_sink, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, caps_listener_wrapper, object, NULL); + gst_element_sync_state_with_parent(object->appsink); -@@ -494,7 +609,16 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) +@@ -466,7 +581,16 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) + goto fail; + } - stream->their_caps = gst_caps_fixate(stream->their_caps); - -- stream_type = mf_media_type_from_caps(stream->their_caps); -+ if (strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "video/x-raw") && -+ strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "audio/x-raw")) +- stream_type = mf_media_type_from_caps(current_caps); ++ if (strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "video/x-raw") && ++ strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "audio/x-raw")) + { -+ GstCaps *compatible_caps = make_mf_compatible_caps(stream->their_caps); ++ GstCaps *compatible_caps = make_mf_compatible_caps(current_caps); + stream_type = mf_media_type_from_caps(compatible_caps); + gst_caps_unref(compatible_caps); + } + else -+ stream_type = mf_media_type_from_caps(stream->their_caps); ++ stream_type = mf_media_type_from_caps(current_caps); + - gst_caps_unref(stream->their_caps); + gst_caps_unref(current_caps); if (!stream_type) { +@@ -702,6 +826,23 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl = + media_source_Shutdown, + }; + ++/* If this callback is extended to use any significant win32 APIs, a wrapper function ++ should be added */ ++gboolean stream_found(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer user) ++{ ++ GstCaps *target_caps; ++ ++ /* if the stream can be converted into an MF compatible type, we'll go that route ++ otherwise, we'll rely on decodebin for the whole process */ ++ ++ if ((target_caps = make_mf_compatible_caps(caps))) ++ { ++ gst_caps_unref(target_caps); ++ return FALSE; ++ } ++ return TRUE; ++} ++ + static void stream_added(GstElement *element, GstPad *pad, gpointer user) + { + struct media_source *source = user; +@@ -799,6 +940,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + + gst_bin_add(GST_BIN(object->container), object->decodebin); + ++ if(!GetEnvironmentVariableA("MF_DECODE_IN_SOURCE", NULL, 0)) ++ g_signal_connect(object->decodebin, "autoplug-continue", G_CALLBACK(stream_found), object); + g_signal_connect(object->decodebin, "pad-added", G_CALLBACK(mf_src_stream_added_wrapper), object); + g_signal_connect(object->decodebin, "pad-removed", G_CALLBACK(mf_src_stream_removed_wrapper), object); + g_signal_connect(object->decodebin, "no-more-pads", G_CALLBACK(mf_src_no_more_pads_wrapper), object); +diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c +index 2c2216f94b6..4d868c616f2 100644 +--- a/dlls/winegstreamer/mfplat.c ++++ b/dlls/winegstreamer/mfplat.c +@@ -602,3 +602,25 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) + + return media_type; + } ++ ++GstCaps *make_mf_compatible_caps(GstCaps *caps) ++{ ++ GstCaps *ret; ++ IMFMediaType *media_type; ++ ++ if (gst_caps_get_size(caps) != 1) ++ return NULL; ++ ++ ret = gst_caps_copy(caps); ++ ++ if ((media_type = mf_media_type_from_caps(ret))) ++ IMFMediaType_Release(media_type); ++ ++ if (!media_type) ++ { ++ gst_caps_unref(ret); ++ return NULL; ++ } ++ ++ return ret; ++} -- 2.28.0 diff --git a/patches/mfplat-streaming-support/0005-winegstreamer-Insert-videoconvert-into-decoded-video.patch b/patches/mfplat-streaming-support/0005-winegstreamer-Insert-videoconvert-into-decoded-video.patch index 1c5e6795..48d276dd 100644 --- a/patches/mfplat-streaming-support/0005-winegstreamer-Insert-videoconvert-into-decoded-video.patch +++ b/patches/mfplat-streaming-support/0005-winegstreamer-Insert-videoconvert-into-decoded-video.patch @@ -1,19 +1,19 @@ -From 862d76c09ef0005d40e63b271a03c98874f78828 Mon Sep 17 00:00:00 2001 +From d9ecc0265c676aa3eb954d8247b64bcccd12c34b Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 25 Aug 2020 17:35:49 -0500 -Subject: [PATCH 05/52] winegstreamer: Insert videoconvert into decoded-video +Subject: [PATCH] winegstreamer: Insert videoconvert into decoded-video streams. Signed-off-by: Derek Lesho --- - dlls/winegstreamer/media_source.c | 104 ++++++++++++++++++++++++++---- - 1 file changed, 91 insertions(+), 13 deletions(-) + dlls/winegstreamer/media_source.c | 99 +++++++++++++++++++++++++++---- + 1 file changed, 86 insertions(+), 13 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index f1e8c5799f7..209753608b6 100644 +index 075bba3d551..a4ad51bb6f5 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -459,8 +459,22 @@ static HRESULT media_stream_align_with_mf(struct media_stream *stream) +@@ -432,8 +432,22 @@ static HRESULT media_stream_align_with_mf(struct media_stream *stream) g_free(source_caps_str); } @@ -38,22 +38,26 @@ index f1e8c5799f7..209753608b6 100644 { stream->my_sink = gst_element_get_static_pad(stream->appsink, "sink"); g_object_set(stream->appsink, "caps", source_caps, NULL); -@@ -605,45 +619,109 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) +@@ -572,7 +586,10 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) { - HRESULT hr; + GstCaps *current_caps = gst_pad_get_current_caps(stream->their_src); IMFMediaTypeHandler *type_handler; + IMFMediaType **stream_types = NULL; IMFMediaType *stream_type = NULL; + DWORD type_count = 0; + unsigned int i; + HRESULT hr; - stream->their_caps = gst_caps_fixate(stream->their_caps); + if (!current_caps) +@@ -581,40 +598,96 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) + goto fail; + } -- if (strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "video/x-raw") && -- strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "audio/x-raw")) -+ if (!strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "video/x-raw")) +- if (strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "video/x-raw") && +- strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "audio/x-raw")) ++ if (!strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "video/x-raw")) { -- GstCaps *compatible_caps = make_mf_compatible_caps(stream->their_caps); +- GstCaps *compatible_caps = make_mf_compatible_caps(current_caps); - stream_type = mf_media_type_from_caps(compatible_caps); - gst_caps_unref(compatible_caps); + GstElementFactory *videoconvert_factory = gst_element_factory_find("videoconvert"); @@ -68,20 +72,16 @@ index f1e8c5799f7..209753608b6 100644 + continue; + src_caps = gst_static_pad_template_get_caps(template); + gst_structure_get_list(gst_caps_get_structure(src_caps, 0), "format", &formats); -+ type_count = formats->n_values; -+ stream_types = heap_alloc( sizeof(IMFMediaType*) * type_count ); ++ stream_types = heap_alloc( sizeof(IMFMediaType*) * formats->n_values ); + for (i = 0; i < formats->n_values; i++) + { + GValue *format = g_value_array_get_nth(formats, i); -+ GstCaps *modified_caps = gst_caps_copy(stream->their_caps); ++ GstCaps *modified_caps = gst_caps_copy(current_caps); + gst_caps_set_value(modified_caps, "format", format); -+ stream_types[i] = mf_media_type_from_caps(modified_caps); ++ stream_types[type_count] = mf_media_type_from_caps(modified_caps); + gst_caps_unref(modified_caps); -+ if (!stream_types[i]) -+ { -+ i--; -+ type_count--; -+ } ++ if (stream_types[type_count]) ++ type_count++; + } + g_value_array_free(formats); + gst_caps_unref(src_caps); @@ -89,9 +89,9 @@ index f1e8c5799f7..209753608b6 100644 + } } - else -+ else if (!strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "audio/x-raw")) ++ else if (!strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "audio/x-raw")) + { - stream_type = mf_media_type_from_caps(stream->their_caps); + stream_type = mf_media_type_from_caps(current_caps); + if (stream_type) + { + stream_types = &stream_type; @@ -100,7 +100,7 @@ index f1e8c5799f7..209753608b6 100644 + } + else + { -+ GstCaps *compatible_caps = make_mf_compatible_caps(stream->their_caps); ++ GstCaps *compatible_caps = make_mf_compatible_caps(current_caps); + if (compatible_caps) + { + stream_type = mf_media_type_from_caps(compatible_caps); @@ -113,9 +113,8 @@ index f1e8c5799f7..209753608b6 100644 + } + } - gst_caps_unref(stream->their_caps); + gst_caps_unref(current_caps); - if (!stream_type) -+ + if (!type_count) { + ERR("Failed to establish an IMFMediaType from any of the possible stream caps!\n"); @@ -146,7 +145,6 @@ index f1e8c5799f7..209753608b6 100644 + return S_OK; fail: - ERR("media stream initialization failed with %x\n", hr); if (type_handler) IMFMediaTypeHandler_Release(type_handler); + if (stream_types) diff --git a/patches/mfplat-streaming-support/0006-winegstreamer-Insert-audioconvert-into-decoded-audio.patch b/patches/mfplat-streaming-support/0006-winegstreamer-Insert-audioconvert-into-decoded-audio.patch index de51b7f4..512bf0f4 100644 --- a/patches/mfplat-streaming-support/0006-winegstreamer-Insert-audioconvert-into-decoded-audio.patch +++ b/patches/mfplat-streaming-support/0006-winegstreamer-Insert-audioconvert-into-decoded-audio.patch @@ -1,7 +1,7 @@ -From 35f58b2470a342db3fe665549ac1983b4877157a Mon Sep 17 00:00:00 2001 +From d2b77ee21bad4c0b3964ae828ade406f3b4e7a7c Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 25 Aug 2020 17:37:28 -0500 -Subject: [PATCH 06/52] winegstreamer: Insert audioconvert into decoded audio +Subject: [PATCH] winegstreamer: Insert audioconvert into decoded audio streams. Signed-off-by: Derek Lesho @@ -10,10 +10,10 @@ Signed-off-by: Derek Lesho 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 209753608b6..66cfdbdc0fd 100644 +index a4ad51bb6f5..c5d196c867c 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -476,9 +476,18 @@ static HRESULT media_stream_align_with_mf(struct media_stream *stream) +@@ -449,9 +449,18 @@ static HRESULT media_stream_align_with_mf(struct media_stream *stream) } else if(!strcmp(gst_structure_get_name(gst_caps_get_structure(source_caps, 0)), "audio/x-raw")) { diff --git a/patches/mfplat-streaming-support/0007-winegstreamer-Translate-H.264-caps-to-attributes.patch b/patches/mfplat-streaming-support/0007-winegstreamer-Translate-H.264-caps-to-attributes.patch index 7e8562ac..d9204102 100644 --- a/patches/mfplat-streaming-support/0007-winegstreamer-Translate-H.264-caps-to-attributes.patch +++ b/patches/mfplat-streaming-support/0007-winegstreamer-Translate-H.264-caps-to-attributes.patch @@ -1,15 +1,15 @@ -From 0cb401346e8c106fad5cf1cd4d9364e7508d282b Mon Sep 17 00:00:00 2001 +From d5ea67443337ece97b9bd3243224afae2ca15df0 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 24 Mar 2020 16:00:26 -0500 -Subject: [PATCH 07/52] winegstreamer: Translate H.264 caps to attributes. +Subject: [PATCH] winegstreamer: Translate H.264 caps to attributes. Signed-off-by: Derek Lesho --- - dlls/winegstreamer/mfplat.c | 67 +++++++++++++++++++++++++++++++++++++ - 1 file changed, 67 insertions(+) + dlls/winegstreamer/mfplat.c | 80 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 80 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 3667bc3cc38..77a2dad093a 100644 +index 4d868c616f2..d1554c86a1d 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -26,6 +26,7 @@ @@ -20,14 +20,23 @@ index 3667bc3cc38..77a2dad093a 100644 #include "wine/debug.h" #include "wine/heap.h" -@@ -519,6 +520,72 @@ static IMFMediaType* transform_to_media_type(GstCaps *caps) - FIXME("Unrecognized format.\n"); +@@ -521,6 +522,74 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) + } } } + else if (!(strcmp(mime_type, "video/x-h264"))) + { + const char *profile, *level; + ++ /* validation */ ++ if (strcmp(gst_structure_get_string(info, "stream-format"), "byte-stream")) ++ return NULL; ++ if (strcmp(gst_structure_get_string(info, "alignment"), "au")) ++ return NULL; ++ if (gst_structure_get_value(info, "codec-data")) ++ return NULL; ++ ++ /* conversion */ + IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFVideoFormat_H264); + IMFMediaType_SetUINT32(media_type, &MF_MT_COMPRESSED, TRUE); + @@ -82,17 +91,33 @@ index 3667bc3cc38..77a2dad093a 100644 + FIXME("Unrecognized level %s", level); + } + } -+ gst_caps_set_simple(caps, "stream-format", G_TYPE_STRING, "byte-stream", NULL); -+ gst_caps_set_simple(caps, "alignment", G_TYPE_STRING, "au", NULL); -+ for (unsigned int i = 0; i < gst_caps_get_size(caps); i++) -+ { -+ GstStructure *structure = gst_caps_get_structure (caps, i); -+ gst_structure_remove_field(structure, "codec_data"); -+ } + } else { FIXME("Unrecognized video format %s\n", mime_type); +@@ -607,11 +676,22 @@ GstCaps *make_mf_compatible_caps(GstCaps *caps) + { + GstCaps *ret; + IMFMediaType *media_type; ++ GstStructure *structure; ++ const char *mime_type; + + if (gst_caps_get_size(caps) != 1) + return NULL; + + ret = gst_caps_copy(caps); ++ structure = gst_caps_get_structure(ret, 0); ++ mime_type = gst_structure_get_name(structure); ++ ++ if (!strcmp(mime_type, "video/x-h264")) ++ { ++ gst_caps_set_simple(ret, "stream-format", G_TYPE_STRING, "byte-stream", NULL); ++ gst_caps_set_simple(ret, "alignment", G_TYPE_STRING, "au", NULL); ++ gst_structure_remove_field(structure, "codec_data"); ++ } + + if ((media_type = mf_media_type_from_caps(ret))) + IMFMediaType_Release(media_type); -- 2.28.0 diff --git a/patches/mfplat-streaming-support/0008-winegstreamer-Translate-WMV-caps-to-attributes.patch b/patches/mfplat-streaming-support/0008-winegstreamer-Translate-WMV-caps-to-attributes.patch index 5a693bac..36f022ee 100644 --- a/patches/mfplat-streaming-support/0008-winegstreamer-Translate-WMV-caps-to-attributes.patch +++ b/patches/mfplat-streaming-support/0008-winegstreamer-Translate-WMV-caps-to-attributes.patch @@ -1,7 +1,7 @@ -From 966b172363a8a3e22f9f5585cd41590f6c799b36 Mon Sep 17 00:00:00 2001 +From 7a95da0282a805ca1faabd34698b9a8d5ce5cc5d Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 24 Mar 2020 16:01:20 -0500 -Subject: [PATCH 08/52] winegstreamer: Translate WMV caps to attributes. +Subject: [PATCH] winegstreamer: Translate WMV caps to attributes. Signed-off-by: Derek Lesho --- @@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 51 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 77a2dad093a..3963d97041d 100644 +index d1554c86a1d..7c8632a0c5d 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -457,6 +457,24 @@ uncompressed_formats[] = +@@ -457,6 +457,24 @@ uncompressed_video_formats[] = {&MFVideoFormat_RGB555, GST_VIDEO_FORMAT_BGR15}, }; @@ -34,11 +34,11 @@ index 77a2dad093a..3963d97041d 100644 + } +} + - /* caps will be modified to represent the exact type needed for the format */ - static IMFMediaType* transform_to_media_type(GstCaps *caps) + /* returns NULL if doesn't match exactly */ + IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) { -@@ -586,6 +604,39 @@ static IMFMediaType* transform_to_media_type(GstCaps *caps) - gst_structure_remove_field(structure, "codec_data"); +@@ -590,6 +608,39 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) + } } } + else if (!(strcmp(mime_type, "video/x-wmv"))) diff --git a/patches/mfplat-streaming-support/0009-winegstreamer-Translate-AAC-caps-to-attributes.patch b/patches/mfplat-streaming-support/0009-winegstreamer-Translate-AAC-caps-to-attributes.patch index 889a2849..d79792c3 100644 --- a/patches/mfplat-streaming-support/0009-winegstreamer-Translate-AAC-caps-to-attributes.patch +++ b/patches/mfplat-streaming-support/0009-winegstreamer-Translate-AAC-caps-to-attributes.patch @@ -1,7 +1,7 @@ -From 8cf90bd8896f33646211c5ca6b2b18930789a2b2 Mon Sep 17 00:00:00 2001 +From de8ae8395e20727d8f9a12903ab611b27f6a47cd Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 24 Mar 2020 16:02:27 -0500 -Subject: [PATCH 09/52] winegstreamer: Translate AAC caps to attributes. +Subject: [PATCH] winegstreamer: Translate AAC caps to attributes. Signed-off-by: Derek Lesho --- @@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 108 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 3963d97041d..4cff74f2d41 100644 +index 7c8632a0c5d..9a9e306be9a 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -457,6 +457,15 @@ uncompressed_formats[] = +@@ -457,6 +457,15 @@ uncompressed_video_formats[] = {&MFVideoFormat_RGB555, GST_VIDEO_FORMAT_BGR15}, }; @@ -28,8 +28,8 @@ index 3963d97041d..4cff74f2d41 100644 static void codec_data_to_user_data(GstStructure *structure, IMFMediaType *type) { const GValue *codec_data; -@@ -710,6 +719,105 @@ static IMFMediaType* transform_to_media_type(GstCaps *caps) - ERR("Failed to get audio format\n"); +@@ -707,6 +716,105 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) + return NULL; } } + else if (!(strcmp(mime_type, "audio/mpeg"))) diff --git a/patches/mfplat-streaming-support/0010-winegstreamer-Translate-MPEG-4-Section-2-caps-to-att.patch b/patches/mfplat-streaming-support/0010-winegstreamer-Translate-MPEG-4-Section-2-caps-to-att.patch index 19c33544..23cb1449 100644 --- a/patches/mfplat-streaming-support/0010-winegstreamer-Translate-MPEG-4-Section-2-caps-to-att.patch +++ b/patches/mfplat-streaming-support/0010-winegstreamer-Translate-MPEG-4-Section-2-caps-to-att.patch @@ -1,8 +1,7 @@ -From 2100ecb112e69962c11e4d5c841cc0ab003db6bb Mon Sep 17 00:00:00 2001 +From 3468a6f2e9d5c5971794af548bf05d5aa01ae589 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 25 Mar 2020 13:36:19 -0500 -Subject: [PATCH 10/52] winegstreamer: Translate MPEG-4 Section-2 caps to - attributes. +Subject: [PATCH] winegstreamer: Translate MPEG-4 Section-2 caps to attributes. Signed-off-by: Derek Lesho --- @@ -10,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 16 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 4cff74f2d41..f99e5c6636d 100644 +index 9a9e306be9a..c586e10058b 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -646,6 +646,22 @@ static IMFMediaType* transform_to_media_type(GstCaps *caps) +@@ -650,6 +650,22 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) codec_data_to_user_data(info, media_type); } diff --git a/patches/mfplat-streaming-support/0011-winegstreamer-Translate-WMA-caps-to-attributes.patch b/patches/mfplat-streaming-support/0011-winegstreamer-Translate-WMA-caps-to-attributes.patch index 489a8641..5ece5144 100644 --- a/patches/mfplat-streaming-support/0011-winegstreamer-Translate-WMA-caps-to-attributes.patch +++ b/patches/mfplat-streaming-support/0011-winegstreamer-Translate-WMA-caps-to-attributes.patch @@ -1,7 +1,7 @@ -From 8b3eaedb9bb5ce6813f45e2553c657133d80718f Mon Sep 17 00:00:00 2001 +From e8311eb10def9d4d81db18ed8ffb220b9cbdf382 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 12 May 2020 17:05:41 -0500 -Subject: [PATCH 11/52] winegstreamer: Translate WMA caps to attributes. +Subject: [PATCH] winegstreamer: Translate WMA caps to attributes. Signed-off-by: Derek Lesho --- @@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 24 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index f99e5c6636d..2a8c2050ff9 100644 +index c586e10058b..8318a66753b 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -834,6 +834,30 @@ static IMFMediaType* transform_to_media_type(GstCaps *caps) +@@ -831,6 +831,30 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) FIXME("Unhandled mpegversion %d\n", mpeg_version); } } diff --git a/patches/mfplat-streaming-support/0012-winegstreamer-Implement-IMFMediaSource-CreatePresent.patch b/patches/mfplat-streaming-support/0012-winegstreamer-Implement-IMFMediaSource-CreatePresent.patch index b50ec252..c5e8ef8c 100644 --- a/patches/mfplat-streaming-support/0012-winegstreamer-Implement-IMFMediaSource-CreatePresent.patch +++ b/patches/mfplat-streaming-support/0012-winegstreamer-Implement-IMFMediaSource-CreatePresent.patch @@ -1,7 +1,7 @@ -From 50c496fa883c7a3fae0e991b7bcc96136a77a3df Mon Sep 17 00:00:00 2001 +From 7eed41658ef481fce3dc463e7a863c37fa0f9e61 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 31 Mar 2020 11:21:21 -0500 -Subject: [PATCH 12/52] winegstreamer: Implement +Subject: [PATCH] winegstreamer: Implement IMFMediaSource::CreatePresentationDescriptor. Signed-off-by: Derek Lesho @@ -50,10 +50,10 @@ index 309f7b669a4..72d06e31880 100644 ok(hr == S_OK, "Unexpected hr %#x.\n", hr); diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 66cfdbdc0fd..6c0c212a100 100644 +index c5d196c867c..bbf784090f1 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -70,6 +70,7 @@ struct media_source +@@ -69,6 +69,7 @@ struct media_source IMFByteStream *byte_stream; struct media_stream **streams; ULONG stream_count; @@ -61,7 +61,7 @@ index 66cfdbdc0fd..6c0c212a100 100644 GstBus *bus; GstElement *container; GstElement *decodebin; -@@ -837,12 +838,19 @@ static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource * +@@ -803,12 +804,19 @@ static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource * { struct media_source *source = impl_from_IMFMediaSource(iface); @@ -83,7 +83,7 @@ index 66cfdbdc0fd..6c0c212a100 100644 } static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationDescriptor *descriptor, -@@ -904,6 +912,8 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +@@ -871,6 +879,8 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) if (source->their_sink) gst_object_unref(GST_OBJECT(source->their_sink)); @@ -92,16 +92,16 @@ index 66cfdbdc0fd..6c0c212a100 100644 if (source->event_queue) IMFMediaEventQueue_Shutdown(source->event_queue); if (source->byte_stream) -@@ -1074,6 +1084,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ - GST_STATIC_CAPS_ANY); +@@ -977,6 +987,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + GST_STATIC_PAD_TEMPLATE("mf_src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); struct media_source *object = heap_alloc_zero(sizeof(*object)); + IMFStreamDescriptor **descriptors = NULL; + unsigned int i; HRESULT hr; int ret; - -@@ -1149,6 +1160,25 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ - goto fail; +@@ -1063,6 +1074,25 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + gst_sample_unref(preroll); } + /* init presentation descriptor */ @@ -126,7 +126,7 @@ index 66cfdbdc0fd..6c0c212a100 100644 object->state = SOURCE_STOPPED; *out_media_source = object; -@@ -1157,6 +1187,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -1071,6 +1101,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ fail: WARN("Failed to construct MFMediaSource, hr %#x.\n", hr); diff --git a/patches/mfplat-streaming-support/0013-winegstreamer-Introduce-IMFMediaType-GstCaps-convert.patch b/patches/mfplat-streaming-support/0013-winegstreamer-Introduce-IMFMediaType-GstCaps-convert.patch index 55a104e4..25fe8e49 100644 --- a/patches/mfplat-streaming-support/0013-winegstreamer-Introduce-IMFMediaType-GstCaps-convert.patch +++ b/patches/mfplat-streaming-support/0013-winegstreamer-Introduce-IMFMediaType-GstCaps-convert.patch @@ -1,8 +1,7 @@ -From 309bf9ba18c12e8f6eb9a29c7455983fa7bf3603 Mon Sep 17 00:00:00 2001 +From 246718182565c586c0968e0fc58aa5b16734916f Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 24 Mar 2020 16:15:35 -0500 -Subject: [PATCH 13/52] winegstreamer: Introduce IMFMediaType -> GstCaps - converter. +Subject: [PATCH] winegstreamer: Introduce IMFMediaType -> GstCaps converter. Signed-off-by: Derek Lesho --- @@ -11,22 +10,22 @@ Signed-off-by: Derek Lesho 2 files changed, 150 insertions(+) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index 86392eea4e3..d0628cc8df3 100644 +index 7ec71d40800..00e28f1d092 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -58,6 +58,7 @@ extern HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; - GstCaps *make_mf_compatible_caps(GstCaps *caps); - IMFMediaType *mf_media_type_from_caps(GstCaps *caps); -+GstCaps *caps_from_mf_media_type(IMFMediaType *type); + GstCaps *make_mf_compatible_caps(GstCaps *caps) DECLSPEC_HIDDEN; + IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) DECLSPEC_HIDDEN; ++GstCaps *caps_from_mf_media_type(IMFMediaType *type) DECLSPEC_HIDDEN; HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 2a8c2050ff9..648cdd23421 100644 +index 8318a66753b..7e564b0c8f9 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -910,3 +910,152 @@ GstCaps *make_mf_compatible_caps(GstCaps *caps) +@@ -903,3 +903,152 @@ GstCaps *make_mf_compatible_caps(GstCaps *caps) return ret; } @@ -72,11 +71,11 @@ index 2a8c2050ff9..648cdd23421 100644 + + output = gst_caps_new_empty_simple("video/x-raw"); + -+ for (i = 0; i < ARRAY_SIZE(uncompressed_formats); i++) ++ for (i = 0; i < ARRAY_SIZE(uncompressed_video_formats); i++) + { -+ if (IsEqualGUID(uncompressed_formats[i].subtype, &subtype)) ++ if (IsEqualGUID(uncompressed_video_formats[i].subtype, &subtype)) + { -+ format = uncompressed_formats[i].format; ++ format = uncompressed_video_formats[i].format; + break; + } + } diff --git a/patches/mfplat-streaming-support/0014-winegstreamer-Translate-H.264-attributes-to-caps.patch b/patches/mfplat-streaming-support/0014-winegstreamer-Translate-H.264-attributes-to-caps.patch index 0906c7ff..f66f4420 100644 --- a/patches/mfplat-streaming-support/0014-winegstreamer-Translate-H.264-attributes-to-caps.patch +++ b/patches/mfplat-streaming-support/0014-winegstreamer-Translate-H.264-attributes-to-caps.patch @@ -1,7 +1,7 @@ -From 98ccb2c72d763514c1e3232e93dab697bede4cad Mon Sep 17 00:00:00 2001 +From c3939ab363461ce89398cbba13812c676d1a1352 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 24 Mar 2020 16:18:40 -0500 -Subject: [PATCH 14/52] winegstreamer: Translate H.264 attributes to caps. +Subject: [PATCH] winegstreamer: Translate H.264 attributes to caps. Signed-off-by: Derek Lesho --- @@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 48 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 648cdd23421..bc0259f2a64 100644 +index 7e564b0c8f9..ebef33ed234 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -980,6 +980,54 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) +@@ -973,6 +973,54 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) } } diff --git a/patches/mfplat-streaming-support/0015-winegstreamer-Translate-WMV-attributes-to-caps.patch b/patches/mfplat-streaming-support/0015-winegstreamer-Translate-WMV-attributes-to-caps.patch index e41e7f4f..a7b77b04 100644 --- a/patches/mfplat-streaming-support/0015-winegstreamer-Translate-WMV-attributes-to-caps.patch +++ b/patches/mfplat-streaming-support/0015-winegstreamer-Translate-WMV-attributes-to-caps.patch @@ -1,7 +1,7 @@ -From 884a00b050f17191a7c48364de4e55e5fcc17cc9 Mon Sep 17 00:00:00 2001 +From 13f27bdf8e6a4b64413fb939dff9c788e9291729 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 24 Mar 2020 16:20:17 -0500 -Subject: [PATCH 15/52] winegstreamer: Translate WMV attributes to caps. +Subject: [PATCH] winegstreamer: Translate WMV attributes to caps. Signed-off-by: Derek Lesho --- @@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 51 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index bc0259f2a64..a9abffedcd0 100644 +index ebef33ed234..0016fc4347c 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -911,6 +911,21 @@ GstCaps *make_mf_compatible_caps(GstCaps *caps) +@@ -904,6 +904,21 @@ GstCaps *make_mf_compatible_caps(GstCaps *caps) return ret; } @@ -34,7 +34,7 @@ index bc0259f2a64..a9abffedcd0 100644 GstCaps *caps_from_mf_media_type(IMFMediaType *type) { GUID major_type; -@@ -1028,6 +1043,42 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) +@@ -1021,6 +1036,42 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) gst_caps_set_simple(output, "level", G_TYPE_STRING, level, NULL); } } diff --git a/patches/mfplat-streaming-support/0016-winegstreamer-Translate-AAC-attributes-to-caps.patch b/patches/mfplat-streaming-support/0016-winegstreamer-Translate-AAC-attributes-to-caps.patch index d9d845f6..03f54b43 100644 --- a/patches/mfplat-streaming-support/0016-winegstreamer-Translate-AAC-attributes-to-caps.patch +++ b/patches/mfplat-streaming-support/0016-winegstreamer-Translate-AAC-attributes-to-caps.patch @@ -1,7 +1,7 @@ -From 7fd3f66161894a1242d43b6abd54e65ed6831270 Mon Sep 17 00:00:00 2001 +From 57f0b6bf1dac9c2269d8deefa204f6dd0e074f3a Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 21 Apr 2020 10:31:02 -0500 -Subject: [PATCH 16/52] winegstreamer: Translate AAC attributes to caps. +Subject: [PATCH] winegstreamer: Translate AAC attributes to caps. Signed-off-by: Derek Lesho --- @@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 66 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index a9abffedcd0..75d8e338128 100644 +index 0016fc4347c..89eeda37994 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -1128,6 +1128,72 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) +@@ -1121,6 +1121,72 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) return NULL; } } diff --git a/patches/mfplat-streaming-support/0017-winegstreamer-Translate-MPEG-4-Section-2-attributes-.patch b/patches/mfplat-streaming-support/0017-winegstreamer-Translate-MPEG-4-Section-2-attributes-.patch index dbab3b69..ff1374b8 100644 --- a/patches/mfplat-streaming-support/0017-winegstreamer-Translate-MPEG-4-Section-2-attributes-.patch +++ b/patches/mfplat-streaming-support/0017-winegstreamer-Translate-MPEG-4-Section-2-attributes-.patch @@ -1,8 +1,7 @@ -From f15f0c3530b20cff7de1e3295d2b7978e9b0d2c7 Mon Sep 17 00:00:00 2001 +From 7b07befce18653b72e93cecbf0bba3e41fd2bf86 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Mon, 11 May 2020 16:03:09 -0500 -Subject: [PATCH 17/52] winegstreamer: Translate MPEG-4 Section-2 attributes to - caps. +Subject: [PATCH] winegstreamer: Translate MPEG-4 Section-2 attributes to caps. Signed-off-by: Derek Lesho --- @@ -10,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 8 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 75d8e338128..b7fa283133c 100644 +index 89eeda37994..144b6281720 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -1079,6 +1079,14 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) +@@ -1072,6 +1072,14 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) user_data_to_codec_data(type, output); } diff --git a/patches/mfplat-streaming-support/0018-winegstreamer-Translate-WMA-attributes-to-caps.patch b/patches/mfplat-streaming-support/0018-winegstreamer-Translate-WMA-attributes-to-caps.patch index 5877ab3e..36b19f79 100644 --- a/patches/mfplat-streaming-support/0018-winegstreamer-Translate-WMA-attributes-to-caps.patch +++ b/patches/mfplat-streaming-support/0018-winegstreamer-Translate-WMA-attributes-to-caps.patch @@ -1,7 +1,7 @@ -From ccb8ad4ef7bc35a62f7ec58d4ce591f6e2678598 Mon Sep 17 00:00:00 2001 +From 9c8ecccf7f94e897f1819076ec45b6a750785520 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 12 May 2020 17:05:59 -0500 -Subject: [PATCH 18/52] winegstreamer: Translate WMA attributes to caps. +Subject: [PATCH] winegstreamer: Translate WMA attributes to caps. Signed-off-by: Derek Lesho --- @@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 15 insertions(+) diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index b7fa283133c..b291b21e8b5 100644 +index 144b6281720..015f23dd2dc 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -1202,6 +1202,21 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) +@@ -1195,6 +1195,21 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) CoTaskMemFree(user_data); } } diff --git a/patches/mfplat-streaming-support/0019-winegstreamer-Implement-IMFMediaSource-Start.patch b/patches/mfplat-streaming-support/0019-winegstreamer-Implement-IMFMediaSource-Start.patch index 21da0204..e625eba1 100644 --- a/patches/mfplat-streaming-support/0019-winegstreamer-Implement-IMFMediaSource-Start.patch +++ b/patches/mfplat-streaming-support/0019-winegstreamer-Implement-IMFMediaSource-Start.patch @@ -1,13 +1,13 @@ -From d883eb8c94f0778d4ef955480a3862d575f7130a Mon Sep 17 00:00:00 2001 +From e6c2b857eb4715a114a1613f6b9324b68dd3ec1b Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 31 Mar 2020 15:10:03 -0500 -Subject: [PATCH 19/52] winegstreamer: Implement IMFMediaSource::Start. +Subject: [PATCH] winegstreamer: Implement IMFMediaSource::Start. Signed-off-by: Derek Lesho --- dlls/mfplat/tests/mfplat.c | 8 +- - dlls/winegstreamer/media_source.c | 313 +++++++++++++++++++++++++++++- - 2 files changed, 314 insertions(+), 7 deletions(-) + dlls/winegstreamer/media_source.c | 319 +++++++++++++++++++++++++++++- + 2 files changed, 317 insertions(+), 10 deletions(-) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 72d06e31880..e6a1694a11f 100644 @@ -52,10 +52,10 @@ index 72d06e31880..e6a1694a11f 100644 IMFPresentationDescriptor_Release(descriptor); diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 6c0c212a100..c893664fbec 100644 +index bbf784090f1..b35c8bf48d2 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -56,16 +56,41 @@ struct media_stream +@@ -56,15 +56,40 @@ struct media_stream STREAM_STUB, STREAM_INACTIVE, STREAM_SHUTDOWN, @@ -63,7 +63,6 @@ index 6c0c212a100..c893664fbec 100644 } state; /* used when in STUB state: */ DWORD stream_id; - HANDLE caps_event; + BOOL eos; +}; + @@ -97,7 +96,7 @@ index 6c0c212a100..c893664fbec 100644 IMFMediaEventQueue *event_queue; IMFByteStream *byte_stream; struct media_stream **streams; -@@ -79,6 +104,7 @@ struct media_source +@@ -78,6 +103,7 @@ struct media_source { SOURCE_OPENING, SOURCE_STOPPED, @@ -105,10 +104,11 @@ index 6c0c212a100..c893664fbec 100644 SOURCE_SHUTDOWN, } state; HANDLE all_streams_event; -@@ -94,6 +120,264 @@ static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *ifac +@@ -93,7 +119,265 @@ static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *ifac return CONTAINING_RECORD(iface, struct media_source, IMFMediaSource_iface); } +-static GstFlowReturn bytestream_wrapper_pull(GstPad *pad, GstObject *parent, guint64 ofs, guint len, +static inline struct media_source *impl_from_async_commands_callback_IMFAsyncCallback(IMFAsyncCallback *iface) +{ + return CONTAINING_RECORD(iface, struct media_source, async_commands_callback); @@ -367,10 +367,22 @@ index 6c0c212a100..c893664fbec 100644 + source_async_commands_Invoke, +}; + - GstFlowReturn pull_from_bytestream(GstPad *pad, GstObject *parent, guint64 ofs, guint len, ++GstFlowReturn bytestream_wrapper_pull(GstPad *pad, GstObject *parent, guint64 ofs, guint len, GstBuffer **buf) { -@@ -854,16 +1138,32 @@ static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource * + struct media_source *source = gst_pad_get_element_private(pad); +@@ -242,8 +526,8 @@ GstBusSyncReply bus_watch(GstBus *bus, GstMessage *message, gpointer user) + break; + } + +- gst_message_unref(message); +- return GST_BUS_DROP; ++ /* FIXME: drop messages and find a substitute for gst_bus_poll */ ++ return GST_BUS_PASS; + } + + static HRESULT WINAPI media_stream_QueryInterface(IMFMediaStream *iface, REFIID riid, void **out) +@@ -820,16 +1104,32 @@ static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource * } static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationDescriptor *descriptor, @@ -406,7 +418,7 @@ index 6c0c212a100..c893664fbec 100644 } static HRESULT WINAPI media_source_Stop(IMFMediaSource *iface) -@@ -931,6 +1231,9 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +@@ -898,6 +1198,9 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) if (source->all_streams_event) CloseHandle(source->all_streams_event); @@ -416,7 +428,7 @@ index 6c0c212a100..c893664fbec 100644 return S_OK; } -@@ -1092,6 +1395,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -996,6 +1299,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ return E_OUTOFMEMORY; object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl; @@ -424,7 +436,7 @@ index 6c0c212a100..c893664fbec 100644 object->ref = 1; object->byte_stream = bytestream; IMFByteStream_AddRef(bytestream); -@@ -1100,6 +1404,9 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -1004,6 +1308,9 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ if (FAILED(hr = MFCreateEventQueue(&object->event_queue))) goto fail; @@ -433,7 +445,7 @@ index 6c0c212a100..c893664fbec 100644 + object->container = gst_bin_new(NULL); object->bus = gst_bus_new(); - gst_bus_set_sync_handler(object->bus, watch_source_bus_wrapper, object, NULL); + gst_bus_set_sync_handler(object->bus, mf_src_bus_watch_wrapper, object, NULL); -- 2.28.0 diff --git a/patches/mfplat-streaming-support/0020-winegstreamer-Implement-IMFMediaStream-RequestSample.patch b/patches/mfplat-streaming-support/0020-winegstreamer-Implement-IMFMediaStream-RequestSample.patch index 2a75ba03..4ea24e31 100644 --- a/patches/mfplat-streaming-support/0020-winegstreamer-Implement-IMFMediaStream-RequestSample.patch +++ b/patches/mfplat-streaming-support/0020-winegstreamer-Implement-IMFMediaStream-RequestSample.patch @@ -1,7 +1,7 @@ -From 366946876d7a53f80d91749f290f511294415cf5 Mon Sep 17 00:00:00 2001 +From b72b32c437bb27a46320d8a143b503a6cd7ee600 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 25 Mar 2020 10:43:03 -0500 -Subject: [PATCH 20/52] winegstreamer: Implement IMFMediaStream::RequestSample. +Subject: [PATCH] winegstreamer: Implement IMFMediaStream::RequestSample. Signed-off-by: Derek Lesho --- @@ -38,22 +38,22 @@ index e6a1694a11f..6dd2c3cbe96 100644 IMFMediaTypeHandler_Release(handler); IMFPresentationDescriptor_Release(descriptor); diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index d0628cc8df3..664733c74cd 100644 +index 00e28f1d092..df1e643c3f6 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -59,6 +59,7 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HI - GstCaps *make_mf_compatible_caps(GstCaps *caps); - IMFMediaType *mf_media_type_from_caps(GstCaps *caps); - GstCaps *caps_from_mf_media_type(IMFMediaType *type); -+IMFSample *mf_sample_from_gst_buffer(GstBuffer *in); + GstCaps *make_mf_compatible_caps(GstCaps *caps) DECLSPEC_HIDDEN; + IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) DECLSPEC_HIDDEN; + GstCaps *caps_from_mf_media_type(IMFMediaType *type) DECLSPEC_HIDDEN; ++IMFSample *mf_sample_from_gst_buffer(GstBuffer *in) DECLSPEC_HIDDEN; HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index c893664fbec..15ad1796563 100644 +index b35c8bf48d2..90347f365cb 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -67,6 +67,7 @@ struct media_stream +@@ -66,6 +66,7 @@ struct media_stream enum source_async_op { SOURCE_ASYNC_START, @@ -61,7 +61,7 @@ index c893664fbec..15ad1796563 100644 }; struct source_async_command -@@ -82,6 +83,11 @@ struct source_async_command +@@ -81,6 +82,11 @@ struct source_async_command GUID format; PROPVARIANT position; } start; @@ -73,7 +73,7 @@ index c893664fbec..15ad1796563 100644 } u; }; -@@ -341,6 +347,78 @@ static HRESULT start_pipeline(struct media_source *source, struct source_async_c +@@ -340,6 +346,78 @@ static HRESULT start_pipeline(struct media_source *source, struct source_async_c return S_OK; } @@ -152,7 +152,7 @@ index c893664fbec..15ad1796563 100644 static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result) { struct media_source *source = impl_from_async_commands_callback_IMFAsyncCallback(iface); -@@ -360,6 +438,9 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA +@@ -359,6 +437,9 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA case SOURCE_ASYNC_START: start_pipeline(source, command); break; @@ -162,7 +162,7 @@ index c893664fbec..15ad1796563 100644 default: ; } -@@ -694,13 +775,37 @@ static HRESULT WINAPI media_stream_GetStreamDescriptor(IMFMediaStream* iface, IM +@@ -667,13 +748,37 @@ static HRESULT WINAPI media_stream_GetStreamDescriptor(IMFMediaStream* iface, IM static HRESULT WINAPI media_stream_RequestSample(IMFMediaStream *iface, IUnknown *token) { struct media_stream *stream = impl_from_IMFMediaStream(iface); @@ -201,19 +201,19 @@ index c893664fbec..15ad1796563 100644 } static const IMFMediaStreamVtbl media_stream_vtbl = -@@ -873,6 +978,7 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD +@@ -846,6 +951,7 @@ static HRESULT new_media_stream(struct media_source *source, GstPad *pad, DWORD object->stream_id = stream_id; object->state = STREAM_STUB; + object->eos = FALSE; - object->caps_event = CreateEventA(NULL, TRUE, FALSE, NULL); - + if (FAILED(hr = MFCreateEventQueue(&object->event_queue))) + goto fail; diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index b291b21e8b5..839f337538d 100644 +index 015f23dd2dc..6f88048cece 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -1247,3 +1247,93 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) +@@ -1240,3 +1240,93 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) FIXME("Unrecognized major type %s\n", debugstr_guid(&major_type)); return NULL; } diff --git a/patches/mfplat-streaming-support/0021-winegstreamer-Implement-IMFMediaSource-GetCharacteri.patch b/patches/mfplat-streaming-support/0021-winegstreamer-Implement-IMFMediaSource-GetCharacteri.patch index b97a5a84..9efab22f 100644 --- a/patches/mfplat-streaming-support/0021-winegstreamer-Implement-IMFMediaSource-GetCharacteri.patch +++ b/patches/mfplat-streaming-support/0021-winegstreamer-Implement-IMFMediaSource-GetCharacteri.patch @@ -1,8 +1,7 @@ -From 625df79a05531671aeea9947ccd393372d32f6c1 Mon Sep 17 00:00:00 2001 +From ee4b5e9d3bef0c765aa3a3ff2523b7646b9335d5 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 31 Mar 2020 15:15:07 -0500 -Subject: [PATCH 21/52] winegstreamer: Implement - IMFMediaSource::GetCharacteristics. +Subject: [PATCH] winegstreamer: Implement IMFMediaSource::GetCharacteristics. Signed-off-by: Derek Lesho --- @@ -10,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 15ad1796563..b163472947b 100644 +index 90347f365cb..c3c4e0b2e9a 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -1216,12 +1216,14 @@ static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWO +@@ -1182,12 +1182,14 @@ static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWO { struct media_source *source = impl_from_IMFMediaSource(iface); diff --git a/patches/mfplat-streaming-support/0022-winegstreamer-Calculate-the-MF_PD_DURATION-of-the-me.patch b/patches/mfplat-streaming-support/0022-winegstreamer-Calculate-the-MF_PD_DURATION-of-the-me.patch index 3a3530dc..b177eea9 100644 --- a/patches/mfplat-streaming-support/0022-winegstreamer-Calculate-the-MF_PD_DURATION-of-the-me.patch +++ b/patches/mfplat-streaming-support/0022-winegstreamer-Calculate-the-MF_PD_DURATION-of-the-me.patch @@ -1,8 +1,8 @@ -From 516f67ab33c1b418fa621a059ce0a5576b92cac1 Mon Sep 17 00:00:00 2001 +From 1ee7c9a0f127775e54956ed085b5412ffd151c1f Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 31 Mar 2020 15:15:50 -0500 -Subject: [PATCH 22/52] winegstreamer: Calculate the MF_PD_DURATION of the - media source's PD. +Subject: [PATCH] winegstreamer: Calculate the MF_PD_DURATION of the media + source's PD. Signed-off-by: Derek Lesho --- @@ -10,10 +10,10 @@ Signed-off-by: Derek Lesho 1 file changed, 40 insertions(+) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index b163472947b..9c546bc4ac5 100644 +index c3c4e0b2e9a..86100d7ff2a 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -1594,6 +1594,46 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -1508,6 +1508,46 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ heap_free(descriptors); descriptors = NULL; diff --git a/patches/mfplat-streaming-support/0023-tools-Add-support-for-multiple-parent-directories.patch b/patches/mfplat-streaming-support/0023-tools-Add-support-for-multiple-parent-directories.patch index b95b197a..3e938090 100644 --- a/patches/mfplat-streaming-support/0023-tools-Add-support-for-multiple-parent-directories.patch +++ b/patches/mfplat-streaming-support/0023-tools-Add-support-for-multiple-parent-directories.patch @@ -1,4 +1,4 @@ -From 197e9857c0d65098111273e1d3219ac90f4896d2 Mon Sep 17 00:00:00 2001 +From 0093ef3bc7c0a236b3450423529ecbf66746b6bc Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 29 Jan 2020 15:37:39 -0600 Subject: [PATCH] tools: Add support for multiple parent directories. @@ -91,7 +91,7 @@ index a92987c2ab5..6bc1b47ca5d 100755 } diff --git a/tools/makedep.c b/tools/makedep.c -index 7fe2c4daf54..55a52603820 100644 +index df3805591ea..df07eec5ab7 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -184,11 +184,11 @@ struct makefile @@ -133,7 +133,7 @@ index 7fe2c4daf54..55a52603820 100644 } if (ret) *filename = src_path; -@@ -4129,13 +4136,13 @@ static void load_sources( struct makefile *make ) +@@ -4119,13 +4126,13 @@ static void load_sources( struct makefile *make ) strarray_set_value( &make->vars, "top_srcdir", root_src_dir_path( "" )); strarray_set_value( &make->vars, "srcdir", src_dir_path( make, "" )); @@ -148,7 +148,7 @@ index 7fe2c4daf54..55a52603820 100644 make->programs = get_expanded_make_var_array( make, "PROGRAMS" ); make->scripts = get_expanded_make_var_array( make, "SCRIPTS" ); make->imports = get_expanded_make_var_array( make, "IMPORTS" ); -@@ -4180,8 +4187,11 @@ static void load_sources( struct makefile *make ) +@@ -4170,8 +4177,11 @@ static void load_sources( struct makefile *make ) strarray_add( &make->include_args, strmake( "-I%s", obj_dir_path( make, "" ))); if (make->src_dir) strarray_add( &make->include_args, strmake( "-I%s", make->src_dir )); diff --git a/patches/mfplat-streaming-support/0024-mf-Introduce-handler-helper.patch b/patches/mfplat-streaming-support/0024-mf-Introduce-handler-helper.patch index ab26a84c..2cb89b5a 100644 --- a/patches/mfplat-streaming-support/0024-mf-Introduce-handler-helper.patch +++ b/patches/mfplat-streaming-support/0024-mf-Introduce-handler-helper.patch @@ -1,7 +1,7 @@ -From 8b0d448ce8e7c3698f7b77dd687fea0676c392c7 Mon Sep 17 00:00:00 2001 +From 8497d396d1fbad6bed91ff7986b7b63cabed2517 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 29 Jan 2020 15:30:49 -0600 -Subject: [PATCH 24/52] mf: Introduce handler helper. +Subject: [PATCH] mf: Introduce handler helper. Signed-off-by: Derek Lesho --- @@ -10,8 +10,8 @@ Signed-off-by: Derek Lesho dlls/mf/handler.h | 30 +++ dlls/mf/main.c | 373 ++++-------------------------- dlls/winegstreamer/Makefile.in | 3 +- - dlls/winegstreamer/media_source.c | 335 ++------------------------- - 6 files changed, 447 insertions(+), 655 deletions(-) + dlls/winegstreamer/media_source.c | 331 ++------------------------ + 6 files changed, 447 insertions(+), 651 deletions(-) create mode 100644 dlls/mf/handler.c create mode 100644 dlls/mf/handler.h @@ -932,7 +932,7 @@ index e578d194f7f..f2e87494459 100644 media_source.c \ mediatype.c \ diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 9c546bc4ac5..ca799446ad8 100644 +index 86100d7ff2a..e47c4b5a4e1 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -23,6 +23,7 @@ @@ -943,7 +943,7 @@ index 9c546bc4ac5..ca799446ad8 100644 #include #include -@@ -1648,21 +1649,11 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -1562,21 +1563,11 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ return hr; } @@ -966,7 +966,7 @@ index 9c546bc4ac5..ca799446ad8 100644 }; static struct winegstreamer_stream_handler *impl_from_IMFByteStreamHandler(IMFByteStreamHandler *iface) -@@ -1670,11 +1661,6 @@ static struct winegstreamer_stream_handler *impl_from_IMFByteStreamHandler(IMFBy +@@ -1584,11 +1575,6 @@ static struct winegstreamer_stream_handler *impl_from_IMFByteStreamHandler(IMFBy return CONTAINING_RECORD(iface, struct winegstreamer_stream_handler, IMFByteStreamHandler_iface); } @@ -978,7 +978,7 @@ index 9c546bc4ac5..ca799446ad8 100644 static HRESULT WINAPI winegstreamer_stream_handler_QueryInterface(IMFByteStreamHandler *iface, REFIID riid, void **obj) { TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); -@@ -1704,248 +1690,44 @@ static ULONG WINAPI winegstreamer_stream_handler_AddRef(IMFByteStreamHandler *if +@@ -1618,247 +1604,47 @@ static ULONG WINAPI winegstreamer_stream_handler_AddRef(IMFByteStreamHandler *if static ULONG WINAPI winegstreamer_stream_handler_Release(IMFByteStreamHandler *iface) { @@ -1062,8 +1062,7 @@ index 9c546bc4ac5..ca799446ad8 100644 - IPropertyStore_Release(context->props); - if (context->stream) - IMFByteStream_Release(context->stream); -- if (context->url) -- heap_free(context->url); +- heap_free(context->url); - heap_free(context); + handler_destruct(&this->handler); + heap_free(this); @@ -1105,7 +1104,7 @@ index 9c546bc4ac5..ca799446ad8 100644 - HRESULT hr; TRACE("%p, %s, %#x, %p, %p, %p, %p.\n", iface, debugstr_w(url), flags, props, cancel_cookie, callback, state); -- + - if (cancel_cookie) - *cancel_cookie = NULL; - @@ -1166,7 +1165,7 @@ index 9c546bc4ac5..ca799446ad8 100644 - HRESULT hr; TRACE("%p, %p, %p, %p.\n", iface, result, obj_type, object); -- + - EnterCriticalSection(&this->cs); - - LIST_FOR_EACH_ENTRY(cur, &this->results, struct winegstreamer_stream_handler_result, entry) @@ -1206,7 +1205,7 @@ index 9c546bc4ac5..ca799446ad8 100644 - struct winegstreamer_stream_handler_result *found = NULL, *cur; TRACE("%p, %p.\n", iface, cancel_cookie); -- + - EnterCriticalSection(&this->cs); - - LIST_FOR_EACH_ENTRY(cur, &this->results, struct winegstreamer_stream_handler_result, entry) @@ -1234,7 +1233,7 @@ index 9c546bc4ac5..ca799446ad8 100644 } static HRESULT WINAPI winegstreamer_stream_handler_GetMaxNumberOfBytesRequiredForResolution(IMFByteStreamHandler *iface, QWORD *bytes) -@@ -1965,47 +1747,16 @@ static const IMFByteStreamHandlerVtbl winegstreamer_stream_handler_vtbl = +@@ -1878,47 +1664,16 @@ static const IMFByteStreamHandlerVtbl winegstreamer_stream_handler_vtbl = winegstreamer_stream_handler_GetMaxNumberOfBytesRequiredForResolution, }; @@ -1285,7 +1284,7 @@ index 9c546bc4ac5..ca799446ad8 100644 if (FAILED(hr = media_source_constructor(stream, &new_source))) return hr; -@@ -2024,64 +1775,6 @@ static HRESULT winegstreamer_stream_handler_create_object(struct winegstreamer_s +@@ -1937,64 +1692,6 @@ static HRESULT winegstreamer_stream_handler_create_object(struct winegstreamer_s } } @@ -1350,7 +1349,7 @@ index 9c546bc4ac5..ca799446ad8 100644 HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) { struct winegstreamer_stream_handler *this; -@@ -2093,11 +1786,9 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) +@@ -2006,11 +1703,9 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) if (!this) return E_OUTOFMEMORY; diff --git a/patches/mfplat-streaming-support/0025-Introduce-IMFSample-GstBuffer-converter.patch b/patches/mfplat-streaming-support/0025-Introduce-IMFSample-GstBuffer-converter.patch index 501e1578..5988ea1b 100644 --- a/patches/mfplat-streaming-support/0025-Introduce-IMFSample-GstBuffer-converter.patch +++ b/patches/mfplat-streaming-support/0025-Introduce-IMFSample-GstBuffer-converter.patch @@ -1,7 +1,7 @@ -From bc33134566348dbd02788a8a203cd0b815056c06 Mon Sep 17 00:00:00 2001 +From 3153e651f5fc3a4be0c5f8c181d41ff93f62ceef Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 25 Mar 2020 10:43:27 -0500 -Subject: [PATCH 25/52] Introduce IMFSample -> GstBuffer converter. +Subject: [PATCH] Introduce IMFSample -> GstBuffer converter. Signed-off-by: Derek Lesho --- @@ -10,22 +10,22 @@ Signed-off-by: Derek Lesho 2 files changed, 75 insertions(+) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index 664733c74cd..d0737442cc3 100644 +index df1e643c3f6..db0ea881a83 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h -@@ -60,6 +60,7 @@ GstCaps *make_mf_compatible_caps(GstCaps *caps); - IMFMediaType *mf_media_type_from_caps(GstCaps *caps); - GstCaps *caps_from_mf_media_type(IMFMediaType *type); - IMFSample *mf_sample_from_gst_buffer(GstBuffer *in); -+GstBuffer *gst_buffer_from_mf_sample(IMFSample *in); +@@ -60,6 +60,7 @@ GstCaps *make_mf_compatible_caps(GstCaps *caps) DECLSPEC_HIDDEN; + IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) DECLSPEC_HIDDEN; + GstCaps *caps_from_mf_media_type(IMFMediaType *type) DECLSPEC_HIDDEN; + IMFSample *mf_sample_from_gst_buffer(GstBuffer *in) DECLSPEC_HIDDEN; ++GstBuffer *gst_buffer_from_mf_sample(IMFSample *in) DECLSPEC_HIDDEN; HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 839f337538d..ae5dcc31825 100644 +index 6f88048cece..805cb1d2393 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c -@@ -1337,3 +1337,77 @@ IMFSample* mf_sample_from_gst_buffer(GstBuffer *gst_buffer) +@@ -1330,3 +1330,77 @@ IMFSample* mf_sample_from_gst_buffer(GstBuffer *gst_buffer) IMFSample_Release(out); return NULL; } diff --git a/patches/mfplat-streaming-support/0026-winegstreamer-Implement-decoder-MFT-on-gstreamer.patch b/patches/mfplat-streaming-support/0026-winegstreamer-Implement-decoder-MFT-on-gstreamer.patch index cdf012fa..c8e5ec41 100644 --- a/patches/mfplat-streaming-support/0026-winegstreamer-Implement-decoder-MFT-on-gstreamer.patch +++ b/patches/mfplat-streaming-support/0026-winegstreamer-Implement-decoder-MFT-on-gstreamer.patch @@ -1,7 +1,7 @@ -From f01c8a6745cefd98198e0401a359302aba45ba57 Mon Sep 17 00:00:00 2001 +From af76d7664da7eddadf0eec19c3fa6c70333f63e8 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Mon, 16 Mar 2020 12:09:39 -0500 -Subject: [PATCH 26/52] winegstreamer: Implement decoder MFT on gstreamer. +Subject: [PATCH] winegstreamer: Implement decoder MFT on gstreamer. --- dlls/winegstreamer/Makefile.in | 1 + @@ -29,7 +29,7 @@ index f2e87494459..e2af4085827 100644 pin.c \ qualitycontrol.c \ diff --git a/dlls/winegstreamer/gst_cbs.c b/dlls/winegstreamer/gst_cbs.c -index e56c987eb38..0c0d0a26100 100644 +index 51aaefa911d..261a5b9f4ce 100644 --- a/dlls/winegstreamer/gst_cbs.c +++ b/dlls/winegstreamer/gst_cbs.c @@ -51,6 +51,8 @@ static void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user) @@ -41,9 +41,9 @@ index e56c987eb38..0c0d0a26100 100644 pthread_mutex_lock(&cbdata->lock); cbdata->finished = 1; -@@ -417,3 +419,66 @@ GstPadProbeReturn caps_listener_wrapper(GstPad *pad, GstPadProbeInfo *info, gpoi +@@ -404,3 +406,66 @@ void mf_src_no_more_pads_wrapper(GstElement *element, gpointer user) - return cbdata.u.pad_probe_data.ret; + call_cb(&cbdata); } + +gboolean activate_push_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) @@ -109,12 +109,12 @@ index e56c987eb38..0c0d0a26100 100644 + return cbdata.u.new_sample_data.ret; +} diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h -index 7173c09746e..7dc60f961ba 100644 +index a48999bbf71..6659aedefa5 100644 --- a/dlls/winegstreamer/gst_cbs.h +++ b/dlls/winegstreamer/gst_cbs.h -@@ -54,6 +54,12 @@ enum CB_TYPE { - SOURCE_ALL_STREAMS, - STREAM_PAD_EVENT, +@@ -53,6 +53,12 @@ enum CB_TYPE { + MF_SRC_STREAM_REMOVED, + MF_SRC_NO_MORE_PADS, MEDIA_SOURCE_MAX, + ACTIVATE_PUSH_MODE, + QUERY_INPUT_SRC, @@ -125,10 +125,10 @@ index 7173c09746e..7dc60f961ba 100644 }; struct cb_data { -@@ -144,6 +150,17 @@ struct cb_data { - gpointer user; - GstPadProbeReturn ret; - } pad_probe_data; +@@ -137,6 +143,17 @@ struct cb_data { + GstQuery *query; + gboolean ret; + } query_sink_data; + struct chain_data { + GstPad *pad; + GstObject *parent; @@ -143,7 +143,7 @@ index 7173c09746e..7dc60f961ba 100644 } u; int finished; -@@ -155,6 +172,7 @@ struct cb_data { +@@ -148,6 +165,7 @@ struct cb_data { void mark_wine_thread(void) DECLSPEC_HIDDEN; void perform_cb_gstdemux(struct cb_data *data) DECLSPEC_HIDDEN; void perform_cb_media_source(struct cb_data *data) DECLSPEC_HIDDEN; @@ -151,10 +151,10 @@ index 7173c09746e..7dc60f961ba 100644 GstBusSyncReply watch_bus_wrapper(GstBus *bus, GstMessage *msg, gpointer user) DECLSPEC_HIDDEN; void existing_new_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; -@@ -180,5 +198,10 @@ void source_stream_added_wrapper(GstElement *bin, GstPad *pad, gpointer user) DE - void source_stream_removed_wrapper(GstElement *element, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; - void source_all_streams_wrapper(GstElement *element, gpointer user) DECLSPEC_HIDDEN; - GstPadProbeReturn caps_listener_wrapper(GstPad *pad, GstPadProbeInfo *info, gpointer user); +@@ -172,5 +190,10 @@ GstBusSyncReply mf_src_bus_watch_wrapper(GstBus *bus, GstMessage *message, gpoin + void mf_src_stream_added_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; + void mf_src_stream_removed_wrapper(GstElement *element, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; + void mf_src_no_more_pads_wrapper(GstElement *element, gpointer user) DECLSPEC_HIDDEN; +gboolean activate_push_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN; +gboolean query_input_src_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN; +GstBusSyncReply watch_decoder_bus_wrapper(GstBus *bus, GstMessage *message, gpointer user) DECLSPEC_HIDDEN; @@ -163,7 +163,7 @@ index 7173c09746e..7dc60f961ba 100644 #endif diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index d0737442cc3..5ff412c8e47 100644 +index db0ea881a83..707fc286a69 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -53,6 +53,7 @@ BOOL init_gstreamer(void) DECLSPEC_HIDDEN; @@ -174,9 +174,9 @@ index d0737442cc3..5ff412c8e47 100644 extern HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) DECLSPEC_HIDDEN; HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; -@@ -62,6 +63,12 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type); - IMFSample *mf_sample_from_gst_buffer(GstBuffer *in); - GstBuffer *gst_buffer_from_mf_sample(IMFSample *in); +@@ -62,6 +63,12 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type) DECLSPEC_HIDDEN; + IMFSample *mf_sample_from_gst_buffer(GstBuffer *in) DECLSPEC_HIDDEN; + GstBuffer *gst_buffer_from_mf_sample(IMFSample *in) DECLSPEC_HIDDEN; +enum decoder_type +{ @@ -1529,7 +1529,7 @@ index 00000000000..025af7b91ae + } +} diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index ae5dcc31825..167f2a185be 100644 +index 805cb1d2393..1d45ba00503 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -406,6 +406,16 @@ failed: @@ -1667,7 +1667,7 @@ index ae5dcc31825..167f2a185be 100644 + return S_OK; +} + - const static struct + static const struct { const GUID *subtype; @@ -461,7 +578,6 @@ struct aac_user_data diff --git a/patches/mfplat-streaming-support/0027-mfreadwrite-Select-all-streams-when-creating-a-sourc.patch b/patches/mfplat-streaming-support/0027-mfreadwrite-Select-all-streams-when-creating-a-sourc.patch index 5d0c043a..0a293ec9 100644 --- a/patches/mfplat-streaming-support/0027-mfreadwrite-Select-all-streams-when-creating-a-sourc.patch +++ b/patches/mfplat-streaming-support/0027-mfreadwrite-Select-all-streams-when-creating-a-sourc.patch @@ -1,7 +1,7 @@ -From 3f8659c74c63e1793000e82fa2a51e377bbc5f5e Mon Sep 17 00:00:00 2001 +From 6c482057a065ea5cf5b75ab095c86657a1c0824b Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Mon, 23 Mar 2020 11:55:41 -0500 -Subject: [PATCH 27/52] mfreadwrite: Select all streams when creating a source +Subject: [PATCH] mfreadwrite: Select all streams when creating a source reader. --- diff --git a/patches/mfplat-streaming-support/0028-Miscellaneous.patch b/patches/mfplat-streaming-support/0028-Miscellaneous.patch index d0639468..44ddd81f 100644 --- a/patches/mfplat-streaming-support/0028-Miscellaneous.patch +++ b/patches/mfplat-streaming-support/0028-Miscellaneous.patch @@ -1,7 +1,7 @@ -From d37c836567ce0d6a280b265c6748a072e0e8814f Mon Sep 17 00:00:00 2001 +From 1dd069c4a5d6827babcc3ed3cf5f185f03f4e1ee Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Mon, 16 Mar 2020 15:27:27 -0500 -Subject: [PATCH 28/52] Miscellaneous +Subject: [PATCH] Miscellaneous --- dlls/mfreadwrite/reader.c | 12 ++- @@ -46,7 +46,7 @@ index 3b1dcbb9636..f8c03e62d35 100644 static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReader *iface, DWORD index, DWORD *reserved, diff --git a/dlls/winegstreamer/gst_cbs.c b/dlls/winegstreamer/gst_cbs.c -index 0c0d0a26100..cf8f33a0272 100644 +index 261a5b9f4ce..81692fdf919 100644 --- a/dlls/winegstreamer/gst_cbs.c +++ b/dlls/winegstreamer/gst_cbs.c @@ -18,6 +18,9 @@ @@ -72,7 +72,7 @@ index 0c0d0a26100..cf8f33a0272 100644 pthread_mutex_lock(&cbdata->lock); cbdata->finished = 1; -@@ -460,17 +469,6 @@ GstBusSyncReply watch_decoder_bus_wrapper(GstBus *bus, GstMessage *message, gpoi +@@ -447,17 +456,6 @@ GstBusSyncReply watch_decoder_bus_wrapper(GstBus *bus, GstMessage *message, gpoi return cbdata.u.watch_bus_data.ret; } @@ -91,10 +91,10 @@ index 0c0d0a26100..cf8f33a0272 100644 { struct cb_data cbdata = {DECODER_NEW_SAMPLE}; diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h -index 7dc60f961ba..c6aa94d1632 100644 +index 6659aedefa5..825b46d13bb 100644 --- a/dlls/winegstreamer/gst_cbs.h +++ b/dlls/winegstreamer/gst_cbs.h -@@ -202,6 +202,5 @@ gboolean activate_push_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode m +@@ -194,6 +194,5 @@ gboolean activate_push_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode m gboolean query_input_src_wrapper(GstPad *pad, GstObject *parent, GstQuery *query) DECLSPEC_HIDDEN; GstBusSyncReply watch_decoder_bus_wrapper(GstBus *bus, GstMessage *message, gpointer user) DECLSPEC_HIDDEN; GstFlowReturn decoder_new_sample_wrapper(GstElement *appsink, gpointer user) DECLSPEC_HIDDEN; @@ -102,10 +102,10 @@ index 7dc60f961ba..c6aa94d1632 100644 #endif diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index ca799446ad8..919f46fd714 100644 +index e47c4b5a4e1..4e9a2cb22bb 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -95,6 +95,8 @@ struct source_async_command +@@ -94,6 +94,8 @@ struct source_async_command struct media_source { IMFMediaSource IMFMediaSource_iface; @@ -114,7 +114,7 @@ index ca799446ad8..919f46fd714 100644 IMFAsyncCallback async_commands_callback; LONG ref; DWORD async_commands_queue; -@@ -127,6 +129,16 @@ static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *ifac +@@ -126,6 +128,16 @@ static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *ifac return CONTAINING_RECORD(iface, struct media_source, IMFMediaSource_iface); } @@ -131,8 +131,8 @@ index ca799446ad8..919f46fd714 100644 static inline struct media_source *impl_from_async_commands_callback_IMFAsyncCallback(IMFAsyncCallback *iface) { return CONTAINING_RECORD(iface, struct media_source, async_commands_callback); -@@ -564,6 +576,11 @@ static gboolean query_bytestream(GstPad *pad, GstObject *parent, GstQuery *query - gst_caps_unref(caps); +@@ -542,6 +554,11 @@ static gboolean bytestream_query(GstPad *pad, GstObject *parent, GstQuery *query + gst_query_add_scheduling_mode(query, GST_PAD_MODE_PULL); return TRUE; } + case GST_QUERY_LATENCY: @@ -143,7 +143,7 @@ index ca799446ad8..919f46fd714 100644 default: { WARN("Unhandled query type %s\n", GST_QUERY_TYPE_NAME(query)); -@@ -632,6 +649,23 @@ GstBusSyncReply watch_source_bus(GstBus *bus, GstMessage *message, gpointer user +@@ -604,6 +621,23 @@ GstBusSyncReply bus_watch(GstBus *bus, GstMessage *message, gpointer user) g_error_free(err); g_free(dbg_info); break; @@ -167,7 +167,7 @@ index ca799446ad8..919f46fd714 100644 default: break; } -@@ -1138,6 +1172,10 @@ static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID +@@ -1104,6 +1138,10 @@ static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID { *out = &source->IMFMediaSource_iface; } @@ -178,7 +178,7 @@ index ca799446ad8..919f46fd714 100644 else { FIXME("(%s, %p)\n", debugstr_guid(riid), out); -@@ -1222,7 +1260,7 @@ static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWO +@@ -1188,7 +1226,7 @@ static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWO if (source->state == SOURCE_SHUTDOWN) return MF_E_SHUTDOWN; @@ -187,7 +187,7 @@ index ca799446ad8..919f46fd714 100644 return S_OK; } -@@ -1363,6 +1401,99 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl = +@@ -1330,6 +1368,99 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl = media_source_Shutdown, }; @@ -287,7 +287,7 @@ index ca799446ad8..919f46fd714 100644 /* If this callback is extended to use any significant win32 APIs, a wrapper function should be added */ gboolean stream_found(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer user) -@@ -1504,6 +1635,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -1408,6 +1539,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ return E_OUTOFMEMORY; object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl; @@ -296,7 +296,7 @@ index ca799446ad8..919f46fd714 100644 object->async_commands_callback.lpVtbl = &source_async_commands_callback_vtbl; object->ref = 1; object->byte_stream = bytestream; -@@ -1595,7 +1728,6 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -1509,7 +1642,6 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ heap_free(descriptors); descriptors = NULL; @@ -304,7 +304,7 @@ index ca799446ad8..919f46fd714 100644 { IMFAttributes *byte_stream_attributes; gint64 total_pres_time = 0; -@@ -1612,6 +1744,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -1526,6 +1658,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ IMFAttributes_Release(byte_stream_attributes); } diff --git a/patches/mfplat-streaming-support/0029-WMV.patch b/patches/mfplat-streaming-support/0029-WMV.patch index face1309..321510f0 100644 --- a/patches/mfplat-streaming-support/0029-WMV.patch +++ b/patches/mfplat-streaming-support/0029-WMV.patch @@ -1,7 +1,7 @@ -From 827be0fc103c7439b64429e0063c57be4c1f3616 Mon Sep 17 00:00:00 2001 +From b02a8be95043ad0279f4bd8e4a96473b9e7abd16 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 25 Mar 2020 19:07:11 -0500 -Subject: [PATCH 29/52] WMV +Subject: [PATCH] WMV --- dlls/winegstreamer/gst_private.h | 1 + @@ -12,7 +12,7 @@ Subject: [PATCH 29/52] WMV 5 files changed, 59 insertions(+) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index 5ff412c8e47..8651e3440e4 100644 +index 707fc286a69..73359dd622d 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -67,6 +67,7 @@ enum decoder_type @@ -52,7 +52,7 @@ index 025af7b91ae..7f2dfc8f292 100644 }; diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 167f2a185be..3e5925e32d2 100644 +index 1d45ba00503..0d1a3527ede 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -416,6 +416,10 @@ static HRESULT aac_decoder_create(REFIID riid, void **ret) diff --git a/patches/mfplat-streaming-support/0030-mf-Ask-for-more-samples-from-upstream-node-when-upon.patch b/patches/mfplat-streaming-support/0030-mf-Ask-for-more-samples-from-upstream-node-when-upon.patch index 5eafebb6..e4e5aec3 100644 --- a/patches/mfplat-streaming-support/0030-mf-Ask-for-more-samples-from-upstream-node-when-upon.patch +++ b/patches/mfplat-streaming-support/0030-mf-Ask-for-more-samples-from-upstream-node-when-upon.patch @@ -1,7 +1,7 @@ -From 399609086d4527338991fae58e915da26c35ab7b Mon Sep 17 00:00:00 2001 +From 889c1646b8b76144c152b1a78a681526b0b39db4 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Thu, 2 Apr 2020 15:42:18 -0500 -Subject: [PATCH 30/52] mf: Ask for more samples from upstream node when upon +Subject: [PATCH] mf: Ask for more samples from upstream node when upon MF_E_TRANSFORM_NEED_MORE_INPUT --- diff --git a/patches/mfplat-streaming-support/0031-winegstreamer-Implement-IMFMedisStream-GetMediaSourc.patch b/patches/mfplat-streaming-support/0031-winegstreamer-Implement-IMFMedisStream-GetMediaSourc.patch index abdae591..c36ecb57 100644 --- a/patches/mfplat-streaming-support/0031-winegstreamer-Implement-IMFMedisStream-GetMediaSourc.patch +++ b/patches/mfplat-streaming-support/0031-winegstreamer-Implement-IMFMedisStream-GetMediaSourc.patch @@ -1,18 +1,17 @@ -From 5f2a5bce733fbe36f776d4bf4d823f6c7bc804ad Mon Sep 17 00:00:00 2001 +From 8b2f90e43b8adb93ff96d30ed65461c166287217 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Thu, 2 Apr 2020 15:46:25 -0500 -Subject: [PATCH 31/52] winegstreamer: Implement - IMFMedisStream::GetMediaSource. +Subject: [PATCH] winegstreamer: Implement IMFMedisStream::GetMediaSource. --- dlls/winegstreamer/media_source.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 919f46fd714..f0a654d1fa4 100644 +index 4e9a2cb22bb..75f22f71af1 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -784,12 +784,15 @@ static HRESULT WINAPI media_stream_GetMediaSource(IMFMediaStream *iface, IMFMedi +@@ -757,12 +757,15 @@ static HRESULT WINAPI media_stream_GetMediaSource(IMFMediaStream *iface, IMFMedi { struct media_stream *stream = impl_from_IMFMediaStream(iface); diff --git a/patches/mfplat-streaming-support/0032-Expose-PCM-output-type-on-AAC-decoder.patch b/patches/mfplat-streaming-support/0032-Expose-PCM-output-type-on-AAC-decoder.patch index 3575fc82..f7ff51b5 100644 --- a/patches/mfplat-streaming-support/0032-Expose-PCM-output-type-on-AAC-decoder.patch +++ b/patches/mfplat-streaming-support/0032-Expose-PCM-output-type-on-AAC-decoder.patch @@ -1,7 +1,7 @@ -From 5c4b42745f37fbe626bdc540eca0e3fbe03fa9b2 Mon Sep 17 00:00:00 2001 +From d891b468dd3433a9963162a8a66ea353518e5dff Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Fri, 3 Apr 2020 11:12:33 -0500 -Subject: [PATCH 32/52] Expose PCM output type on AAC decoder. +Subject: [PATCH] Expose PCM output type on AAC decoder. --- dlls/winegstreamer/mf_decode.c | 2 +- diff --git a/patches/mfplat-streaming-support/0033-mfplat-Add-I420-format-information.patch b/patches/mfplat-streaming-support/0033-mfplat-Add-I420-format-information.patch index 2e86ee6d..e668c96b 100644 --- a/patches/mfplat-streaming-support/0033-mfplat-Add-I420-format-information.patch +++ b/patches/mfplat-streaming-support/0033-mfplat-Add-I420-format-information.patch @@ -1,7 +1,7 @@ -From 6e418d70ca7aa8e5e9468a1bdbcfc1ebec510f26 Mon Sep 17 00:00:00 2001 +From 68f20d94601ac677baedc192ed51d30a9338f4d1 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Fri, 1 May 2020 11:46:26 -0500 -Subject: [PATCH 33/52] mfplat: Add I420 format information. +Subject: [PATCH] mfplat: Add I420 format information. Signed-off-by: Derek Lesho --- diff --git a/patches/mfplat-streaming-support/0034-winegstreamer-Implement-Color-Converter-MFT.patch b/patches/mfplat-streaming-support/0034-winegstreamer-Implement-Color-Converter-MFT.patch index 66356946..fc8f4f8b 100644 --- a/patches/mfplat-streaming-support/0034-winegstreamer-Implement-Color-Converter-MFT.patch +++ b/patches/mfplat-streaming-support/0034-winegstreamer-Implement-Color-Converter-MFT.patch @@ -1,7 +1,7 @@ -From e37aca973f33356cbf1a4098d70a5ba4277be059 Mon Sep 17 00:00:00 2001 +From 4f95a25e71163488ca530edfe92d17b603e7ece0 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Fri, 1 May 2020 13:20:49 -0500 -Subject: [PATCH 34/52] winegstreamer: Implement Color Converter MFT. +Subject: [PATCH] winegstreamer: Implement Color Converter MFT. Signed-off-by: Derek Lesho --- @@ -737,18 +737,18 @@ index 00000000000..f01373907ee +} \ No newline at end of file diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index 8651e3440e4..c41f231f35f 100644 +index 73359dd622d..870344e9273 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -72,4 +72,6 @@ enum decoder_type HRESULT generic_decoder_construct(REFIID riid, void **obj, enum decoder_type) DECLSPEC_HIDDEN; HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; -+HRESULT color_converter_create(REFIID riid, void **ret); ++HRESULT color_converter_create(REFIID riid, void **ret) DECLSPEC_HIDDEN; + #endif /* __GST_PRIVATE_INCLUDED__ */ diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 3e5925e32d2..429a2cfda1c 100644 +index 0d1a3527ede..9bedb53a19f 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -420,6 +420,9 @@ static HRESULT wmv_decoder_create(REFIID riid, void **ret) diff --git a/patches/mfplat-streaming-support/0035-HACK-Set-BPS-to-16-for-output-template.patch b/patches/mfplat-streaming-support/0035-HACK-Set-BPS-to-16-for-output-template.patch index d672d846..2fd37506 100644 --- a/patches/mfplat-streaming-support/0035-HACK-Set-BPS-to-16-for-output-template.patch +++ b/patches/mfplat-streaming-support/0035-HACK-Set-BPS-to-16-for-output-template.patch @@ -1,7 +1,7 @@ -From b4985eaef1d9feb4c67b2b468a67bd550b68c545 Mon Sep 17 00:00:00 2001 +From 057c5c4a76b975ce0ac9f3b97628a709fd98ab5a Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Fri, 1 May 2020 22:36:02 -0500 -Subject: [PATCH 35/52] HACK: Set BPS to 16 for output template. +Subject: [PATCH] HACK: Set BPS to 16 for output template. --- dlls/winegstreamer/mf_decode.c | 5 +++++ diff --git a/patches/mfplat-streaming-support/0036-Improve-tests.patch b/patches/mfplat-streaming-support/0036-Improve-tests.patch index d6b176d0..c8b30bdb 100644 --- a/patches/mfplat-streaming-support/0036-Improve-tests.patch +++ b/patches/mfplat-streaming-support/0036-Improve-tests.patch @@ -1,7 +1,7 @@ -From 6d317b1d419627dd0894ee4e19e0f7e30e564f74 Mon Sep 17 00:00:00 2001 +From 2ffac13dcd31be0dc02d3808e5560c2ef1fd53d3 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Mon, 9 Mar 2020 11:59:17 -0500 -Subject: [PATCH 36/52] Improve tests +Subject: [PATCH] Improve tests --- dlls/mfplat/tests/mfplat.c | 244 +++++++++++++++++++++++++++-- diff --git a/patches/mfplat-streaming-support/0037-Revert-Improve-tests.patch b/patches/mfplat-streaming-support/0037-Revert-Improve-tests.patch index a3dd5463..a8be573e 100644 --- a/patches/mfplat-streaming-support/0037-Revert-Improve-tests.patch +++ b/patches/mfplat-streaming-support/0037-Revert-Improve-tests.patch @@ -1,7 +1,7 @@ -From 5e7790e37314e63183bed11cc5283b22383a2a41 Mon Sep 17 00:00:00 2001 +From 392a1c1f531bccb3720f1acd77b645fa91cec32b Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 25 Mar 2020 13:58:36 -0500 -Subject: [PATCH 37/52] Revert "Improve tests" +Subject: [PATCH] Revert "Improve tests" This reverts commit 603b1717a2b511a66d3be99ab5761d49cd5ef34d. --- diff --git a/patches/mfplat-streaming-support/0038-Report-streams-backwards-and-only-select-one-of-each.patch b/patches/mfplat-streaming-support/0038-Report-streams-backwards-and-only-select-one-of-each.patch index 7c2d216c..0a6186b2 100644 --- a/patches/mfplat-streaming-support/0038-Report-streams-backwards-and-only-select-one-of-each.patch +++ b/patches/mfplat-streaming-support/0038-Report-streams-backwards-and-only-select-one-of-each.patch @@ -1,26 +1,26 @@ -From 7d34ffde0e719704327c261443d0e8dbead7d79f Mon Sep 17 00:00:00 2001 +From f22bb83e21d1cbae2e3ff351a79b3e56949e278e Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 5 May 2020 15:35:16 -0500 -Subject: [PATCH 38/52] Report streams backwards and only select one of each - stream type. +Subject: [PATCH] Report streams backwards and only select one of each stream + type. --- dlls/winegstreamer/media_source.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index f0a654d1fa4..14b7571b80a 100644 +index 75f22f71af1..4b1b049645e 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -1630,6 +1630,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ - GST_STATIC_CAPS_ANY); +@@ -1533,6 +1533,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + GST_STATIC_PAD_TEMPLATE("mf_src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); struct media_source *object = heap_alloc_zero(sizeof(*object)); + BOOL video_selected = FALSE, audio_selected = FALSE; IMFStreamDescriptor **descriptors = NULL; + unsigned int i; HRESULT hr; - int ret; -@@ -1717,15 +1718,34 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -1631,15 +1632,34 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ descriptors = heap_alloc(object->stream_count * sizeof(IMFStreamDescriptor*)); for (unsigned int i = 0; i < object->stream_count; i++) { diff --git a/patches/mfplat-streaming-support/0039-winegstreamer-Implement-IMFMediaSource-Stop.patch b/patches/mfplat-streaming-support/0039-winegstreamer-Implement-IMFMediaSource-Stop.patch index eecdee86..a25ec56c 100644 --- a/patches/mfplat-streaming-support/0039-winegstreamer-Implement-IMFMediaSource-Stop.patch +++ b/patches/mfplat-streaming-support/0039-winegstreamer-Implement-IMFMediaSource-Stop.patch @@ -1,7 +1,7 @@ -From 0ccd1eb9ac722329ed137b49a260a0458ca86a0c Mon Sep 17 00:00:00 2001 +From 6c0fdeea115717bbe046bc08b8b2f96e643fc06a Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Thu, 7 May 2020 13:09:47 -0500 -Subject: [PATCH 39/52] winegstreamer: Implement IMFMediaSource::Stop. +Subject: [PATCH] winegstreamer: Implement IMFMediaSource::Stop. Signed-off-by: Derek Lesho --- @@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 14b7571b80a..a162bad99d8 100644 +index 4b1b049645e..e3b9c9e93d9 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -68,6 +68,7 @@ struct media_stream +@@ -67,6 +67,7 @@ struct media_stream enum source_async_op { SOURCE_ASYNC_START, @@ -20,7 +20,7 @@ index 14b7571b80a..a162bad99d8 100644 SOURCE_ASYNC_REQUEST_SAMPLE, }; -@@ -360,6 +361,23 @@ static HRESULT start_pipeline(struct media_source *source, struct source_async_c +@@ -359,6 +360,23 @@ static HRESULT start_pipeline(struct media_source *source, struct source_async_c return S_OK; } @@ -44,7 +44,7 @@ index 14b7571b80a..a162bad99d8 100644 static void dispatch_end_of_presentation(struct media_source *source) { PROPVARIANT empty = {.vt = VT_EMPTY}; -@@ -451,6 +469,9 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA +@@ -450,6 +468,9 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA case SOURCE_ASYNC_START: start_pipeline(source, command); break; @@ -54,7 +54,7 @@ index 14b7571b80a..a162bad99d8 100644 case SOURCE_ASYNC_REQUEST_SAMPLE: wait_on_sample(command->u.request_sample.stream, command->u.request_sample.token); break; -@@ -1319,13 +1340,18 @@ static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationD +@@ -1285,13 +1306,18 @@ static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationD static HRESULT WINAPI media_source_Stop(IMFMediaSource *iface) { struct media_source *source = impl_from_IMFMediaSource(iface); diff --git a/patches/mfplat-streaming-support/0040-winegstreamer-Introduce-MPEG-4-Section-2-video-decod.patch b/patches/mfplat-streaming-support/0040-winegstreamer-Introduce-MPEG-4-Section-2-video-decod.patch index 624d26a3..84a3d443 100644 --- a/patches/mfplat-streaming-support/0040-winegstreamer-Introduce-MPEG-4-Section-2-video-decod.patch +++ b/patches/mfplat-streaming-support/0040-winegstreamer-Introduce-MPEG-4-Section-2-video-decod.patch @@ -1,8 +1,7 @@ -From aa97104ccc89cd65593354eb51c480454f17e2dd Mon Sep 17 00:00:00 2001 +From 1c815b5fb8de7467ba74d7997889e67b61f8cbed Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Mon, 11 May 2020 16:05:50 -0500 -Subject: [PATCH 40/52] winegstreamer: Introduce MPEG-4 Section-2 video - decoder. +Subject: [PATCH] winegstreamer: Introduce MPEG-4 Section-2 video decoder. Signed-off-by: Derek Lesho --- @@ -14,7 +13,7 @@ Signed-off-by: Derek Lesho 5 files changed, 52 insertions(+) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index c41f231f35f..b609afa555d 100644 +index 870344e9273..3ae89f511e9 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -68,6 +68,7 @@ enum decoder_type @@ -54,7 +53,7 @@ index a86e9db410e..c5d9cbad392 100644 }; diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 429a2cfda1c..5fe7ac4d354 100644 +index 9bedb53a19f..ced442e457b 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -421,6 +421,11 @@ static HRESULT wmv_decoder_create(REFIID riid, void **ret) diff --git a/patches/mfplat-streaming-support/0041-HACK-Switch-between-all-selection-streams-on-MF_SOUR.patch b/patches/mfplat-streaming-support/0041-HACK-Switch-between-all-selection-streams-on-MF_SOUR.patch index 50bdd6e1..f3f78348 100644 --- a/patches/mfplat-streaming-support/0041-HACK-Switch-between-all-selection-streams-on-MF_SOUR.patch +++ b/patches/mfplat-streaming-support/0041-HACK-Switch-between-all-selection-streams-on-MF_SOUR.patch @@ -1,7 +1,7 @@ -From 3babfd1eb77488359a9882eee9619689198c84de Mon Sep 17 00:00:00 2001 +From cf61e79e02c3be82546af3f8d4bbfc3c8450417e Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 12 May 2020 16:48:52 -0500 -Subject: [PATCH 41/52] HACK: Switch between all selection streams on +Subject: [PATCH] HACK: Switch between all selection streams on MF_SOURCE_READER_ANY_STREAM. --- diff --git a/patches/mfplat-streaming-support/0042-winegstreamer-Introduce-WMA-audio-decoder.patch b/patches/mfplat-streaming-support/0042-winegstreamer-Introduce-WMA-audio-decoder.patch index cf89350a..f96b65b0 100644 --- a/patches/mfplat-streaming-support/0042-winegstreamer-Introduce-WMA-audio-decoder.patch +++ b/patches/mfplat-streaming-support/0042-winegstreamer-Introduce-WMA-audio-decoder.patch @@ -1,7 +1,7 @@ -From 311f686ac23db13323f18fa18b8e8c2b9b9143cd Mon Sep 17 00:00:00 2001 +From 084afb7a76a82b32b9f8e54113086b34d89b78fa Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 12 May 2020 16:50:41 -0500 -Subject: [PATCH 42/52] winegstreamer: Introduce WMA audio decoder. +Subject: [PATCH] winegstreamer: Introduce WMA audio decoder. Signed-off-by: Derek Lesho --- @@ -13,7 +13,7 @@ Signed-off-by: Derek Lesho 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index b609afa555d..8e75beb82dd 100644 +index 3ae89f511e9..dc23d5201b1 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -68,6 +68,7 @@ enum decoder_type @@ -53,7 +53,7 @@ index c5d9cbad392..7ce72a9a6a3 100644 &MFMediaType_Video, m4s2_input_types, diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 5fe7ac4d354..28c9beb4649 100644 +index ced442e457b..2544a88a1e0 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -421,6 +421,11 @@ static HRESULT wmv_decoder_create(REFIID riid, void **ret) diff --git a/patches/mfplat-streaming-support/0043-Support-stereo-down-folding.patch b/patches/mfplat-streaming-support/0043-Support-stereo-down-folding.patch index 4b48b2c8..618cdfd7 100644 --- a/patches/mfplat-streaming-support/0043-Support-stereo-down-folding.patch +++ b/patches/mfplat-streaming-support/0043-Support-stereo-down-folding.patch @@ -1,7 +1,7 @@ -From f72479c9e576a766f38bcd9c8c377ee53adbdfe2 Mon Sep 17 00:00:00 2001 +From 06dd39d547650357e6454df6ec91a03718a97ad1 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 13 May 2020 12:32:42 -0500 -Subject: [PATCH 43/52] Support stereo down folding. +Subject: [PATCH] Support stereo down folding. --- dlls/winegstreamer/mf_decode.c | 4 +++- diff --git a/patches/mfplat-streaming-support/0044-winegstreamer-Implement-MF_SD_LANGUAGE.patch b/patches/mfplat-streaming-support/0044-winegstreamer-Implement-MF_SD_LANGUAGE.patch index 3df79fdc..5f7a8d5f 100644 --- a/patches/mfplat-streaming-support/0044-winegstreamer-Implement-MF_SD_LANGUAGE.patch +++ b/patches/mfplat-streaming-support/0044-winegstreamer-Implement-MF_SD_LANGUAGE.patch @@ -1,7 +1,7 @@ -From ada0cb5f81f858b27b3c52f6c10097a7444b8793 Mon Sep 17 00:00:00 2001 +From 481ff66f3eee6690282b3bf22aa10e52d651fe0f Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 11 Aug 2020 13:41:15 -0500 -Subject: [PATCH 44/52] winegstreamer: Implement MF_SD_LANGUAGE. +Subject: [PATCH] winegstreamer: Implement MF_SD_LANGUAGE. Signed-off-by: Derek Lesho --- @@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index a162bad99d8..07c16ac8a07 100644 +index e3b9c9e93d9..39cdce5cd6b 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -1796,8 +1796,12 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -1710,8 +1710,12 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ /* TODO: consider streams which don't start at T=0 */ for (unsigned int i = 0; i < object->stream_count; i++) { @@ -27,7 +27,7 @@ index a162bad99d8..07c16ac8a07 100644 { gint64 stream_pres_time; gst_query_parse_duration(query, NULL, &stream_pres_time); -@@ -1811,6 +1815,31 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ +@@ -1725,6 +1729,31 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ { WARN("Unable to get presentation time of stream %u\n", i); } diff --git a/patches/mfplat-streaming-support/0045-Revert-mf-topoloader-Add-a-structure-for-iterative-b.patch b/patches/mfplat-streaming-support/0045-Revert-mf-topoloader-Add-a-structure-for-iterative-b.patch index ca35ea59..701d91f6 100644 --- a/patches/mfplat-streaming-support/0045-Revert-mf-topoloader-Add-a-structure-for-iterative-b.patch +++ b/patches/mfplat-streaming-support/0045-Revert-mf-topoloader-Add-a-structure-for-iterative-b.patch @@ -1,8 +1,8 @@ -From dfa7779e8abad5caf9beeac2c459e074bc05dbe2 Mon Sep 17 00:00:00 2001 +From 7efb657adae71794dfb6a35824ad29310f8e7e60 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 11 Aug 2020 15:58:42 -0500 -Subject: [PATCH 45/52] Revert "mf/topoloader: Add a structure for iterative - branch resolution." +Subject: [PATCH] Revert "mf/topoloader: Add a structure for iterative branch + resolution." This reverts commit e308d81a617632fe0fedd243952f79e8d9ec05b4. --- @@ -11,7 +11,7 @@ This reverts commit e308d81a617632fe0fedd243952f79e8d9ec05b4. 2 files changed, 4 insertions(+), 143 deletions(-) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c -index f01385cc46c..aa2c5199b95 100644 +index 2c02b1d8e54..1cefeb730b0 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -1400,7 +1400,6 @@ static void test_topology_loader(void) @@ -22,7 +22,7 @@ index f01385cc46c..aa2c5199b95 100644 unsigned int count, value; IMFMediaType *media_type; IMFStreamDescriptor *sd; -@@ -1513,19 +1512,15 @@ todo_wine +@@ -1516,19 +1515,15 @@ todo_wine hr = IMFActivate_ActivateObject(sink_activate, &IID_IMFMediaSink, (void **)&sink); ok(hr == S_OK, "Failed to activate, hr %#x.\n", hr); diff --git a/patches/mfplat-streaming-support/0046-Revert-mf-topoloader-Clone-source-nodes-as-a-first-l.patch b/patches/mfplat-streaming-support/0046-Revert-mf-topoloader-Clone-source-nodes-as-a-first-l.patch index f3cef22e..cedc1454 100644 --- a/patches/mfplat-streaming-support/0046-Revert-mf-topoloader-Clone-source-nodes-as-a-first-l.patch +++ b/patches/mfplat-streaming-support/0046-Revert-mf-topoloader-Clone-source-nodes-as-a-first-l.patch @@ -1,8 +1,8 @@ -From 536cc47d3eaa127969d6a3137e28c7a388e54a58 Mon Sep 17 00:00:00 2001 +From bf023620247ce2c16e15779979d09bb79c883a7e Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 11 Aug 2020 15:59:04 -0500 -Subject: [PATCH 46/52] Revert "mf/topoloader: Clone source nodes as a first - layer of resulting topology." +Subject: [PATCH] Revert "mf/topoloader: Clone source nodes as a first layer of + resulting topology." This reverts commit 16d44b61d15193905ef40661bc1547cb45e7b019. --- diff --git a/patches/mfplat-streaming-support/0047-Revert-mf-topoloader-Switch-to-public-interface-for-.patch b/patches/mfplat-streaming-support/0047-Revert-mf-topoloader-Switch-to-public-interface-for-.patch index 87f0951b..c503769e 100644 --- a/patches/mfplat-streaming-support/0047-Revert-mf-topoloader-Switch-to-public-interface-for-.patch +++ b/patches/mfplat-streaming-support/0047-Revert-mf-topoloader-Switch-to-public-interface-for-.patch @@ -1,8 +1,8 @@ -From 7a0d07917acb65ae5dd623231e5756b2371d1484 Mon Sep 17 00:00:00 2001 +From fabb11d6944d5818f16d8dda1271017708e2c072 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 11 Aug 2020 15:59:13 -0500 -Subject: [PATCH 47/52] Revert "mf/topoloader: Switch to public interface for - initial topology validation." +Subject: [PATCH] Revert "mf/topoloader: Switch to public interface for initial + topology validation." This reverts commit 8e343024b577892bd4908304ded34b758579698d. --- diff --git a/patches/mfplat-streaming-support/0048-mf-Partially-implement-the-topology-loader.patch b/patches/mfplat-streaming-support/0048-mf-Partially-implement-the-topology-loader.patch index ca855348..77e62f4d 100644 --- a/patches/mfplat-streaming-support/0048-mf-Partially-implement-the-topology-loader.patch +++ b/patches/mfplat-streaming-support/0048-mf-Partially-implement-the-topology-loader.patch @@ -1,8 +1,8 @@ -From 5c73b5ab912098d1399781cef97956c188bdc187 Mon Sep 17 00:00:00 2001 +From cfa419226cb036eb250b5d291dacefd18087e48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20G=C3=B3mez=20Del=20Real?= Date: Wed, 1 Apr 2020 16:11:07 -0500 -Subject: [PATCH 48/52] mf: Partially implement the topology loader. +Subject: [PATCH] mf: Partially implement the topology loader. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -14,7 +14,7 @@ Signed-off-by: Sergio Gómez Del Real 2 files changed, 321 insertions(+), 19 deletions(-) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c -index aa2c5199b95..1a08604fb39 100644 +index 1cefeb730b0..77037b5ec9d 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -1428,7 +1428,6 @@ static void test_topology_loader(void) @@ -25,7 +25,7 @@ index aa2c5199b95..1a08604fb39 100644 ok(hr == MF_E_TOPO_UNSUPPORTED, "Unexpected hr %#x.\n", hr); hr = MFCreateSourceResolver(&resolver); -@@ -1473,7 +1472,6 @@ todo_wine +@@ -1476,7 +1475,6 @@ todo_wine /* Source node only. */ hr = IMFTopoLoader_Load(loader, topology, &full_topology, NULL); @@ -33,7 +33,7 @@ index aa2c5199b95..1a08604fb39 100644 ok(hr == MF_E_TOPO_UNSUPPORTED, "Unexpected hr %#x.\n", hr); /* Add grabber sink. */ -@@ -1499,7 +1497,6 @@ todo_wine +@@ -1502,7 +1500,6 @@ todo_wine ok(hr == S_OK, "Failed to add sink node, hr %#x.\n", hr); hr = IMFTopoLoader_Load(loader, topology, &full_topology, NULL); diff --git a/patches/mfplat-streaming-support/0049-mf-Miscelaneous-fixes-to-topology-resolution.patch b/patches/mfplat-streaming-support/0049-mf-Miscelaneous-fixes-to-topology-resolution.patch index e8507cb0..642e7031 100644 --- a/patches/mfplat-streaming-support/0049-mf-Miscelaneous-fixes-to-topology-resolution.patch +++ b/patches/mfplat-streaming-support/0049-mf-Miscelaneous-fixes-to-topology-resolution.patch @@ -1,7 +1,7 @@ -From b66660df34eeb885c28a9381461255712a7b3bd1 Mon Sep 17 00:00:00 2001 +From 1a46eadae66115d4673309e9322c5857c9166ac7 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Thu, 2 Apr 2020 15:43:52 -0500 -Subject: [PATCH 49/52] mf: Miscelaneous fixes to topology resolution. +Subject: [PATCH] mf: Miscelaneous fixes to topology resolution. --- dlls/mf/topology.c | 16 +++++++++------- diff --git a/patches/mfplat-streaming-support/0050-Rewrite-branch-resolver.patch b/patches/mfplat-streaming-support/0050-Rewrite-branch-resolver.patch index d8dc39b3..2a108a57 100644 --- a/patches/mfplat-streaming-support/0050-Rewrite-branch-resolver.patch +++ b/patches/mfplat-streaming-support/0050-Rewrite-branch-resolver.patch @@ -1,7 +1,7 @@ -From ebfd4c055be8d68a34b4bfd6a80e449afce5d9c8 Mon Sep 17 00:00:00 2001 +From ee2c2f5b6c805887d72467f8ad9ff4749679f1d9 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Thu, 2 Apr 2020 15:45:52 -0500 -Subject: [PATCH 50/52] Rewrite branch resolver. +Subject: [PATCH] Rewrite branch resolver. and a HACK: Set output type of found decoder, this should probably happen somewhere else. --- diff --git a/patches/mfplat-streaming-support/0051-mf-sar-Compare-against-native-media-type-in-IsMediaT.patch b/patches/mfplat-streaming-support/0051-mf-sar-Compare-against-native-media-type-in-IsMediaT.patch index 998a143a..b8a8d321 100644 --- a/patches/mfplat-streaming-support/0051-mf-sar-Compare-against-native-media-type-in-IsMediaT.patch +++ b/patches/mfplat-streaming-support/0051-mf-sar-Compare-against-native-media-type-in-IsMediaT.patch @@ -1,7 +1,7 @@ -From 7884831a19a53abf4b33b7c6cabf5a52247c2b32 Mon Sep 17 00:00:00 2001 +From b7de843b1b7d44a731f712793583c537b67afe86 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 26 Aug 2020 10:23:58 -0500 -Subject: [PATCH 51/52] mf/sar: Compare against native media type in +Subject: [PATCH] mf/sar: Compare against native media type in IsMediaTypeSupported. TODO: add tests. diff --git a/patches/mfplat-streaming-support/0052-winegstreamer-Implement-audio-conversion-MFT.patch b/patches/mfplat-streaming-support/0052-winegstreamer-Implement-audio-conversion-MFT.patch index 592924a8..3c6399c6 100644 --- a/patches/mfplat-streaming-support/0052-winegstreamer-Implement-audio-conversion-MFT.patch +++ b/patches/mfplat-streaming-support/0052-winegstreamer-Implement-audio-conversion-MFT.patch @@ -1,7 +1,7 @@ -From 779877a3e829ba787f289ea13047562652e79ad9 Mon Sep 17 00:00:00 2001 +From 6652b5921344eabb5025ea33e329a759a0ff8070 Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Wed, 26 Aug 2020 10:28:37 -0500 -Subject: [PATCH 52/52] winegstreamer: Implement audio conversion MFT. +Subject: [PATCH] winegstreamer: Implement audio conversion MFT. Signed-off-by: Derek Lesho --- @@ -795,18 +795,18 @@ index 00000000000..acb842242f1 +} \ No newline at end of file diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h -index 8e75beb82dd..b505387637b 100644 +index dc23d5201b1..6e718aa6ebe 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -75,5 +75,6 @@ HRESULT generic_decoder_construct(REFIID riid, void **obj, enum decoder_type) DE HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN; - HRESULT color_converter_create(REFIID riid, void **ret); -+HRESULT audio_converter_create(REFIID riid, void **ret); + HRESULT color_converter_create(REFIID riid, void **ret) DECLSPEC_HIDDEN; ++HRESULT audio_converter_create(REFIID riid, void **ret) DECLSPEC_HIDDEN; #endif /* __GST_PRIVATE_INCLUDED__ */ diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c -index 28c9beb4649..3b50264d0f8 100644 +index 2544a88a1e0..ee2778bfae4 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -433,6 +433,8 @@ static HRESULT m4s2_decoder_create(REFIID riid, void **ret) diff --git a/patches/mfplat-streaming-support/0054-winegstreamer-Support-older-versions.patch b/patches/mfplat-streaming-support/0054-winegstreamer-Support-older-versions.patch index 9c3b7970..8b9cf1ca 100644 --- a/patches/mfplat-streaming-support/0054-winegstreamer-Support-older-versions.patch +++ b/patches/mfplat-streaming-support/0054-winegstreamer-Support-older-versions.patch @@ -1,4 +1,4 @@ -From 4275e2569a44939e04098fca9cf8beab4cb3941e Mon Sep 17 00:00:00 2001 +From d3952286014b94744574841c324bec62c84e2bcb Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sun, 13 Sep 2020 13:39:07 +1000 Subject: [PATCH] winegstreamer: Support older versions @@ -6,13 +6,13 @@ Subject: [PATCH] winegstreamer: Support older versions --- configure.ac | 4 +++- dlls/winegstreamer/media_source.c | 2 ++ - 3 files changed, 14 insertions(+), 1 deletion(-) + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 5d882b94d99..8abd50e6690 100644 +index 6b8b6b27bac..efd36af9e5b 100644 --- a/configure.ac +++ b/configure.ac -@@ -1665,7 +1665,9 @@ then +@@ -1642,7 +1642,9 @@ then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[static int a[sizeof(gint64) > 4 ? 1 : -1]; if (a[0]) return 0;]])], [AC_MSG_RESULT([yes]) @@ -24,24 +24,24 @@ index 5d882b94d99..8abd50e6690 100644 ac_glib2_broken=yes WINE_NOTICE([glib-2.0 pkgconfig configuration is for the wrong architecture, winegstreamer won't be built.])])])]) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 07c16ac8a07..3ef258937dc 100644 +index d99b8024599..a6ef561ecc9 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c -@@ -1087,6 +1087,7 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) +@@ -1059,6 +1059,7 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) - if (!strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "video/x-raw")) + if (!strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "video/x-raw")) { +#ifdef HAVE_GST_STRUCTURE_GET_LIST GstElementFactory *videoconvert_factory = gst_element_factory_find("videoconvert"); /* output every format supported by videoconvert */ const GList *template_list = gst_element_factory_get_static_pad_templates(videoconvert_factory); -@@ -1118,6 +1119,7 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) +@@ -1086,6 +1087,7 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) gst_caps_unref(src_caps); break; } +#endif } - else if (!strcmp(gst_structure_get_name(gst_caps_get_structure(stream->their_caps, 0)), "audio/x-raw")) + else if (!strcmp(gst_structure_get_name(gst_caps_get_structure(current_caps, 0)), "audio/x-raw")) { -- 2.28.0 diff --git a/patches/mfplat-streaming-support/definition b/patches/mfplat-streaming-support/definition index 6fde82d1..46a40d0b 100644 --- a/patches/mfplat-streaming-support/definition +++ b/patches/mfplat-streaming-support/definition @@ -1,2 +1 @@ Fixes: [49692] mfplat: Improved support for multiple video formats. -Disabled: true diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 3c694d5c..f79bb9d6 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -146,6 +146,7 @@ patch_enable_all () enable_krnl386_exe16_GDT_LDT_Emulation="$1" enable_krnl386_exe16_Invalid_Console_Handles="$1" enable_loader_KeyboardLayouts="$1" + enable_mfplat_streaming_support="$1" enable_mmsystem_dll16_MIDIHDR_Refcount="$1" enable_mountmgr_DosDevices="$1" enable_mscoree_CorValidateImage="$1" @@ -530,6 +531,9 @@ patch_enable () loader-KeyboardLayouts) enable_loader_KeyboardLayouts="$2" ;; + mfplat-streaming-support) + enable_mfplat_streaming_support="$2" + ;; mmsystem.dll16-MIDIHDR_Refcount) enable_mmsystem_dll16_MIDIHDR_Refcount="$2" ;; @@ -2703,6 +2707,78 @@ if test "$enable_loader_KeyboardLayouts" -eq 1; then patch_apply loader-KeyboardLayouts/0002-user32-Improve-GetKeyboardLayoutList.patch fi +# Patchset mfplat-streaming-support +# | +# | This patchset fixes the following Wine bugs: +# | * [#49692] mfplat: Improved support for multiple video formats. +# | +# | Modified files: +# | * configure.ac, dlls/mf/Makefile.in, dlls/mf/handler.c, dlls/mf/handler.h, dlls/mf/main.c, dlls/mf/sar.c, +# | dlls/mf/session.c, dlls/mf/tests/mf.c, dlls/mf/topology.c, dlls/mfplat/mediatype.c, dlls/mfplat/tests/mfplat.c, +# | dlls/mfplat/tests/test.mp4, dlls/mfreadwrite/reader.c, dlls/mfreadwrite/tests/mfplat.c, +# | dlls/mfreadwrite/tests/resource.rc, dlls/mfreadwrite/tests/test.mp4, dlls/winegstreamer/Makefile.in, +# | dlls/winegstreamer/audioconvert.c, dlls/winegstreamer/colorconvert.c, dlls/winegstreamer/gst_cbs.c, +# | dlls/winegstreamer/gst_cbs.h, dlls/winegstreamer/gst_private.h, dlls/winegstreamer/main.c, +# | dlls/winegstreamer/media_source.c, dlls/winegstreamer/mf_decode.c, dlls/winegstreamer/mfplat.c, +# | dlls/winegstreamer/winegstreamer_classes.idl, include/mfidl.idl, tools/make_makefiles, tools/makedep.c +# | +if test "$enable_mfplat_streaming_support" -eq 1; then + patch_apply mfplat-streaming-support/0001-winegstreamer-Add-a-GstPad-wrapping-the-media-source.patch + patch_apply mfplat-streaming-support/0002-winegstreamer-Use-decodebin-to-initialize-media-stre.patch + patch_apply mfplat-streaming-support/0003-winegstreamer-Implement-IMFMediaStream-GetStreamDesc.patch + patch_apply mfplat-streaming-support/0004-winegstreamer-Insert-parser-into-pipeline-to-rectify.patch + patch_apply mfplat-streaming-support/0005-winegstreamer-Insert-videoconvert-into-decoded-video.patch + patch_apply mfplat-streaming-support/0006-winegstreamer-Insert-audioconvert-into-decoded-audio.patch + patch_apply mfplat-streaming-support/0007-winegstreamer-Translate-H.264-caps-to-attributes.patch + patch_apply mfplat-streaming-support/0008-winegstreamer-Translate-WMV-caps-to-attributes.patch + patch_apply mfplat-streaming-support/0009-winegstreamer-Translate-AAC-caps-to-attributes.patch + patch_apply mfplat-streaming-support/0010-winegstreamer-Translate-MPEG-4-Section-2-caps-to-att.patch + patch_apply mfplat-streaming-support/0011-winegstreamer-Translate-WMA-caps-to-attributes.patch + patch_apply mfplat-streaming-support/0012-winegstreamer-Implement-IMFMediaSource-CreatePresent.patch + patch_apply mfplat-streaming-support/0013-winegstreamer-Introduce-IMFMediaType-GstCaps-convert.patch + patch_apply mfplat-streaming-support/0014-winegstreamer-Translate-H.264-attributes-to-caps.patch + patch_apply mfplat-streaming-support/0015-winegstreamer-Translate-WMV-attributes-to-caps.patch + patch_apply mfplat-streaming-support/0016-winegstreamer-Translate-AAC-attributes-to-caps.patch + patch_apply mfplat-streaming-support/0017-winegstreamer-Translate-MPEG-4-Section-2-attributes-.patch + patch_apply mfplat-streaming-support/0018-winegstreamer-Translate-WMA-attributes-to-caps.patch + patch_apply mfplat-streaming-support/0019-winegstreamer-Implement-IMFMediaSource-Start.patch + patch_apply mfplat-streaming-support/0020-winegstreamer-Implement-IMFMediaStream-RequestSample.patch + patch_apply mfplat-streaming-support/0021-winegstreamer-Implement-IMFMediaSource-GetCharacteri.patch + patch_apply mfplat-streaming-support/0022-winegstreamer-Calculate-the-MF_PD_DURATION-of-the-me.patch + patch_apply mfplat-streaming-support/0023-tools-Add-support-for-multiple-parent-directories.patch + patch_apply mfplat-streaming-support/0024-mf-Introduce-handler-helper.patch + patch_apply mfplat-streaming-support/0025-Introduce-IMFSample-GstBuffer-converter.patch + patch_apply mfplat-streaming-support/0026-winegstreamer-Implement-decoder-MFT-on-gstreamer.patch + patch_apply mfplat-streaming-support/0027-mfreadwrite-Select-all-streams-when-creating-a-sourc.patch + patch_apply mfplat-streaming-support/0028-Miscellaneous.patch + patch_apply mfplat-streaming-support/0029-WMV.patch + patch_apply mfplat-streaming-support/0030-mf-Ask-for-more-samples-from-upstream-node-when-upon.patch + patch_apply mfplat-streaming-support/0031-winegstreamer-Implement-IMFMedisStream-GetMediaSourc.patch + patch_apply mfplat-streaming-support/0032-Expose-PCM-output-type-on-AAC-decoder.patch + patch_apply mfplat-streaming-support/0033-mfplat-Add-I420-format-information.patch + patch_apply mfplat-streaming-support/0034-winegstreamer-Implement-Color-Converter-MFT.patch + patch_apply mfplat-streaming-support/0035-HACK-Set-BPS-to-16-for-output-template.patch + patch_apply mfplat-streaming-support/0036-Improve-tests.patch + patch_apply mfplat-streaming-support/0037-Revert-Improve-tests.patch + patch_apply mfplat-streaming-support/0038-Report-streams-backwards-and-only-select-one-of-each.patch + patch_apply mfplat-streaming-support/0039-winegstreamer-Implement-IMFMediaSource-Stop.patch + patch_apply mfplat-streaming-support/0040-winegstreamer-Introduce-MPEG-4-Section-2-video-decod.patch + patch_apply mfplat-streaming-support/0041-HACK-Switch-between-all-selection-streams-on-MF_SOUR.patch + patch_apply mfplat-streaming-support/0042-winegstreamer-Introduce-WMA-audio-decoder.patch + patch_apply mfplat-streaming-support/0043-Support-stereo-down-folding.patch + patch_apply mfplat-streaming-support/0044-winegstreamer-Implement-MF_SD_LANGUAGE.patch + patch_apply mfplat-streaming-support/0045-Revert-mf-topoloader-Add-a-structure-for-iterative-b.patch + patch_apply mfplat-streaming-support/0046-Revert-mf-topoloader-Clone-source-nodes-as-a-first-l.patch + patch_apply mfplat-streaming-support/0047-Revert-mf-topoloader-Switch-to-public-interface-for-.patch + patch_apply mfplat-streaming-support/0048-mf-Partially-implement-the-topology-loader.patch + patch_apply mfplat-streaming-support/0049-mf-Miscelaneous-fixes-to-topology-resolution.patch + patch_apply mfplat-streaming-support/0050-Rewrite-branch-resolver.patch + patch_apply mfplat-streaming-support/0051-mf-sar-Compare-against-native-media-type-in-IsMediaT.patch + patch_apply mfplat-streaming-support/0052-winegstreamer-Implement-audio-conversion-MFT.patch + patch_apply mfplat-streaming-support/0053-winegstreamer-Support-eAVEncH264VProfile_Constrained.patch + patch_apply mfplat-streaming-support/0054-winegstreamer-Support-older-versions.patch +fi + # Patchset mmsystem.dll16-MIDIHDR_Refcount # | # | This patchset fixes the following Wine bugs: