mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Updated mfplat-streaming-support patchset
This commit is contained in:
parent
7bd8acb4ca
commit
7b32c6a57f
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
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 <stdarg.h>
|
||||
+#include <assert.h>
|
||||
|
||||
@@ -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);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
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 <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
|
||||
#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
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
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)
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
@ -10,10 +10,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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"))
|
||||
{
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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")))
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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")))
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -10,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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);
|
||||
}
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
@ -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);
|
||||
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -11,22 +10,22 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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;
|
||||
+ }
|
||||
+ }
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -10,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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);
|
||||
}
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
@ -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 <dlesho@codeweavers.com>
|
||||
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 <dlesho@codeweavers.com>
|
||||
---
|
||||
@ -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;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user