Updated mfplat-streaming-support patchset

This commit is contained in:
Alistair Leslie-Hughes 2020-11-10 16:42:53 +11:00
parent 009f571ba1
commit 41c7c741d7
49 changed files with 817 additions and 623 deletions

View File

@ -0,0 +1,164 @@
From 71055ca3dfc664a37a5ecf428ba75e89648acc89 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 2 Nov 2020 09:56:54 -0600
Subject: [PATCH 01/45] winegstreamer: Add IMFSeekInfo::GetNearestKeyFrames
stub.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/media_source.c | 111 ++++++++++++++++++++++++++++++
1 file changed, 111 insertions(+)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 66bdf64a669..828958e47e2 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -91,6 +91,8 @@ struct source_async_command
struct media_source
{
IMFMediaSource IMFMediaSource_iface;
+ IMFGetService IMFGetService_iface;
+ IMFSeekInfo IMFSeekInfo_iface;
IMFAsyncCallback async_commands_callback;
LONG ref;
DWORD async_commands_queue;
@@ -123,6 +125,16 @@ static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *ifac
return CONTAINING_RECORD(iface, struct media_source, IMFMediaSource_iface);
}
+static inline struct media_source *impl_from_IMFGetService(IMFGetService *iface)
+{
+ return CONTAINING_RECORD(iface, struct media_source, IMFGetService_iface);
+}
+
+static inline struct media_source *impl_from_IMFSeekInfo(IMFSeekInfo *iface)
+{
+ return CONTAINING_RECORD(iface, struct media_source, IMFSeekInfo_iface);
+}
+
static inline struct media_source *impl_from_async_commands_callback_IMFAsyncCallback(IMFAsyncCallback *iface)
{
return CONTAINING_RECORD(iface, struct media_source, async_commands_callback);
@@ -956,6 +968,10 @@ static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID
{
*out = &source->IMFMediaSource_iface;
}
+ else if(IsEqualIID(riid, &IID_IMFGetService))
+ {
+ *out = &source->IMFGetService_iface;
+ }
else
{
FIXME("(%s, %p)\n", debugstr_guid(riid), out);
@@ -1185,6 +1201,99 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl =
media_source_Shutdown,
};
+static HRESULT WINAPI source_get_service_QueryInterface(IMFGetService *iface, REFIID riid, void **obj)
+{
+ struct media_source *source = impl_from_IMFGetService(iface);
+ return IMFMediaSource_QueryInterface(&source->IMFMediaSource_iface, riid, obj);
+}
+
+static ULONG WINAPI source_get_service_AddRef(IMFGetService *iface)
+{
+ struct media_source *source = impl_from_IMFGetService(iface);
+ return IMFMediaSource_AddRef(&source->IMFMediaSource_iface);
+}
+
+static ULONG WINAPI source_get_service_Release(IMFGetService *iface)
+{
+ struct media_source *source = impl_from_IMFGetService(iface);
+ return IMFMediaSource_Release(&source->IMFMediaSource_iface);
+}
+
+static HRESULT WINAPI source_get_service_GetService(IMFGetService *iface, REFGUID service, REFIID riid, void **obj)
+{
+ struct media_source *source = impl_from_IMFGetService(iface);
+
+ TRACE("(%p)->(%s, %s, %p)\n", source, debugstr_guid(service), debugstr_guid(riid), obj);
+
+ if (source->state == SOURCE_SHUTDOWN)
+ return MF_E_SHUTDOWN;
+
+ *obj = NULL;
+
+ if (IsEqualIID(service, &MF_SCRUBBING_SERVICE))
+ {
+ if (IsEqualIID(riid, &IID_IMFSeekInfo))
+ {
+ *obj = &source->IMFSeekInfo_iface;
+ }
+ }
+
+ if (*obj)
+ IUnknown_AddRef((IUnknown*) *obj);
+
+ return *obj ? S_OK : E_NOINTERFACE;
+}
+
+static const IMFGetServiceVtbl IMFGetService_vtbl =
+{
+ source_get_service_QueryInterface,
+ source_get_service_AddRef,
+ source_get_service_Release,
+ source_get_service_GetService,
+};
+
+static HRESULT WINAPI source_seek_info_QueryInterface(IMFSeekInfo *iface, REFIID riid, void **obj)
+{
+ struct media_source *source = impl_from_IMFSeekInfo(iface);
+ return IMFMediaSource_QueryInterface(&source->IMFMediaSource_iface, riid, obj);
+}
+
+static ULONG WINAPI source_seek_info_AddRef(IMFSeekInfo *iface)
+{
+ struct media_source *source = impl_from_IMFSeekInfo(iface);
+ return IMFMediaSource_AddRef(&source->IMFMediaSource_iface);
+}
+
+static ULONG WINAPI source_seek_info_Release(IMFSeekInfo *iface)
+{
+ struct media_source *source = impl_from_IMFSeekInfo(iface);
+ return IMFMediaSource_Release(&source->IMFMediaSource_iface);
+}
+
+static HRESULT WINAPI source_seek_info_GetNearestKeyFrames(IMFSeekInfo *iface, const GUID *format,
+ const PROPVARIANT *position, PROPVARIANT *prev_frame, PROPVARIANT *next_frame)
+{
+ struct media_source *source = impl_from_IMFSeekInfo(iface);
+
+ FIXME("(%p)->(%s, %p, %p, %p) - semi-stub\n", source, debugstr_guid(format), position, prev_frame, next_frame);
+
+ if (source->state == SOURCE_SHUTDOWN)
+ return MF_E_SHUTDOWN;
+
+ PropVariantCopy(prev_frame, position);
+ PropVariantCopy(next_frame, position);
+
+ return S_OK;
+}
+
+static const IMFSeekInfoVtbl IMFSeekInfo_vtbl =
+{
+ source_seek_info_QueryInterface,
+ source_seek_info_AddRef,
+ source_seek_info_Release,
+ source_seek_info_GetNearestKeyFrames,
+};
+
static void stream_added(GstElement *element, GstPad *pad, gpointer user)
{
struct media_source *source = user;
@@ -1256,6 +1365,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
}
object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl;
+ object->IMFGetService_iface.lpVtbl = &IMFGetService_vtbl;
+ object->IMFSeekInfo_iface.lpVtbl = &IMFSeekInfo_vtbl;
object->async_commands_callback.lpVtbl = &source_async_commands_callback_vtbl;
object->ref = 1;
object->byte_stream = bytestream;
--
2.28.0

View File

@ -0,0 +1,122 @@
From 0e097a430b44aaabdc51d779c81a5ac82aa730db Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Fri, 6 Nov 2020 10:06:23 -0600
Subject: [PATCH 02/45] winegstreamer: Fixup raw audio caps to be compatible
with IMFMediaType.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/gst_private.h | 1 +
dlls/winegstreamer/media_source.c | 7 +++-
dlls/winegstreamer/mfplat.c | 57 +++++++++++++++++++++++++++++++
3 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index 28e424439d8..75fc7dc90a8 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -78,6 +78,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;
GstCaps *caps_from_mf_media_type(IMFMediaType *type) DECLSPEC_HIDDEN;
IMFSample *mf_sample_from_gst_buffer(GstBuffer *in) DECLSPEC_HIDDEN;
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 828958e47e2..272dbfbfca6 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -869,15 +869,20 @@ fail:
static HRESULT media_stream_init_desc(struct media_stream *stream)
{
- GstCaps *current_caps = gst_pad_get_current_caps(stream->their_src);
+ GstCaps *base_caps = gst_pad_get_current_caps(stream->their_src);
IMFMediaTypeHandler *type_handler;
IMFMediaType **stream_types = NULL;
IMFMediaType *stream_type = NULL;
+ GstCaps *current_caps = make_mf_compatible_caps(base_caps);
DWORD type_count = 0;
const gchar *major_type;
unsigned int i;
HRESULT hr;
+ gst_caps_unref(base_caps);
+ if (!current_caps)
+ return E_FAIL;
+
major_type = gst_structure_get_name(gst_caps_get_structure(current_caps, 0));
if (!strcmp(major_type, "video/x-raw"))
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 3d224a5accc..7a877c2a416 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -602,6 +602,63 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps)
return media_type;
}
+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;
+
+ /* Optimization: Don't copy caps if no transformation is needed */
+ if ((media_type = mf_media_type_from_caps(caps)))
+ {
+ IMFMediaType_Release(media_type);
+ return gst_caps_ref(caps);
+ }
+
+ ret = gst_caps_copy(caps);
+ structure = gst_caps_get_structure(ret, 0);
+ mime_type = gst_structure_get_name(structure);
+
+ if (!strcmp(mime_type, "audio/x-raw"))
+ {
+ const char *format;
+ if ((format = gst_structure_get_string(structure, "format")))
+ {
+ 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))
+ {
+ if (type == 'U' || type == 'S')
+ type = bits_per_sample == 8 ? 'U' : 'S';
+
+ 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);
+ }
+ }
+ }
+
+ if ((media_type = mf_media_type_from_caps(ret)))
+ IMFMediaType_Release(media_type);
+
+ if (!media_type)
+ {
+ gst_caps_unref(ret);
+ return NULL;
+ }
+
+ return ret;
+}
+
GstCaps *caps_from_mf_media_type(IMFMediaType *type)
{
GUID major_type;
--
2.28.0

View File

@ -0,0 +1,45 @@
From 20c483cf8d0b9ca634a325239006b41b67cce3eb Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 2 Nov 2020 10:18:27 -0600
Subject: [PATCH 03/45] winegstreamer: Set MF_PD_MIME_TYPE on source's
presentation descriptor.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/media_source.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 272dbfbfca6..36f995cc6ef 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -1351,6 +1351,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
struct media_source *object = heap_alloc_zero(sizeof(*object));
IMFStreamDescriptor **descriptors = NULL;
+ IMFAttributes *byte_stream_attributes;
gint64 total_pres_time = 0;
DWORD bytestream_caps;
unsigned int i;
@@ -1493,6 +1494,18 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
if (object->stream_count)
IMFPresentationDescriptor_SetUINT64(object->pres_desc, &MF_PD_DURATION, total_pres_time / 100);
+ if (SUCCEEDED(IMFByteStream_QueryInterface(object->byte_stream, &IID_IMFAttributes, (void **)&byte_stream_attributes)))
+ {
+ WCHAR *mimeW = NULL;
+ DWORD length;
+ if (SUCCEEDED(IMFAttributes_GetAllocatedString(byte_stream_attributes, &MF_BYTESTREAM_CONTENT_TYPE, &mimeW, &length)))
+ {
+ IMFPresentationDescriptor_SetString(object->pres_desc, &MF_PD_MIME_TYPE, mimeW);
+ CoTaskMemFree(mimeW);
+ }
+ IMFAttributes_Release(byte_stream_attributes);
+ }
+
object->state = SOURCE_STOPPED;
*out_media_source = object;
--
2.28.0

View File

@ -1,7 +1,7 @@
From 6f5a552ebbe6bcafed0b92de60c7104fb1021c64 Mon Sep 17 00:00:00 2001
From 21b3adc827428ea014e2d02ef955efeffd965999 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 14 Oct 2020 11:07:05 -0500
Subject: [PATCH] mf: Unconditionally deliver NULL (EOS) samples.
Subject: [PATCH 04/45] mf: Unconditionally deliver NULL (EOS) samples.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---

View File

@ -1,33 +1,19 @@
From aefabd1b2c8859c0fdf2ecbdf03cf76204e667a0 Mon Sep 17 00:00:00 2001
From 2f4b30a65e449223c524453509ea0be5d11f8b9e Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 15 Sep 2020 14:25:26 -0500
Subject: [PATCH] winegstreamer: Insert parser into pipeline to rectify type
differences.
Subject: [PATCH 05/45] winegstreamer: Insert parser into pipeline to rectify
type differences.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/gst_private.h | 1 +
dlls/winegstreamer/media_source.c | 111 ++++++++++++++++++++++++++++--
dlls/winegstreamer/mfplat.c | 22 ++++++
3 files changed, 130 insertions(+), 4 deletions(-)
dlls/winegstreamer/media_source.c | 95 ++++++++++++++++++++++++++++++-
1 file changed, 92 insertions(+), 3 deletions(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index 28e424439d8..75fc7dc90a8 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -78,6 +78,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;
GstCaps *caps_from_mf_media_type(IMFMediaType *type) DECLSPEC_HIDDEN;
IMFSample *mf_sample_from_gst_buffer(GstBuffer *in) DECLSPEC_HIDDEN;
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index ef694bf194a..d25e34dec68 100644
index 36f995cc6ef..ea299c124dd 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -752,8 +752,17 @@ static const IMFMediaStreamVtbl media_stream_vtbl =
@@ -769,8 +769,17 @@ static const IMFMediaStreamVtbl media_stream_vtbl =
media_stream_RequestSample
};
@ -47,7 +33,7 @@ index ef694bf194a..d25e34dec68 100644
static HRESULT media_stream_connect_to_sink(struct media_stream *stream)
{
GstCaps *source_caps = gst_pad_query_caps(stream->their_src, NULL);
@@ -793,7 +802,68 @@ static HRESULT media_stream_connect_to_sink(struct media_stream *stream)
@@ -810,7 +819,68 @@ static HRESULT media_stream_connect_to_sink(struct media_stream *stream)
}
else
{
@ -117,38 +103,8 @@ index ef694bf194a..d25e34dec68 100644
}
if (gst_pad_link(stream->their_src, stream->my_sink) != GST_PAD_LINK_OK)
@@ -903,7 +973,7 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
goto done;
}
}
- else
+ else if (!strcmp(major_type, "audio/x-raw"))
{
stream_type = mf_media_type_from_caps(current_caps);
if (stream_type)
@@ -912,6 +982,20 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
type_count = 1;
}
}
+ else
+ {
+ GstCaps *compatible_caps = make_mf_compatible_caps(current_caps);
+ if (compatible_caps)
+ {
+ stream_type = mf_media_type_from_caps(compatible_caps);
+ gst_caps_unref(compatible_caps);
+ if (stream_type)
+ {
+ stream_types = &stream_type;
+ type_count = 1;
+ }
+ }
+ }
if (!type_count)
{
@@ -1178,6 +1262,23 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl =
media_source_Shutdown,
@@ -1299,6 +1369,23 @@ static const IMFSeekInfoVtbl IMFSeekInfo_vtbl =
source_seek_info_GetNearestKeyFrames,
};
+/* If this callback is extended to use any significant win32 APIs, a wrapper function
@ -171,7 +127,7 @@ index ef694bf194a..d25e34dec68 100644
static void stream_added(GstElement *element, GstPad *pad, gpointer user)
{
struct media_source *source = user;
@@ -1283,6 +1384,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
@@ -1418,6 +1505,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
gst_bin_add(GST_BIN(object->container), object->decodebin);
@ -180,39 +136,6 @@ index ef694bf194a..d25e34dec68 100644
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 908f3d83ef9..bed5d0cc31c 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -602,6 +602,28 @@ 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;
+}
+
GstCaps *caps_from_mf_media_type(IMFMediaType *type)
{
GUID major_type;
--
2.28.0

View File

@ -1,15 +1,15 @@
From 7f8e08bb35cb2a9432a0f827f67b232d488d1051 Mon Sep 17 00:00:00 2001
From b4501cee4e60bc89c926de676db5945be58cf44a Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 24 Mar 2020 16:00:26 -0500
Subject: [PATCH] winegstreamer: Translate H.264 caps to attributes.
Subject: [PATCH 06/45] winegstreamer: Translate H.264 caps to attributes.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/mfplat.c | 80 +++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
dlls/winegstreamer/mfplat.c | 75 +++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index bed5d0cc31c..5e6b5a8ec33 100644
index 7a877c2a416..f543c774b1d 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -26,6 +26,7 @@
@ -95,21 +95,11 @@ index bed5d0cc31c..5e6b5a8ec33 100644
else
{
FIXME("Unrecognized video format %s\n", mime_type);
@@ -606,11 +675,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"))
@@ -646,6 +715,12 @@ GstCaps *make_mf_compatible_caps(GstCaps *caps)
}
}
}
+ else 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);

View File

@ -1,7 +1,7 @@
From 7d6c748a2fe172d3c59ef225c87cd10bac45d1b7 Mon Sep 17 00:00:00 2001
From 30499cfad9d6eee935b00e6efff8fec72a60dc99 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 24 Mar 2020 16:01:20 -0500
Subject: [PATCH] winegstreamer: Translate WMV caps to attributes.
Subject: [PATCH 07/45] winegstreamer: Translate WMV caps to attributes.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -9,7 +9,7 @@ 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 5e6b5a8ec33..1ed1ed2f825 100644
index f543c774b1d..eb88d6ed6a2 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -457,6 +457,24 @@ uncompressed_video_formats[] =

View File

@ -1,7 +1,7 @@
From 6e954ed74dbf7ab37b5a3b75d12a0a50a8a1e3ce Mon Sep 17 00:00:00 2001
From 266a53b56c1f6e7b2704a2aced3cf0aac4d3c616 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 24 Mar 2020 16:02:27 -0500
Subject: [PATCH] winegstreamer: Translate AAC caps to attributes.
Subject: [PATCH 08/45] winegstreamer: Translate AAC caps to attributes.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -9,7 +9,7 @@ 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 1ed1ed2f825..a1958f79807 100644
index eb88d6ed6a2..6958806dc4f 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -457,6 +457,15 @@ uncompressed_video_formats[] =

View File

@ -1,7 +1,8 @@
From 134086a1d60e24065d0556ada3070603834036d8 Mon Sep 17 00:00:00 2001
From 260e005c6b7b7998961d123f457f32568770fc11 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 25 Mar 2020 13:36:19 -0500
Subject: [PATCH] winegstreamer: Translate MPEG-4 Section-2 caps to attributes.
Subject: [PATCH 09/45] winegstreamer: Translate MPEG-4 Section-2 caps to
attributes.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -9,7 +10,7 @@ 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 a1958f79807..c05b9ddf41a 100644
index 6958806dc4f..96943f77a70 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -650,6 +650,22 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps)

View File

@ -1,7 +1,7 @@
From d07c302989c043d23091accafdc998cf1851d12f Mon Sep 17 00:00:00 2001
From bcbc7087c297e0f739608b2b3538db4e40cb9b1d Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 12 May 2020 17:05:41 -0500
Subject: [PATCH] winegstreamer: Translate WMA caps to attributes.
Subject: [PATCH 10/45] winegstreamer: Translate WMA caps to attributes.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -9,7 +9,7 @@ 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 c05b9ddf41a..416daa7b8a6 100644
index 96943f77a70..28e0163cdf2 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -830,6 +830,30 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps)

View File

@ -1,7 +1,7 @@
From be591787edbf17c43034f44eff3b0cb55296ae83 Mon Sep 17 00:00:00 2001
From aa5bec9bd28415efeb564a620391319653e92135 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 24 Mar 2020 16:18:40 -0500
Subject: [PATCH] winegstreamer: Translate H.264 attributes to caps.
Subject: [PATCH 11/45] 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, 71 insertions(+), 19 deletions(-)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 416daa7b8a6..5ccae20e8bb 100644
index 28e0163cdf2..25ff06b16a1 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -918,10 +918,6 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
@@ -948,10 +948,6 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
{
UINT64 frame_rate = 0, frame_size = 0;
DWORD width, height;
@ -23,7 +23,7 @@ index 416daa7b8a6..5ccae20e8bb 100644
if (FAILED(IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &frame_size)))
return NULL;
@@ -930,28 +926,84 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
@@ -960,28 +956,84 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
output = gst_caps_new_empty_simple("video/x-raw");

View File

@ -1,7 +1,7 @@
From 43e6b3be2fd3a5e4b6ddb4e8eb1833c69c2ef817 Mon Sep 17 00:00:00 2001
From 15d2a62517079def88c968af852f04dc3ae815de Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 24 Mar 2020 16:20:17 -0500
Subject: [PATCH] winegstreamer: Translate WMV attributes to caps.
Subject: [PATCH 12/45] 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 5ccae20e8bb..ffb6a303d34 100644
index 25ff06b16a1..402693c424e 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -903,6 +903,21 @@ GstCaps *make_mf_compatible_caps(GstCaps *caps)
@@ -933,6 +933,21 @@ GstCaps *make_mf_compatible_caps(GstCaps *caps)
return ret;
}
@ -34,7 +34,7 @@ index 5ccae20e8bb..ffb6a303d34 100644
GstCaps *caps_from_mf_media_type(IMFMediaType *type)
{
GUID major_type;
@@ -974,6 +989,42 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
@@ -1004,6 +1019,42 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
gst_caps_set_simple(output, "level", G_TYPE_STRING, level, NULL);
}
}

View File

@ -1,7 +1,7 @@
From 272225ae4f7e9dea77c90c783fc3a49373387cee Mon Sep 17 00:00:00 2001
From 7efecdc8387632f3fc1790a7ddc01a2dfd79369b Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 21 Apr 2020 10:31:02 -0500
Subject: [PATCH] winegstreamer: Translate AAC attributes to caps.
Subject: [PATCH 13/45] 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 ffb6a303d34..bbba4d718f6 100644
index 402693c424e..1f085e9b4b4 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -1105,6 +1105,72 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
@@ -1135,6 +1135,72 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
return NULL;
}
}

View File

@ -1,7 +1,8 @@
From 186b88f42753dd6d26aee1f29d27de77984b9e3c Mon Sep 17 00:00:00 2001
From a69723134dcf8069a7cdafbaa10dee6a37676571 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 11 May 2020 16:03:09 -0500
Subject: [PATCH] winegstreamer: Translate MPEG-4 Section-2 attributes to caps.
Subject: [PATCH 14/45] winegstreamer: Translate MPEG-4 Section-2 attributes to
caps.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -9,10 +10,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 bbba4d718f6..e952a782bc1 100644
index 1f085e9b4b4..443adab0a8f 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -1025,6 +1025,14 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
@@ -1055,6 +1055,14 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
user_data_to_codec_data(type, output);
}

View File

@ -1,7 +1,7 @@
From 8745a3af3b1a85285acf6b7196b3850cdf26c3bb Mon Sep 17 00:00:00 2001
From 3e3c934208f0eb186919e82894d6f5a68882d460 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 12 May 2020 17:05:59 -0500
Subject: [PATCH] winegstreamer: Translate WMA attributes to caps.
Subject: [PATCH 15/45] 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 e952a782bc1..dddf0ac9fa4 100644
index 443adab0a8f..15c38254bf5 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -1179,6 +1179,21 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
@@ -1209,6 +1209,21 @@ GstCaps *caps_from_mf_media_type(IMFMediaType *type)
CoTaskMemFree(user_data);
}
}

View File

@ -1,7 +1,7 @@
From b693146a13990fa4361a18a47308aae97da92b1c Mon Sep 17 00:00:00 2001
From 999d7a93536ecd9d3daa66adff2ed5d2ce375386 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 29 Jan 2020 15:37:39 -0600
Subject: [PATCH] tools: Add support for multiple parent directories.
Subject: [PATCH 16/45] tools: Add support for multiple parent directories.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---

View File

@ -1,7 +1,7 @@
From e97b113c42663be4b989c098703013da75a6ad1a Mon Sep 17 00:00:00 2001
From df5412c890e61326fc5bb5cfd96a3a7a311d89e6 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 29 Jan 2020 15:30:49 -0600
Subject: [PATCH] mf: Introduce handler helper.
Subject: [PATCH 17/45] mf: Introduce handler helper.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -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 337c4f52c35..5eeb0e1ffcb 100644
index ea299c124dd..2df86814679 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -23,6 +23,7 @@
@ -943,7 +943,7 @@ index 337c4f52c35..5eeb0e1ffcb 100644
#include <assert.h>
#include <stdarg.h>
@@ -1500,21 +1501,11 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
@@ -1608,21 +1609,11 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
return hr;
}
@ -966,7 +966,7 @@ index 337c4f52c35..5eeb0e1ffcb 100644
};
static struct winegstreamer_stream_handler *impl_from_IMFByteStreamHandler(IMFByteStreamHandler *iface)
@@ -1522,11 +1513,6 @@ static struct winegstreamer_stream_handler *impl_from_IMFByteStreamHandler(IMFBy
@@ -1630,11 +1621,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 337c4f52c35..5eeb0e1ffcb 100644
static HRESULT WINAPI winegstreamer_stream_handler_QueryInterface(IMFByteStreamHandler *iface, REFIID riid, void **obj)
{
TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
@@ -1556,247 +1542,44 @@ static ULONG WINAPI winegstreamer_stream_handler_AddRef(IMFByteStreamHandler *if
@@ -1664,247 +1650,44 @@ static ULONG WINAPI winegstreamer_stream_handler_AddRef(IMFByteStreamHandler *if
static ULONG WINAPI winegstreamer_stream_handler_Release(IMFByteStreamHandler *iface)
{
@ -1233,7 +1233,7 @@ index 337c4f52c35..5eeb0e1ffcb 100644
}
static HRESULT WINAPI winegstreamer_stream_handler_GetMaxNumberOfBytesRequiredForResolution(IMFByteStreamHandler *iface, QWORD *bytes)
@@ -1816,47 +1599,16 @@ static const IMFByteStreamHandlerVtbl winegstreamer_stream_handler_vtbl =
@@ -1924,47 +1707,16 @@ static const IMFByteStreamHandlerVtbl winegstreamer_stream_handler_vtbl =
winegstreamer_stream_handler_GetMaxNumberOfBytesRequiredForResolution,
};
@ -1284,7 +1284,7 @@ index 337c4f52c35..5eeb0e1ffcb 100644
if (FAILED(hr = media_source_constructor(stream, &new_source)))
return hr;
@@ -1875,64 +1627,6 @@ static HRESULT winegstreamer_stream_handler_create_object(struct winegstreamer_s
@@ -1983,64 +1735,6 @@ static HRESULT winegstreamer_stream_handler_create_object(struct winegstreamer_s
}
}
@ -1349,7 +1349,7 @@ index 337c4f52c35..5eeb0e1ffcb 100644
HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj)
{
struct winegstreamer_stream_handler *this;
@@ -1944,11 +1638,9 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj)
@@ -2052,11 +1746,9 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj)
if (!this)
return E_OUTOFMEMORY;

View File

@ -1,7 +1,7 @@
From cb229a30f5a76980cd6111350c5e63cf0ffcf13d Mon Sep 17 00:00:00 2001
From e92f897fc9590659e579ee2d5cf366b5eeb617f4 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 25 Mar 2020 10:43:27 -0500
Subject: [PATCH] Introduce IMFSample -> GstBuffer converter.
Subject: [PATCH 18/45] Introduce IMFSample -> GstBuffer converter.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -22,10 +22,10 @@ index 75fc7dc90a8..321143396d6 100644
HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN;
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index dddf0ac9fa4..e2f8f6e0a43 100644
index 15c38254bf5..7b7300d5e8e 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -1293,3 +1293,77 @@ done:
@@ -1323,3 +1323,77 @@ done:
return out;
}

View File

@ -1,7 +1,7 @@
From f2a4bf49f6a283c5e679d5b968da1fe5294f9144 Mon Sep 17 00:00:00 2001
From 4ad320392b3671f27fa79609ec942e0a5c741da1 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 16 Mar 2020 12:09:39 -0500
Subject: [PATCH] winegstreamer: Implement decoder MFT on gstreamer.
Subject: [PATCH 19/45] winegstreamer: Implement decoder MFT on gstreamer.
---
dlls/winegstreamer/Makefile.in | 1 +
@ -1530,7 +1530,7 @@ index 00000000000..70a20ebe69b
+ }
+}
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index e2f8f6e0a43..f60828d8dc8 100644
index 7b7300d5e8e..7ff01b5b4bd 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -406,6 +406,16 @@ failed:
@ -1700,10 +1700,10 @@ index 1dc4ba9a10b..3f28b4ddec4 100644
+]
+coclass CMSAACDecMFT { }
diff --git a/include/mfidl.idl b/include/mfidl.idl
index 9f2d825bd5f..20164c39253 100644
index dd5de8d0d2f..4023c3a62d2 100644
--- a/include/mfidl.idl
+++ b/include/mfidl.idl
@@ -1290,3 +1290,5 @@ cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_ACTIVATE, 0xba491365,
@@ -1306,3 +1306,5 @@ cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_ACTIVATE, 0xba491365,
cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_FLAGS, 0xba491366, 0xbe50, 0x451e, 0x95, 0xab, 0x6d, 0x4a, 0xcc, 0xc7, 0xda, 0xd8);")
cpp_quote("EXTERN_GUID(CLSID_VideoProcessorMFT, 0x88753b26, 0x5b24, 0x49bd, 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82);")

View File

@ -1,7 +1,7 @@
From eb16c9cdd1ce7f62b66a80b8680d6665e2c5c669 Mon Sep 17 00:00:00 2001
From 5913e02f7c67c8f8214efd9de4e095f189fcca2e Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 23 Mar 2020 11:55:41 -0500
Subject: [PATCH] mfreadwrite: Select all streams when creating a source
Subject: [PATCH 20/45] mfreadwrite: Select all streams when creating a source
reader.
---
@ -9,10 +9,10 @@ Subject: [PATCH] mfreadwrite: Select all streams when creating a source
1 file changed, 4 insertions(+)
diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c
index 7dcae5a1cfa..93858840940 100644
index cc1b29a2b6a..935074d62f9 100644
--- a/dlls/mfreadwrite/reader.c
+++ b/dlls/mfreadwrite/reader.c
@@ -2128,6 +2128,10 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri
@@ -2127,6 +2127,10 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri
break;
object->streams[i].index = i;

View File

@ -0,0 +1,155 @@
From 109ee18f64293f15f9bbf412ada842ad35e57a10 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 2 Nov 2020 09:58:09 -0600
Subject: [PATCH 21/45] Miscellaneous
---
dlls/mfreadwrite/reader.c | 12 +++++++++++-
dlls/winegstreamer/gst_cbs.c | 20 +++++++++-----------
dlls/winegstreamer/gst_cbs.h | 1 -
dlls/winegstreamer/media_source.c | 24 +++++++++++++++++++++++-
4 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c
index 935074d62f9..9d86a5a0f8f 100644
--- a/dlls/mfreadwrite/reader.c
+++ b/dlls/mfreadwrite/reader.c
@@ -1597,6 +1597,7 @@ static HRESULT source_reader_create_decoder_for_stream(struct source_reader *rea
{
MFT_REGISTER_TYPE_INFO in_type, out_type;
CLSID *clsids, mft_clsid, category;
+ BOOL decoder_found = FALSE;
unsigned int i = 0, count;
IMFMediaType *input_type;
HRESULT hr;
@@ -1643,12 +1644,21 @@ static HRESULT source_reader_create_decoder_for_stream(struct source_reader *rea
}
}
+ else if (!decoder_found)
+ {
+ /* see if there are other decoders for this stream */
+ if (SUCCEEDED(MFTEnum(category, 0, &in_type, NULL, NULL, &clsids, &count)) && count)
+ {
+ decoder_found = TRUE;
+ CoTaskMemFree(clsids);
+ }
+ }
}
IMFMediaType_Release(input_type);
}
- return MF_E_TOPO_CODEC_NOT_FOUND;
+ return decoder_found ? MF_E_INVALIDREQUEST : MF_E_TOPO_CODEC_NOT_FOUND;
}
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 261a5b9f4ce..81692fdf919 100644
--- a/dlls/winegstreamer/gst_cbs.c
+++ b/dlls/winegstreamer/gst_cbs.c
@@ -18,6 +18,9 @@
#include "config.h"
+#include <stdio.h>
+#include <assert.h>
+
#include <gst/gst.h>
#include "objbase.h"
@@ -53,6 +56,12 @@ static void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user)
perform_cb_media_source(cbdata);
else if (cbdata->type < MF_DECODE_MAX)
perform_cb_mf_decode(cbdata);
+ else
+ {
+ fprintf(stderr, "No handler registered for callback\n");
+ assert(0);
+ }
+
pthread_mutex_lock(&cbdata->lock);
cbdata->finished = 1;
@@ -447,17 +456,6 @@ GstBusSyncReply watch_decoder_bus_wrapper(GstBus *bus, GstMessage *message, gpoi
return cbdata.u.watch_bus_data.ret;
}
-void decoder_pad_added_wrapper(GstElement *element, GstPad *pad, gpointer user)
-{
- struct cb_data cbdata = { DECODER_PAD_ADDED };
-
- cbdata.u.pad_added_data.element = element;
- cbdata.u.pad_added_data.pad = pad;
- cbdata.u.pad_added_data.user = user;
-
- call_cb(&cbdata);
-}
-
GstFlowReturn decoder_new_sample_wrapper(GstElement *appsink, gpointer user)
{
struct cb_data cbdata = {DECODER_NEW_SAMPLE};
diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h
index 6659aedefa5..825b46d13bb 100644
--- a/dlls/winegstreamer/gst_cbs.h
+++ b/dlls/winegstreamer/gst_cbs.h
@@ -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;
-void decoder_pad_added_wrapper(GstElement *element, GstPad *Pad, gpointer user) DECLSPEC_HIDDEN;
#endif
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 2df86814679..0fcc2ca42f3 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -532,6 +532,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:
+ {
+ gst_query_set_latency(query, FALSE, 0, 0);
+ return TRUE;
+ }
default:
{
WARN("Unhandled query type %s\n", GST_QUERY_TYPE_NAME(query));
@@ -594,6 +599,23 @@ GstBusSyncReply bus_watch(GstBus *bus, GstMessage *message, gpointer user)
g_error_free(err);
g_free(dbg_info);
break;
+ case GST_MESSAGE_TAG:
+ {
+ GstTagList *tag_list;
+ gchar *printable;
+ gst_message_parse_tag(message, &tag_list);
+ if (tag_list)
+ {
+ printable = gst_tag_list_to_string(tag_list);
+ if (printable)
+ {
+ TRACE("tag test: %s\n", debugstr_a(printable));
+ g_free(printable);
+ }
+ }
+
+ break;
+ }
default:
break;
}
@@ -1132,7 +1154,7 @@ static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWO
if (source->state == SOURCE_SHUTDOWN)
return MF_E_SHUTDOWN;
- *characteristics = MFMEDIASOURCE_CAN_SEEK;
+ *characteristics = MFMEDIASOURCE_CAN_SEEK | MFMEDIASOURCE_CAN_PAUSE;
return S_OK;
}
--
2.28.0

View File

@ -1,7 +1,7 @@
From 8a2a0aed43fb82ec196bfe31b1e80791da927f22 Mon Sep 17 00:00:00 2001
From eb89bb6b8eed2217d7832168e188ed105248cfc2 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 25 Mar 2020 19:07:11 -0500
Subject: [PATCH] WMV
Subject: [PATCH 22/45] WMV
---
dlls/winegstreamer/gst_private.h | 1 +
@ -52,7 +52,7 @@ index 70a20ebe69b..2005443a8a6 100644
};
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index f60828d8dc8..22a42861d69 100644
index 7ff01b5b4bd..b699c1dc8ec 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -416,6 +416,10 @@ static HRESULT aac_decoder_create(REFIID riid, void **ret)
@ -138,10 +138,10 @@ index 3f28b4ddec4..f9b0158fa6a 100644
+]
+coclass CLSID_CWMVDecMediaObject {}
diff --git a/include/mfidl.idl b/include/mfidl.idl
index 20164c39253..467e123255b 100644
index 4023c3a62d2..7cb027b156a 100644
--- a/include/mfidl.idl
+++ b/include/mfidl.idl
@@ -1292,3 +1292,5 @@ cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_FLAGS, 0xba491366, 0xb
@@ -1308,3 +1308,5 @@ cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_FLAGS, 0xba491366, 0xb
cpp_quote("EXTERN_GUID(CLSID_VideoProcessorMFT, 0x88753b26, 0x5b24, 0x49bd, 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82);")
cpp_quote("EXTERN_GUID(CLSID_CMSH264DecoderMFT, 0x62ce7e72, 0x4c71, 0x4d20, 0xb1, 0x5d, 0x45, 0x28, 0x31, 0xa8, 0x7d, 0x9d);")
cpp_quote("EXTERN_GUID(CLSID_CMSAACDecMFT, 0x32d186a7, 0x218f, 0x4c75, 0x88, 0x76, 0xdd, 0x77, 0x27, 0x3a, 0x89, 0x99);")

View File

@ -1,7 +1,7 @@
From 8e28a9142cd8134b26aa2393c1f69bef6380f0dd Mon Sep 17 00:00:00 2001
From d708c949e4c6bdf5beb1fd728bcf12313c7bff42 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 2 Apr 2020 15:42:18 -0500
Subject: [PATCH] mf: Ask for more samples from upstream node when upon
Subject: [PATCH 23/45] mf: Ask for more samples from upstream node when upon
MF_E_TRANSFORM_NEED_MORE_INPUT
---

View File

@ -1,7 +1,7 @@
From 995e2219d01d20031dec55575cde152f9c60ae4c Mon Sep 17 00:00:00 2001
From a135f98d9caaa0a576820ddf76f999a1f90ec81f Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Fri, 3 Apr 2020 11:12:33 -0500
Subject: [PATCH] Expose PCM output type on AAC decoder.
Subject: [PATCH 24/45] Expose PCM output type on AAC decoder.
---
dlls/winegstreamer/mf_decode.c | 2 +-

View File

@ -0,0 +1,25 @@
From 9e07d838ba606bebe8cd0f902a8bb0e00adf37bc Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Fri, 1 May 2020 11:46:26 -0500
Subject: [PATCH 25/45] mfplat: Add I420 format information.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/mfplat/mediatype.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c
index f3895ca4d49..d8be5b1bff2 100644
--- a/dlls/mfplat/mediatype.c
+++ b/dlls/mfplat/mediatype.c
@@ -2628,6 +2628,7 @@ static const struct uncompressed_video_format video_formats[] =
{ &MFVideoFormat_A2R10G10B10, 4, 3, 1, 0 },
{ &MFVideoFormat_RGB8, 1, 3, 1, 0 },
{ &MFVideoFormat_L8, 1, 3, 1, 0 },
+ { &MFVideoFormat_I420, 1, 0, 0, 1 },
{ &MFVideoFormat_AYUV, 4, 3, 0, 1 },
{ &MFVideoFormat_I420, 1, 0, 0, 1 },
{ &MFVideoFormat_IMC1, 2, 3, 0, 1 },
--
2.28.0

View File

@ -1,7 +1,7 @@
From 0bcbaa2d255e02a0560e9d12576f33090d4603f3 Mon Sep 17 00:00:00 2001
From 5200b2daf7544fac24238aa4c9a1c4a4e0891640 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Fri, 1 May 2020 13:20:49 -0500
Subject: [PATCH] winegstreamer: Implement Color Converter MFT.
Subject: [PATCH 26/45] winegstreamer: Implement Color Converter MFT.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -748,7 +748,7 @@ index cebd8d5282f..eb467ffeeea 100644
+
#endif /* __GST_PRIVATE_INCLUDED__ */
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 22a42861d69..bb3c8b9e952 100644
index b699c1dc8ec..0b177198e5e 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -420,6 +420,9 @@ static HRESULT wmv_decoder_create(REFIID riid, void **ret)

View File

@ -1,7 +1,7 @@
From 345c4055e5e9301f1d1d9bef0beefdac905658a7 Mon Sep 17 00:00:00 2001
From f131ace70768330c0558a71af255d9577b8fe9bd Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Fri, 1 May 2020 22:36:02 -0500
Subject: [PATCH] HACK: Set BPS to 16 for output template.
Subject: [PATCH 27/45] HACK: Set BPS to 16 for output template.
---
dlls/winegstreamer/mf_decode.c | 5 +++++

View File

@ -1,7 +1,7 @@
From cce3f184251778d5a224a6566eb6e25f72c3a40e Mon Sep 17 00:00:00 2001
From cb7bdd310ec8ed0ac8772de715ef19716da744e2 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 9 Mar 2020 11:59:17 -0500
Subject: [PATCH] Improve tests
Subject: [PATCH 28/45] Improve tests
---
dlls/mfplat/tests/mfplat.c | 245 +++++++++++++++++++++++++++--
@ -13,10 +13,10 @@ Subject: [PATCH] Improve tests
create mode 100644 dlls/mfreadwrite/tests/test.mp4
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index fed6b392b21..aa73e7efd39 100644
index 4f5cf268d2a..82d76f7bbaa 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -438,6 +438,9 @@ static BOOL get_event(IMFMediaEventGenerator *generator, MediaEventType expected
@@ -439,6 +439,9 @@ static BOOL get_event(IMFMediaEventGenerator *generator, MediaEventType expected
return TRUE;
}
@ -26,7 +26,7 @@ index fed6b392b21..aa73e7efd39 100644
static void test_source_resolver(void)
{
struct test_callback callback = { { &test_create_from_url_callback_vtbl } };
@@ -461,6 +464,7 @@ static void test_source_resolver(void)
@@ -462,6 +465,7 @@ static void test_source_resolver(void)
PROPVARIANT var;
HRESULT hr;
GUID guid;
@ -34,7 +34,7 @@ index fed6b392b21..aa73e7efd39 100644
if (!pMFCreateSourceResolver)
{
@@ -594,13 +598,27 @@ static void test_source_resolver(void)
@@ -595,13 +599,27 @@ static void test_source_resolver(void)
ok(hr == S_OK, "Failed to get current media type, hr %#x.\n", hr);
hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid);
ok(hr == S_OK, "Failed to get media sub type, hr %#x.\n", hr);
@ -65,7 +65,7 @@ index fed6b392b21..aa73e7efd39 100644
var.vt = VT_EMPTY;
hr = IMFMediaSource_Start(mediasource, descriptor, &GUID_NULL, &var);
ok(hr == S_OK, "Failed to start media source, hr %#x.\n", hr);
@@ -611,9 +629,9 @@ todo_wine
@@ -612,9 +630,9 @@ todo_wine
get_event((IMFMediaEventGenerator *)mediasource, MESourceStarted, NULL);
@ -77,7 +77,7 @@ index fed6b392b21..aa73e7efd39 100644
for (i = 0; i < sample_count; ++i)
{
@@ -628,9 +646,14 @@ todo_wine
@@ -629,9 +647,14 @@ todo_wine
for (i = 0; i < sample_count; ++i)
{
static const LONGLONG MILLI_TO_100_NANO = 10000;
@ -93,7 +93,7 @@ index fed6b392b21..aa73e7efd39 100644
BOOL ret;
ret = get_event((IMFMediaEventGenerator *)video_stream, MEMediaSample, &var);
@@ -641,19 +664,38 @@ todo_wine
@@ -642,19 +665,38 @@ todo_wine
ok(var.vt == VT_UNKNOWN, "Unexpected value type %u from MEMediaSample event.\n", var.vt);
sample = (IMFSample *)var.punkVal;
@ -141,7 +141,7 @@ index fed6b392b21..aa73e7efd39 100644
}
if (i == sample_count)
@@ -723,6 +765,178 @@ todo_wine
@@ -724,6 +766,178 @@ todo_wine
DeleteFileW(filename);
}
@ -320,7 +320,7 @@ index fed6b392b21..aa73e7efd39 100644
static void init_functions(void)
{
HMODULE mod = GetModuleHandleA("mfplat.dll");
@@ -5855,6 +6069,7 @@ START_TEST(mfplat)
@@ -6009,6 +6223,7 @@ START_TEST(mfplat)
test_MFCreateMFByteStreamOnStream();
test_system_memory_buffer();
test_source_resolver();
@ -2679,7 +2679,7 @@ zKs;bQARC}!xiSZ6ESNJ5P+CoKB<O7nEod-NqPX>NU0kHoiM#Wkq*n&-SMq0^0~2cD
TJ;x-N6hTeOp(eUDP!ruh^$B~#
diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c
index ef25bbcb3eb..985490d348c 100644
index 2a6e3a1cc36..80db5f33772 100644
--- a/dlls/mfreadwrite/tests/mfplat.c
+++ b/dlls/mfreadwrite/tests/mfplat.c
@@ -629,9 +629,17 @@ static void test_source_reader(void)

View File

@ -1,301 +0,0 @@
From b7c1863e4ed928c15a8a1c7ef631369911958e08 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 16 Mar 2020 15:27:27 -0500
Subject: [PATCH] Miscellaneous
---
dlls/mfreadwrite/reader.c | 12 ++-
dlls/winegstreamer/gst_cbs.c | 20 ++---
dlls/winegstreamer/gst_cbs.h | 1 -
dlls/winegstreamer/media_source.c | 135 +++++++++++++++++++++++++++++-
4 files changed, 154 insertions(+), 14 deletions(-)
diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c
index 935074d62f9..9d86a5a0f8f 100644
--- a/dlls/mfreadwrite/reader.c
+++ b/dlls/mfreadwrite/reader.c
@@ -1597,6 +1597,7 @@ static HRESULT source_reader_create_decoder_for_stream(struct source_reader *rea
{
MFT_REGISTER_TYPE_INFO in_type, out_type;
CLSID *clsids, mft_clsid, category;
+ BOOL decoder_found = FALSE;
unsigned int i = 0, count;
IMFMediaType *input_type;
HRESULT hr;
@@ -1643,12 +1644,21 @@ static HRESULT source_reader_create_decoder_for_stream(struct source_reader *rea
}
}
+ else if (!decoder_found)
+ {
+ /* see if there are other decoders for this stream */
+ if (SUCCEEDED(MFTEnum(category, 0, &in_type, NULL, NULL, &clsids, &count)) && count)
+ {
+ decoder_found = TRUE;
+ CoTaskMemFree(clsids);
+ }
+ }
}
IMFMediaType_Release(input_type);
}
- return MF_E_TOPO_CODEC_NOT_FOUND;
+ return decoder_found ? MF_E_INVALIDREQUEST : MF_E_TOPO_CODEC_NOT_FOUND;
}
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 261a5b9f4ce..81692fdf919 100644
--- a/dlls/winegstreamer/gst_cbs.c
+++ b/dlls/winegstreamer/gst_cbs.c
@@ -18,6 +18,9 @@
#include "config.h"
+#include <stdio.h>
+#include <assert.h>
+
#include <gst/gst.h>
#include "objbase.h"
@@ -53,6 +56,12 @@ static void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user)
perform_cb_media_source(cbdata);
else if (cbdata->type < MF_DECODE_MAX)
perform_cb_mf_decode(cbdata);
+ else
+ {
+ fprintf(stderr, "No handler registered for callback\n");
+ assert(0);
+ }
+
pthread_mutex_lock(&cbdata->lock);
cbdata->finished = 1;
@@ -447,17 +456,6 @@ GstBusSyncReply watch_decoder_bus_wrapper(GstBus *bus, GstMessage *message, gpoi
return cbdata.u.watch_bus_data.ret;
}
-void decoder_pad_added_wrapper(GstElement *element, GstPad *pad, gpointer user)
-{
- struct cb_data cbdata = { DECODER_PAD_ADDED };
-
- cbdata.u.pad_added_data.element = element;
- cbdata.u.pad_added_data.pad = pad;
- cbdata.u.pad_added_data.user = user;
-
- call_cb(&cbdata);
-}
-
GstFlowReturn decoder_new_sample_wrapper(GstElement *appsink, gpointer user)
{
struct cb_data cbdata = {DECODER_NEW_SAMPLE};
diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h
index 6659aedefa5..825b46d13bb 100644
--- a/dlls/winegstreamer/gst_cbs.h
+++ b/dlls/winegstreamer/gst_cbs.h
@@ -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;
-void decoder_pad_added_wrapper(GstElement *element, GstPad *Pad, gpointer user) DECLSPEC_HIDDEN;
#endif
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 3c423f6d758..5e4691295f0 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -92,6 +92,8 @@ struct source_async_command
struct media_source
{
IMFMediaSource IMFMediaSource_iface;
+ IMFGetService IMFGetService_iface;
+ IMFSeekInfo IMFSeekInfo_iface;
IMFAsyncCallback async_commands_callback;
LONG ref;
DWORD async_commands_queue;
@@ -124,6 +126,16 @@ static inline struct media_source *impl_from_IMFMediaSource(IMFMediaSource *ifac
return CONTAINING_RECORD(iface, struct media_source, IMFMediaSource_iface);
}
+static inline struct media_source *impl_from_IMFGetService(IMFGetService *iface)
+{
+ return CONTAINING_RECORD(iface, struct media_source, IMFGetService_iface);
+}
+
+static inline struct media_source *impl_from_IMFSeekInfo(IMFSeekInfo *iface)
+{
+ return CONTAINING_RECORD(iface, struct media_source, IMFSeekInfo_iface);
+}
+
static inline struct media_source *impl_from_async_commands_callback_IMFAsyncCallback(IMFAsyncCallback *iface)
{
return CONTAINING_RECORD(iface, struct media_source, async_commands_callback);
@@ -520,6 +532,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:
+ {
+ gst_query_set_latency(query, FALSE, 0, 0);
+ return TRUE;
+ }
default:
{
WARN("Unhandled query type %s\n", GST_QUERY_TYPE_NAME(query));
@@ -582,6 +599,23 @@ GstBusSyncReply bus_watch(GstBus *bus, GstMessage *message, gpointer user)
g_error_free(err);
g_free(dbg_info);
break;
+ case GST_MESSAGE_TAG:
+ {
+ GstTagList *tag_list;
+ gchar *printable;
+ gst_message_parse_tag(message, &tag_list);
+ if (tag_list)
+ {
+ printable = gst_tag_list_to_string(tag_list);
+ if (printable)
+ {
+ TRACE("tag test: %s\n", debugstr_a(printable));
+ g_free(printable);
+ }
+ }
+
+ break;
+ }
default:
break;
}
@@ -1041,6 +1075,10 @@ static HRESULT WINAPI media_source_QueryInterface(IMFMediaSource *iface, REFIID
{
*out = &source->IMFMediaSource_iface;
}
+ else if(IsEqualIID(riid, &IID_IMFGetService))
+ {
+ *out = &source->IMFGetService_iface;
+ }
else
{
FIXME("(%s, %p)\n", debugstr_guid(riid), out);
@@ -1125,7 +1163,7 @@ static HRESULT WINAPI media_source_GetCharacteristics(IMFMediaSource *iface, DWO
if (source->state == SOURCE_SHUTDOWN)
return MF_E_SHUTDOWN;
- *characteristics = MFMEDIASOURCE_CAN_SEEK;
+ *characteristics = MFMEDIASOURCE_CAN_SEEK | MFMEDIASOURCE_CAN_PAUSE;
return S_OK;
}
@@ -1270,6 +1308,99 @@ static const IMFMediaSourceVtbl IMFMediaSource_vtbl =
media_source_Shutdown,
};
+static HRESULT WINAPI source_get_service_QueryInterface(IMFGetService *iface, REFIID riid, void **obj)
+{
+ struct media_source *source = impl_from_IMFGetService(iface);
+ return IMFMediaSource_QueryInterface(&source->IMFMediaSource_iface, riid, obj);
+}
+
+static ULONG WINAPI source_get_service_AddRef(IMFGetService *iface)
+{
+ struct media_source *source = impl_from_IMFGetService(iface);
+ return IMFMediaSource_AddRef(&source->IMFMediaSource_iface);
+}
+
+static ULONG WINAPI source_get_service_Release(IMFGetService *iface)
+{
+ struct media_source *source = impl_from_IMFGetService(iface);
+ return IMFMediaSource_Release(&source->IMFMediaSource_iface);
+}
+
+static HRESULT WINAPI source_get_service_GetService(IMFGetService *iface, REFGUID service, REFIID riid, void **obj)
+{
+ struct media_source *source = impl_from_IMFGetService(iface);
+
+ TRACE("(%p)->(%s, %s, %p)\n", source, debugstr_guid(service), debugstr_guid(riid), obj);
+
+ if (source->state == SOURCE_SHUTDOWN)
+ return MF_E_SHUTDOWN;
+
+ *obj = NULL;
+
+ if (IsEqualIID(service, &MF_SCRUBBING_SERVICE))
+ {
+ if (IsEqualIID(riid, &IID_IMFSeekInfo))
+ {
+ *obj = &source->IMFSeekInfo_iface;
+ }
+ }
+
+ if (*obj)
+ IUnknown_AddRef((IUnknown*) *obj);
+
+ return *obj ? S_OK : E_NOINTERFACE;
+}
+
+static const IMFGetServiceVtbl IMFGetService_vtbl =
+{
+ source_get_service_QueryInterface,
+ source_get_service_AddRef,
+ source_get_service_Release,
+ source_get_service_GetService,
+};
+
+static HRESULT WINAPI source_seek_info_QueryInterface(IMFSeekInfo *iface, REFIID riid, void **obj)
+{
+ struct media_source *source = impl_from_IMFSeekInfo(iface);
+ return IMFMediaSource_QueryInterface(&source->IMFMediaSource_iface, riid, obj);
+}
+
+static ULONG WINAPI source_seek_info_AddRef(IMFSeekInfo *iface)
+{
+ struct media_source *source = impl_from_IMFSeekInfo(iface);
+ return IMFMediaSource_AddRef(&source->IMFMediaSource_iface);
+}
+
+static ULONG WINAPI source_seek_info_Release(IMFSeekInfo *iface)
+{
+ struct media_source *source = impl_from_IMFSeekInfo(iface);
+ return IMFMediaSource_Release(&source->IMFMediaSource_iface);
+}
+
+static HRESULT WINAPI source_seek_info_GetNearestKeyFrames(IMFSeekInfo *iface, const GUID *format,
+ const PROPVARIANT *position, PROPVARIANT *prev_frame, PROPVARIANT *next_frame)
+{
+ struct media_source *source = impl_from_IMFSeekInfo(iface);
+
+ FIXME("(%p)->(%s, %p, %p, %p) - semi-stub\n", source, debugstr_guid(format), position, prev_frame, next_frame);
+
+ if (source->state == SOURCE_SHUTDOWN)
+ return MF_E_SHUTDOWN;
+
+ PropVariantCopy(prev_frame, position);
+ PropVariantCopy(next_frame, position);
+
+ return S_OK;
+}
+
+static const IMFSeekInfoVtbl IMFSeekInfo_vtbl =
+{
+ source_seek_info_QueryInterface,
+ source_seek_info_AddRef,
+ source_seek_info_Release,
+ source_seek_info_GetNearestKeyFrames,
+};
+
/* 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)
@@ -1358,6 +1489,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
}
object->IMFMediaSource_iface.lpVtbl = &IMFMediaSource_vtbl;
+ object->IMFGetService_iface.lpVtbl = &IMFGetService_vtbl;
+ object->IMFSeekInfo_iface.lpVtbl = &IMFSeekInfo_vtbl;
object->async_commands_callback.lpVtbl = &source_async_commands_callback_vtbl;
object->ref = 1;
object->byte_stream = bytestream;
--
2.28.0

View File

@ -1,7 +1,7 @@
From 97213490527eb3adab5279dc4b56284b44234573 Mon Sep 17 00:00:00 2001
From 00e320809b10854a9870c28782eac3aa8fd0e864 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 25 Mar 2020 13:58:36 -0500
Subject: [PATCH] Revert "Improve tests"
Subject: [PATCH 29/45] Revert "Improve tests"
This reverts commit 603b1717a2b511a66d3be99ab5761d49cd5ef34d.
---
@ -14,10 +14,10 @@ This reverts commit 603b1717a2b511a66d3be99ab5761d49cd5ef34d.
delete mode 100644 dlls/mfreadwrite/tests/test.mp4
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index aa73e7efd39..1d9d1e326c9 100644
index 82d76f7bbaa..9634ee059b0 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -438,9 +438,6 @@ static BOOL get_event(IMFMediaEventGenerator *generator, MediaEventType expected
@@ -439,9 +439,6 @@ static BOOL get_event(IMFMediaEventGenerator *generator, MediaEventType expected
return TRUE;
}
@ -27,7 +27,7 @@ index aa73e7efd39..1d9d1e326c9 100644
static void test_source_resolver(void)
{
struct test_callback callback = { { &test_create_from_url_callback_vtbl } };
@@ -464,7 +461,6 @@ static void test_source_resolver(void)
@@ -465,7 +462,6 @@ static void test_source_resolver(void)
PROPVARIANT var;
HRESULT hr;
GUID guid;
@ -35,7 +35,7 @@ index aa73e7efd39..1d9d1e326c9 100644
if (!pMFCreateSourceResolver)
{
@@ -598,27 +594,12 @@ static void test_source_resolver(void)
@@ -599,27 +595,12 @@ static void test_source_resolver(void)
ok(hr == S_OK, "Failed to get current media type, hr %#x.\n", hr);
hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid);
ok(hr == S_OK, "Failed to get media sub type, hr %#x.\n", hr);
@ -65,7 +65,7 @@ index aa73e7efd39..1d9d1e326c9 100644
var.vt = VT_EMPTY;
hr = IMFMediaSource_Start(mediasource, descriptor, &GUID_NULL, &var);
ok(hr == S_OK, "Failed to start media source, hr %#x.\n", hr);
@@ -629,9 +610,9 @@ static void test_source_resolver(void)
@@ -630,9 +611,9 @@ static void test_source_resolver(void)
get_event((IMFMediaEventGenerator *)mediasource, MESourceStarted, NULL);
@ -77,7 +77,7 @@ index aa73e7efd39..1d9d1e326c9 100644
for (i = 0; i < sample_count; ++i)
{
@@ -646,14 +627,9 @@ static void test_source_resolver(void)
@@ -647,14 +628,9 @@ static void test_source_resolver(void)
for (i = 0; i < sample_count; ++i)
{
static const LONGLONG MILLI_TO_100_NANO = 10000;
@ -93,7 +93,7 @@ index aa73e7efd39..1d9d1e326c9 100644
BOOL ret;
ret = get_event((IMFMediaEventGenerator *)video_stream, MEMediaSample, &var);
@@ -664,38 +640,19 @@ static void test_source_resolver(void)
@@ -665,38 +641,19 @@ static void test_source_resolver(void)
ok(var.vt == VT_UNKNOWN, "Unexpected value type %u from MEMediaSample event.\n", var.vt);
sample = (IMFSample *)var.punkVal;
@ -141,7 +141,7 @@ index aa73e7efd39..1d9d1e326c9 100644
}
if (i == sample_count)
@@ -765,178 +722,6 @@ static void test_source_resolver(void)
@@ -766,178 +723,6 @@ static void test_source_resolver(void)
DeleteFileW(filename);
}
@ -320,7 +320,7 @@ index aa73e7efd39..1d9d1e326c9 100644
static void init_functions(void)
{
HMODULE mod = GetModuleHandleA("mfplat.dll");
@@ -6069,7 +5854,6 @@ START_TEST(mfplat)
@@ -6223,7 +6008,6 @@ START_TEST(mfplat)
test_MFCreateMFByteStreamOnStream();
test_system_memory_buffer();
test_source_resolver();
@ -2679,7 +2679,7 @@ zfQ)qlARIsx0Hh62ATV5k(+0j9`c{9|0J%OK0QBskcDevpw=lTjNcF>i79OBj+33Px
p$lCDV^w{Kgb))}cXN3$%0oA>6Mg|4R>N*%cfv|D$vvG28{1-l>vtIxJ
diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c
index 985490d348c..03f0d9a1c2a 100644
index 80db5f33772..02ed9394c20 100644
--- a/dlls/mfreadwrite/tests/mfplat.c
+++ b/dlls/mfreadwrite/tests/mfplat.c
@@ -629,15 +629,10 @@ static void test_source_reader(void)

View File

@ -1,26 +1,26 @@
From d4ed09c6230669d7617e411f6e8fa02a3f27da68 Mon Sep 17 00:00:00 2001
From 59f92f0be3ee0737143dba49a6677cefb448785b Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 5 May 2020 15:35:16 -0500
Subject: [PATCH] Report streams backwards and only select one of each stream
type.
Subject: [PATCH 30/45] 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 5e4691295f0..f42f13b50b4 100644
index 0fcc2ca42f3..9a6b2b8242c 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -1469,6 +1469,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
@@ -1460,6 +1460,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;
IMFAttributes *byte_stream_attributes;
gint64 total_pres_time = 0;
DWORD bytestream_caps;
@@ -1581,15 +1582,34 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
@@ -1573,15 +1574,34 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
descriptors = heap_alloc(object->stream_count * sizeof(IMFStreamDescriptor*));
for (i = 0; i < object->stream_count; i++)
{

View File

@ -1,7 +1,7 @@
From 989d560772ee17be116f11c585a1aaa5bcd245bd Mon Sep 17 00:00:00 2001
From 17153f26c5b725631a72e28a3330dfaf010d8ed7 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 7 May 2020 13:09:47 -0500
Subject: [PATCH] winegstreamer: Implement IMFMediaSource::Stop.
Subject: [PATCH 31/45] winegstreamer: Implement IMFMediaSource::Stop.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -9,7 +9,7 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 9fa8b106ba2..01e1d08ab0d 100644
index 9a6b2b8242c..20417bca8f6 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -65,6 +65,7 @@ struct media_stream
@ -44,7 +44,7 @@ index 9fa8b106ba2..01e1d08ab0d 100644
static void dispatch_end_of_presentation(struct media_source *source)
{
PROPVARIANT empty = {.vt = VT_EMPTY};
@@ -428,6 +446,9 @@ static HRESULT WINAPI source_async_commands_Invoke(IMFAsyncCallback *iface, IMFA
@@ -430,6 +448,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 9fa8b106ba2..01e1d08ab0d 100644
case SOURCE_ASYNC_REQUEST_SAMPLE:
wait_on_sample(command->u.request_sample.stream, command->u.request_sample.token);
break;
@@ -1208,13 +1229,18 @@ static HRESULT WINAPI media_source_Start(IMFMediaSource *iface, IMFPresentationD
@@ -1201,13 +1222,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);

View File

@ -1,7 +1,8 @@
From 929672514284dc952cb4b5a055896f775fbb20a3 Mon Sep 17 00:00:00 2001
From 47f494894fa474319f1323e6489d1db3c145f478 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 11 May 2020 16:05:50 -0500
Subject: [PATCH] winegstreamer: Introduce MPEG-4 Section-2 video decoder.
Subject: [PATCH 32/45] winegstreamer: Introduce MPEG-4 Section-2 video
decoder.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -53,7 +54,7 @@ index 64138f8cd94..285b3595143 100644
};
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index bb3c8b9e952..ec28bf321e2 100644
index 0b177198e5e..3fbb9fcbe1d 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -421,6 +421,11 @@ static HRESULT wmv_decoder_create(REFIID riid, void **ret)
@ -136,10 +137,10 @@ index 1556b6cff9f..5969eaa591a 100644
threading(both),
uuid(82d353df-90bd-4382-8bc2-3f6192b76e34)
diff --git a/include/mfidl.idl b/include/mfidl.idl
index 467e123255b..4879b612e19 100644
index 7cb027b156a..926f593b3bc 100644
--- a/include/mfidl.idl
+++ b/include/mfidl.idl
@@ -1292,5 +1292,6 @@ cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_FLAGS, 0xba491366, 0xb
@@ -1308,5 +1308,6 @@ cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_FLAGS, 0xba491366, 0xb
cpp_quote("EXTERN_GUID(CLSID_VideoProcessorMFT, 0x88753b26, 0x5b24, 0x49bd, 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82);")
cpp_quote("EXTERN_GUID(CLSID_CMSH264DecoderMFT, 0x62ce7e72, 0x4c71, 0x4d20, 0xb1, 0x5d, 0x45, 0x28, 0x31, 0xa8, 0x7d, 0x9d);")
cpp_quote("EXTERN_GUID(CLSID_CMSAACDecMFT, 0x32d186a7, 0x218f, 0x4c75, 0x88, 0x76, 0xdd, 0x77, 0x27, 0x3a, 0x89, 0x99);")

View File

@ -1,7 +1,7 @@
From e4f68c74405a43f0c577527eec93c161999e59e2 Mon Sep 17 00:00:00 2001
From d087bd05fe0f24fdce30b355b7f574e7006aec7b Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 12 May 2020 16:48:52 -0500
Subject: [PATCH] HACK: Switch between all selection streams on
Subject: [PATCH 33/45] HACK: Switch between all selection streams on
MF_SOURCE_READER_ANY_STREAM.
---
@ -9,7 +9,7 @@ Subject: [PATCH] HACK: Switch between all selection streams on
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c
index 097921a4cc4..9539b537384 100644
index 9d86a5a0f8f..41880fa3289 100644
--- a/dlls/mfreadwrite/reader.c
+++ b/dlls/mfreadwrite/reader.c
@@ -1046,7 +1046,29 @@ static HRESULT source_reader_get_stream_read_index(struct source_reader *reader,

View File

@ -1,7 +1,7 @@
From 38004c4f34041e8b3ab23f435640e36c3082496f Mon Sep 17 00:00:00 2001
From 5b255a7924716e975762b27c691596182cbcbd3b Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 12 May 2020 16:50:41 -0500
Subject: [PATCH] winegstreamer: Introduce WMA audio decoder.
Subject: [PATCH 34/45] winegstreamer: Introduce WMA audio decoder.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -53,7 +53,7 @@ index 285b3595143..2cbe99d3168 100644
&MFMediaType_Video,
m4s2_input_types,
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index ec28bf321e2..ca432072ada 100644
index 3fbb9fcbe1d..4e2979483d9 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -421,6 +421,11 @@ static HRESULT wmv_decoder_create(REFIID riid, void **ret)
@ -134,10 +134,10 @@ index 5969eaa591a..c014d359a39 100644
threading(both),
uuid(98230571-0087-4204-b020-3282538e57d3)
diff --git a/include/mfidl.idl b/include/mfidl.idl
index 4879b612e19..ecdfed3b1c4 100644
index 926f593b3bc..ca469846458 100644
--- a/include/mfidl.idl
+++ b/include/mfidl.idl
@@ -1294,4 +1294,5 @@ cpp_quote("EXTERN_GUID(CLSID_CMSH264DecoderMFT, 0x62ce7e72, 0x4c71, 0x4d20, 0xb1
@@ -1310,4 +1310,5 @@ cpp_quote("EXTERN_GUID(CLSID_CMSH264DecoderMFT, 0x62ce7e72, 0x4c71, 0x4d20, 0xb1
cpp_quote("EXTERN_GUID(CLSID_CMSAACDecMFT, 0x32d186a7, 0x218f, 0x4c75, 0x88, 0x76, 0xdd, 0x77, 0x27, 0x3a, 0x89, 0x99);")
cpp_quote("EXTERN_GUID(CLSID_CMpeg4sDecMFT, 0x5686a0d9, 0xfe39, 0x409f, 0x9d, 0xff, 0x3f, 0xdb, 0xc8, 0x49, 0xf9, 0xf5);")
cpp_quote("EXTERN_GUID(CLSID_ASFByteStreamHandler, 0x41457294, 0x644c, 0x4298, 0xa2, 0x8a, 0xbd, 0x69, 0xf2, 0xc0, 0xcf, 0x3b);")

View File

@ -1,7 +1,7 @@
From 6d8717d60bb7c0ed3d0f434cef8b8e06982e4b12 Mon Sep 17 00:00:00 2001
From 72c0ff199851b1e62e6f88c302191d19201a1e00 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 13 May 2020 12:32:42 -0500
Subject: [PATCH] Support stereo down folding.
Subject: [PATCH 35/45] Support stereo down folding.
---
dlls/winegstreamer/mf_decode.c | 4 +++-

View File

@ -0,0 +1,65 @@
From c7b2d030313e7a3cbdc5ee960698020dffc99b20 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 11 Aug 2020 13:41:15 -0500
Subject: [PATCH 36/45] winegstreamer: Implement MF_SD_LANGUAGE.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/media_source.c | 32 ++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 20417bca8f6..b138ddb7cb6 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -1635,11 +1635,12 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
for (i = 0; i < object->stream_count; i++)
{
+ struct media_stream *stream = object->streams[i];
gint64 stream_pres_time;
- if (gst_pad_query_duration(object->streams[i]->their_src, GST_FORMAT_TIME, &stream_pres_time))
- {
- TRACE("Stream %u has duration %llu\n", i, (unsigned long long int) stream_pres_time);
+ GstEvent *tag_event;
+ if (gst_pad_query_duration(stream->their_src, GST_FORMAT_TIME, &stream_pres_time))
+ {
if (stream_pres_time > total_pres_time)
total_pres_time = stream_pres_time;
}
@@ -1647,6 +1648,31 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
{
WARN("Unable to get presentation time of stream %u\n", i);
}
+
+ tag_event = gst_pad_get_sticky_event(stream->their_src, GST_EVENT_TAG, 0);
+ if (tag_event)
+ {
+ GstTagList *tag_list;
+ gchar *language_code = NULL;
+
+ gst_event_parse_tag(tag_event, &tag_list);
+
+ gst_tag_list_get_string(tag_list, "language-code", &language_code);
+ if (language_code)
+ {
+ DWORD char_count = MultiByteToWideChar(CP_UTF8, 0, language_code, -1, NULL, 0);
+ if (char_count)
+ {
+ WCHAR *language_codeW = heap_alloc(char_count * sizeof(WCHAR));
+ MultiByteToWideChar(CP_UTF8, 0, language_code, -1, language_codeW, char_count);
+ IMFStreamDescriptor_SetString(stream->descriptor, &MF_SD_LANGUAGE, language_codeW);
+ heap_free(language_codeW);
+ }
+ g_free(language_code);
+ }
+
+ gst_event_unref(tag_event);
+ }
}
if (object->stream_count)
--
2.28.0

View File

@ -1,8 +1,8 @@
From 24188ec9a6a170681972e4cb207adc7462a4a922 Mon Sep 17 00:00:00 2001
From dc16275dcbce65fababff4a3497d95c208c8d3d4 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 11 Aug 2020 15:58:42 -0500
Subject: [PATCH] Revert "mf/topoloader: Add a structure for iterative branch
resolution."
Subject: [PATCH 37/45] 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 be8241a51d7..6c528639ba8 100644
index c38c817eb4b..e3b98be0373 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -1401,7 +1401,6 @@ static void test_topology_loader(void)

View File

@ -1,8 +1,8 @@
From 83da0cbda9f2043b14663ce2317586de6e21d927 Mon Sep 17 00:00:00 2001
From b913b275b9cb917f5678edb6933aa4b466ea6f3b Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 11 Aug 2020 15:59:04 -0500
Subject: [PATCH] Revert "mf/topoloader: Clone source nodes as a first layer of
resulting topology."
Subject: [PATCH 38/45] Revert "mf/topoloader: Clone source nodes as a first
layer of resulting topology."
This reverts commit 16d44b61d15193905ef40661bc1547cb45e7b019.
---

View File

@ -1,8 +1,8 @@
From 130b24d9511991adb1d55ae3d5ec59a407a0e82e Mon Sep 17 00:00:00 2001
From 560114776a915562b1b8806152d942179b561f08 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 11 Aug 2020 15:59:13 -0500
Subject: [PATCH] Revert "mf/topoloader: Switch to public interface for initial
topology validation."
Subject: [PATCH 39/45] Revert "mf/topoloader: Switch to public interface for
initial topology validation."
This reverts commit 8e343024b577892bd4908304ded34b758579698d.
---

View File

@ -1,8 +1,8 @@
From f55a0e2a83a41999e392fd4be9dacc80ec626801 Mon Sep 17 00:00:00 2001
From c43cb0299991d7fdfa0d7e7663efbaa55a703e98 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sergio=20G=C3=B3mez=20Del=20Real?=
<sdelreal@codeweavers.com>
Date: Wed, 1 Apr 2020 16:11:07 -0500
Subject: [PATCH] mf: Partially implement the topology loader.
Subject: [PATCH 40/45] 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 <sdelreal@codeweavers.com>
2 files changed, 321 insertions(+), 19 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 6c528639ba8..972d4359f4b 100644
index e3b98be0373..2d67834f0d5 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -1429,7 +1429,6 @@ static void test_topology_loader(void)

View File

@ -1,7 +1,7 @@
From 21bdbd16a00d5f75fef526b5d933cde9fa92f29f Mon Sep 17 00:00:00 2001
From 834d9e0e52a501ee1443ded7e40ee78a1c8936ea Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 2 Apr 2020 15:43:52 -0500
Subject: [PATCH] mf: Miscelaneous fixes to topology resolution.
Subject: [PATCH 41/45] mf: Miscelaneous fixes to topology resolution.
---
dlls/mf/topology.c | 16 +++++++++-------

View File

@ -1,7 +1,7 @@
From d0910c4c1f9bf9d2f021a1b1f49701e676177cee Mon Sep 17 00:00:00 2001
From bf5491001ff68bd3f3a47f9569c16615990e13b2 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 2 Apr 2020 15:45:52 -0500
Subject: [PATCH] Rewrite branch resolver.
Subject: [PATCH 42/45] Rewrite branch resolver.
and a HACK: Set output type of found decoder, this should probably happen somewhere else.
---

View File

@ -1,7 +1,7 @@
From f44bbde1f61c8551d4b089caa65899b8fb1e55fe Mon Sep 17 00:00:00 2001
From 4e88271299bbdf5e9a1090359f756a2769cc1024 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 26 Aug 2020 10:28:37 -0500
Subject: [PATCH] winegstreamer: Implement audio conversion MFT.
Subject: [PATCH 43/45] winegstreamer: Implement audio conversion MFT.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
@ -806,7 +806,7 @@ index e5e11d06da6..a5fe02ff879 100644
#endif /* __GST_PRIVATE_INCLUDED__ */
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index ca432072ada..6dec73e2047 100644
index 4e2979483d9..c330416c939 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -433,6 +433,8 @@ static HRESULT m4s2_decoder_create(REFIID riid, void **ret)

View File

@ -1,7 +1,7 @@
From a60c1e4d37e939a4ce9b6153434029ad953e8dae Mon Sep 17 00:00:00 2001
From e7999e5e011156c517ca17d284ed10473b584890 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 14 Oct 2020 11:07:34 -0500
Subject: [PATCH] HACK: Shutdown media sinks on session shutdown.
Subject: [PATCH 44/45] HACK: Shutdown media sinks on session shutdown.
TODO: We should be doing this through IMFActivate.
---

View File

@ -1,7 +1,7 @@
From a8e23c3cea2e8ffdedc2330f390de01ec2d1588a Mon Sep 17 00:00:00 2001
From 064abcfc3ae7b8704ed5b31f4dd8b1c23127f4b3 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 15 Oct 2020 12:18:10 -0500
Subject: [PATCH] HACK: Flush decoder when changing times.
Subject: [PATCH 45/45] HACK: Flush decoder when changing times.
---
dlls/mf/session.c | 3 +++

View File

@ -1,64 +0,0 @@
From ce03f4924c73e2170aa314e9759661267466ed23 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 11 Aug 2020 13:41:15 -0500
Subject: [PATCH] winegstreamer: Implement MF_SD_LANGUAGE.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/media_source.c | 33 +++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 01e1d08ab0d..a178268af1e 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -1647,8 +1647,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++)
{
- GstQuery *query = gst_query_new_duration(GST_FORMAT_TIME);
- if (gst_pad_query(object->streams[i]->their_src, query))
+ struct media_stream *stream = object->streams[i];
+ GstEvent *tag_event;
+ GstQuery *query;
+
+ query = gst_query_new_duration(GST_FORMAT_TIME);
+ if (gst_pad_query(stream->their_src, query))
{
gint64 stream_pres_time;
gst_query_parse_duration(query, NULL, &stream_pres_time);
@@ -1662,6 +1666,31 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
{
WARN("Unable to get presentation time of stream %u\n", i);
}
+
+ tag_event = gst_pad_get_sticky_event(stream->their_src, GST_EVENT_TAG, 0);
+ if (tag_event)
+ {
+ GstTagList *tag_list;
+ gchar *language_code = NULL;
+
+ gst_event_parse_tag(tag_event, &tag_list);
+
+ gst_tag_list_get_string(tag_list, "language-code", &language_code);
+ if (language_code)
+ {
+ DWORD char_count = MultiByteToWideChar(CP_UTF8, 0, language_code, -1, NULL, 0);
+ if (char_count)
+ {
+ WCHAR *language_codeW = heap_alloc(char_count * sizeof(WCHAR));
+ MultiByteToWideChar(CP_UTF8, 0, language_code, -1, language_codeW, char_count);
+ IMFStreamDescriptor_SetString(stream->descriptor, &MF_SD_LANGUAGE, language_codeW);
+ heap_free(language_codeW);
+ }
+ g_free(language_code);
+ }
+
+ gst_event_unref(tag_event);
+ }
}
if (object->stream_count)
--
2.28.0

View File

@ -1,2 +1 @@
Fixes: [49692] Multiple applications need a Media Foundation media source implementation
Disabled: True

View File

@ -145,6 +145,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"
@ -519,6 +520,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"
;;
@ -2809,6 +2813,70 @@ 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] Multiple applications need a Media Foundation media source implementation
# |
# | Modified files:
# | * dlls/mf/Makefile.in, dlls/mf/handler.c, dlls/mf/handler.h, dlls/mf/main.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-IMFSeekInfo-GetNearestKeyFrames-st.patch
patch_apply mfplat-streaming-support/0002-winegstreamer-Fixup-raw-audio-caps-to-be-compatible-.patch
patch_apply mfplat-streaming-support/0003-winegstreamer-Set-MF_PD_MIME_TYPE-on-source-s-presen.patch
patch_apply mfplat-streaming-support/0004-mf-Unconditionally-deliver-NULL-EOS-samples.patch
patch_apply mfplat-streaming-support/0005-winegstreamer-Insert-parser-into-pipeline-to-rectify.patch
patch_apply mfplat-streaming-support/0006-winegstreamer-Translate-H.264-caps-to-attributes.patch
patch_apply mfplat-streaming-support/0007-winegstreamer-Translate-WMV-caps-to-attributes.patch
patch_apply mfplat-streaming-support/0008-winegstreamer-Translate-AAC-caps-to-attributes.patch
patch_apply mfplat-streaming-support/0009-winegstreamer-Translate-MPEG-4-Section-2-caps-to-att.patch
patch_apply mfplat-streaming-support/0010-winegstreamer-Translate-WMA-caps-to-attributes.patch
patch_apply mfplat-streaming-support/0011-winegstreamer-Translate-H.264-attributes-to-caps.patch
patch_apply mfplat-streaming-support/0012-winegstreamer-Translate-WMV-attributes-to-caps.patch
patch_apply mfplat-streaming-support/0013-winegstreamer-Translate-AAC-attributes-to-caps.patch
patch_apply mfplat-streaming-support/0014-winegstreamer-Translate-MPEG-4-Section-2-attributes-.patch
patch_apply mfplat-streaming-support/0015-winegstreamer-Translate-WMA-attributes-to-caps.patch
patch_apply mfplat-streaming-support/0016-tools-Add-support-for-multiple-parent-directories.patch
patch_apply mfplat-streaming-support/0017-mf-Introduce-handler-helper.patch
patch_apply mfplat-streaming-support/0018-Introduce-IMFSample-GstBuffer-converter.patch
patch_apply mfplat-streaming-support/0019-winegstreamer-Implement-decoder-MFT-on-gstreamer.patch
patch_apply mfplat-streaming-support/0020-mfreadwrite-Select-all-streams-when-creating-a-sourc.patch
patch_apply mfplat-streaming-support/0021-Miscellaneous.patch
patch_apply mfplat-streaming-support/0022-WMV.patch
patch_apply mfplat-streaming-support/0023-mf-Ask-for-more-samples-from-upstream-node-when-upon.patch
patch_apply mfplat-streaming-support/0024-Expose-PCM-output-type-on-AAC-decoder.patch
patch_apply mfplat-streaming-support/0025-mfplat-Add-I420-format-information.patch
patch_apply mfplat-streaming-support/0026-winegstreamer-Implement-Color-Converter-MFT.patch
patch_apply mfplat-streaming-support/0027-HACK-Set-BPS-to-16-for-output-template.patch
patch_apply mfplat-streaming-support/0028-Improve-tests.patch
patch_apply mfplat-streaming-support/0029-Revert-Improve-tests.patch
patch_apply mfplat-streaming-support/0030-Report-streams-backwards-and-only-select-one-of-each.patch
patch_apply mfplat-streaming-support/0031-winegstreamer-Implement-IMFMediaSource-Stop.patch
patch_apply mfplat-streaming-support/0032-winegstreamer-Introduce-MPEG-4-Section-2-video-decod.patch
patch_apply mfplat-streaming-support/0033-HACK-Switch-between-all-selection-streams-on-MF_SOUR.patch
patch_apply mfplat-streaming-support/0034-winegstreamer-Introduce-WMA-audio-decoder.patch
patch_apply mfplat-streaming-support/0035-Support-stereo-down-folding.patch
patch_apply mfplat-streaming-support/0036-winegstreamer-Implement-MF_SD_LANGUAGE.patch
patch_apply mfplat-streaming-support/0037-Revert-mf-topoloader-Add-a-structure-for-iterative-b.patch
patch_apply mfplat-streaming-support/0038-Revert-mf-topoloader-Clone-source-nodes-as-a-first-l.patch
patch_apply mfplat-streaming-support/0039-Revert-mf-topoloader-Switch-to-public-interface-for-.patch
patch_apply mfplat-streaming-support/0040-mf-Partially-implement-the-topology-loader.patch
patch_apply mfplat-streaming-support/0041-mf-Miscelaneous-fixes-to-topology-resolution.patch
patch_apply mfplat-streaming-support/0042-Rewrite-branch-resolver.patch
patch_apply mfplat-streaming-support/0043-winegstreamer-Implement-audio-conversion-MFT.patch
patch_apply mfplat-streaming-support/0044-HACK-Shutdown-media-sinks-on-session-shutdown.patch
patch_apply mfplat-streaming-support/0045-HACK-Flush-decoder-when-changing-times.patch
patch_apply mfplat-streaming-support/0060-winegstreamer-Support-eAVEncH264VProfile_Constrained.patch
fi
# Patchset mmsystem.dll16-MIDIHDR_Refcount
# |
# | This patchset fixes the following Wine bugs: