Updated mfplat-streaming-support patchset

This commit is contained in:
Alistair Leslie-Hughes 2020-12-13 08:44:17 +11:00
parent e015f0590c
commit a8684593e2
54 changed files with 651 additions and 16301 deletions

View File

@ -0,0 +1,28 @@
From dc2ee56fbd2ed96f69ab5ccad4ff7666165760d4 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 9 Dec 2020 11:46:58 -0500
Subject: [PATCH] winegstreamer: Correct mistaken enum value in ProcessMessage.
This is the message session relies on succeeding.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/audioconvert.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
index c5762bfdc60..82467b2f4e2 100644
--- a/dlls/winegstreamer/audioconvert.c
+++ b/dlls/winegstreamer/audioconvert.c
@@ -517,7 +517,7 @@ static HRESULT WINAPI audio_converter_ProcessMessage(IMFTransform *iface, MFT_ME
switch(message)
{
- case MFT_MESSAGE_NOTIFY_START_OF_STREAM:
+ case MFT_MESSAGE_NOTIFY_BEGIN_STREAMING:
return S_OK;
default:
FIXME("Unhandled message type %x.\n", message);
--
2.29.2

View File

@ -0,0 +1,221 @@
From ccab220bdd329dea69291405ebeba0f6c17439ad Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Fri, 4 Dec 2020 15:51:00 -0500
Subject: [PATCH] winegstreamer: Reformat type-setting functions to prevent the
need for a conditionally initialized variable.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/audioconvert.c | 153 ++++++++++++++++--------------
1 file changed, 82 insertions(+), 71 deletions(-)
diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
index 82467b2f4e2..85f44dd8856 100644
--- a/dlls/winegstreamer/audioconvert.c
+++ b/dlls/winegstreamer/audioconvert.c
@@ -276,7 +276,9 @@ fail:
static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
{
+ GUID major_type, subtype;
GstCaps *input_caps;
+ DWORD unused;
HRESULT hr;
struct audio_converter *converter = impl_audio_converter_from_IMFTransform(iface);
@@ -286,34 +288,46 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
if (id != 0)
return MF_E_INVALIDSTREAMNUMBER;
- if (type)
+ if (!type)
{
- GUID major_type, subtype;
- DWORD unused;
-
- if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major_type)))
- return MF_E_INVALIDTYPE;
- if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
- return MF_E_INVALIDTYPE;
- if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &unused)))
- return MF_E_INVALIDTYPE;
- if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &unused)))
- return MF_E_INVALIDTYPE;
- if (IsEqualGUID(&subtype, &MFAudioFormat_PCM) && FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_BITS_PER_SAMPLE, &unused)))
- return MF_E_INVALIDTYPE;
-
- if (!(IsEqualGUID(&major_type, &MFMediaType_Audio)))
- return MF_E_INVALIDTYPE;
-
- if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM) && !IsEqualGUID(&subtype, &MFAudioFormat_Float))
- return MF_E_INVALIDTYPE;
-
- if (!(input_caps = caps_from_mf_media_type(type)))
- return MF_E_INVALIDTYPE;
-
- gst_caps_unref(input_caps);
+ if (flags & MFT_SET_TYPE_TEST_ONLY)
+ return S_OK;
+
+ EnterCriticalSection(&converter->cs);
+
+ if (converter->input_type)
+ {
+ IMFMediaType_Release(converter->input_type);
+ converter->input_type = NULL;
+ }
+
+ LeaveCriticalSection(&converter->cs);
+
+ return S_OK;
}
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major_type)))
+ return MF_E_INVALIDTYPE;
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
+ return MF_E_INVALIDTYPE;
+ if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &unused)))
+ return MF_E_INVALIDTYPE;
+ if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &unused)))
+ return MF_E_INVALIDTYPE;
+ if (IsEqualGUID(&subtype, &MFAudioFormat_PCM) && FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_BITS_PER_SAMPLE, &unused)))
+ return MF_E_INVALIDTYPE;
+
+ if (!(IsEqualGUID(&major_type, &MFMediaType_Audio)))
+ return MF_E_INVALIDTYPE;
+
+ if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM) && !IsEqualGUID(&subtype, &MFAudioFormat_Float))
+ return MF_E_INVALIDTYPE;
+
+ if (!(input_caps = caps_from_mf_media_type(type)))
+ return MF_E_INVALIDTYPE;
+
+ gst_caps_unref(input_caps);
+
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
@@ -321,21 +335,13 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
hr = S_OK;
- if (type)
- {
- if (!converter->input_type)
- hr = MFCreateMediaType(&converter->input_type);
+ if (!converter->input_type)
+ hr = MFCreateMediaType(&converter->input_type);
- if (SUCCEEDED(hr))
- hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->input_type);
+ if (SUCCEEDED(hr))
+ hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->input_type);
- if (FAILED(hr))
- {
- IMFMediaType_Release(converter->input_type);
- converter->input_type = NULL;
- }
- }
- else if (converter->input_type)
+ if (FAILED(hr))
{
IMFMediaType_Release(converter->input_type);
converter->input_type = NULL;
@@ -362,33 +368,46 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
if (!converter->input_type)
return MF_E_TRANSFORM_TYPE_NOT_SET;
- if (type)
+ if (!type)
{
- /* validate the type */
-
- if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major_type)))
- return MF_E_INVALIDTYPE;
- if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
- return MF_E_INVALIDTYPE;
- if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &unused)))
- return MF_E_INVALIDTYPE;
- if (IsEqualGUID(&subtype, &MFAudioFormat_PCM) && FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_BITS_PER_SAMPLE, &unused)))
- return MF_E_INVALIDTYPE;
- if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &unused)))
- return MF_E_INVALIDTYPE;
+ if (flags & MFT_SET_TYPE_TEST_ONLY)
+ return S_OK;
- if (!(IsEqualGUID(&major_type, &MFMediaType_Audio)))
- return MF_E_INVALIDTYPE;
+ EnterCriticalSection(&converter->cs);
- if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM) && !IsEqualGUID(&subtype, &MFAudioFormat_Float))
- return MF_E_INVALIDTYPE;
+ if (converter->output_type)
+ {
+ IMFMediaType_Release(converter->output_type);
+ converter->output_type = NULL;
+ }
- if (!(output_caps = caps_from_mf_media_type(type)))
- return MF_E_INVALIDTYPE;
+ LeaveCriticalSection(&converter->cs);
- gst_caps_unref(output_caps);
+ return S_OK;
}
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major_type)))
+ return MF_E_INVALIDTYPE;
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
+ return MF_E_INVALIDTYPE;
+ if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &unused)))
+ return MF_E_INVALIDTYPE;
+ if (IsEqualGUID(&subtype, &MFAudioFormat_PCM) && FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_BITS_PER_SAMPLE, &unused)))
+ return MF_E_INVALIDTYPE;
+ if (FAILED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &unused)))
+ return MF_E_INVALIDTYPE;
+
+ if (!(IsEqualGUID(&major_type, &MFMediaType_Audio)))
+ return MF_E_INVALIDTYPE;
+
+ if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM) && !IsEqualGUID(&subtype, &MFAudioFormat_Float))
+ return MF_E_INVALIDTYPE;
+
+ if (!(output_caps = caps_from_mf_media_type(type)))
+ return MF_E_INVALIDTYPE;
+
+ gst_caps_unref(output_caps);
+
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
@@ -396,21 +415,13 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
hr = S_OK;
- if (type)
- {
- if (!converter->output_type)
- hr = MFCreateMediaType(&converter->output_type);
+ if (!converter->output_type)
+ hr = MFCreateMediaType(&converter->output_type);
- if (SUCCEEDED(hr))
- hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->output_type);
+ if (SUCCEEDED(hr))
+ hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->output_type);
- if (FAILED(hr))
- {
- IMFMediaType_Release(converter->output_type);
- converter->output_type = NULL;
- }
- }
- else if (converter->output_type)
+ if (FAILED(hr))
{
IMFMediaType_Release(converter->output_type);
converter->output_type = NULL;
--
2.29.2

View File

@ -1,4 +1,4 @@
From 0c493f7590ba2d7b90cf44c389378aacae8f6fe0 Mon Sep 17 00:00:00 2001
From 25ae21745349feace0055c0b962f75b234e1e99a Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 18 Nov 2020 14:31:00 -0600
Subject: [PATCH] winegstreamer: Implement ::Process(Input/Output) for audio
@ -6,13 +6,13 @@ Subject: [PATCH] winegstreamer: Implement ::Process(Input/Output) for audio
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/audioconvert.c | 175 +++++++++++++++++++++++++++++-
dlls/winegstreamer/audioconvert.c | 188 ++++++++++++++++++++++++++++--
dlls/winegstreamer/gst_private.h | 1 +
dlls/winegstreamer/mfplat.c | 69 ++++++++++++
3 files changed, 239 insertions(+), 6 deletions(-)
dlls/winegstreamer/mfplat.c | 69 +++++++++++
3 files changed, 250 insertions(+), 8 deletions(-)
diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
index 7fb0dee99f6..631c57d6d55 100644
index 85f44dd8856..e16fc6f1a78 100644
--- a/dlls/winegstreamer/audioconvert.c
+++ b/dlls/winegstreamer/audioconvert.c
@@ -40,6 +40,8 @@ struct audio_converter
@ -20,7 +20,7 @@ index 7fb0dee99f6..631c57d6d55 100644
IMFMediaType *output_type;
CRITICAL_SECTION cs;
+ BOOL inflight;
+ GstElement *container, *appsrc, *audioconvert, *resampler, *appsink;
+ GstElement *container, *appsrc, *appsink;
};
static struct audio_converter *impl_audio_converter_from_IMFTransform(IMFTransform *iface)
@ -32,35 +32,46 @@ index 7fb0dee99f6..631c57d6d55 100644
heap_free(transform);
}
@@ -311,7 +314,8 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
if (!(input_caps = caps_from_mf_media_type(type)))
return MF_E_INVALIDTYPE;
@@ -295,6 +298,9 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
- gst_caps_unref(input_caps);
+ if (flags & MFT_SET_TYPE_TEST_ONLY)
+ gst_caps_unref(input_caps);
}
EnterCriticalSection(&converter->cs);
+ converter->inflight = FALSE;
+ gst_element_set_state(converter->container, GST_STATE_READY);
+
if (converter->input_type)
{
IMFMediaType_Release(converter->input_type);
@@ -326,14 +332,17 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
if (!(input_caps = caps_from_mf_media_type(type)))
return MF_E_INVALIDTYPE;
- gst_caps_unref(input_caps);
-
if (flags & MFT_SET_TYPE_TEST_ONLY)
@@ -320,6 +324,7 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
+ {
+ gst_caps_unref(input_caps);
return S_OK;
+ }
EnterCriticalSection(&converter->cs);
hr = S_OK;
+ converter->inflight = FALSE;
+ gst_element_set_state(converter->container, GST_STATE_READY);
if (type)
{
@@ -329,6 +334,9 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
if (SUCCEEDED(hr))
hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->input_type);
if (!converter->input_type)
hr = MFCreateMediaType(&converter->input_type);
@@ -341,12 +350,18 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
if (SUCCEEDED(hr))
hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->input_type);
+ g_object_set(converter->appsrc, "caps", input_caps, NULL);
+ gst_caps_unref(input_caps);
+ g_object_set(converter->appsrc, "caps", input_caps, NULL);
+ gst_caps_unref(input_caps);
+
if (FAILED(hr))
{
IMFMediaType_Release(converter->input_type);
@@ -341,6 +349,9 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
if (FAILED(hr))
{
IMFMediaType_Release(converter->input_type);
converter->input_type = NULL;
}
@ -70,35 +81,46 @@ index 7fb0dee99f6..631c57d6d55 100644
LeaveCriticalSection(&converter->cs);
return hr;
@@ -386,7 +397,8 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
if (!(output_caps = caps_from_mf_media_type(type)))
return MF_E_INVALIDTYPE;
@@ -375,6 +390,9 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
- gst_caps_unref(output_caps);
+ if (flags & MFT_SET_TYPE_TEST_ONLY)
+ gst_caps_unref(output_caps);
}
EnterCriticalSection(&converter->cs);
+ converter->inflight = FALSE;
+ gst_element_set_state(converter->container, GST_STATE_READY);
+
if (converter->output_type)
{
IMFMediaType_Release(converter->output_type);
@@ -406,14 +424,17 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
if (!(output_caps = caps_from_mf_media_type(type)))
return MF_E_INVALIDTYPE;
- gst_caps_unref(output_caps);
-
if (flags & MFT_SET_TYPE_TEST_ONLY)
@@ -395,6 +407,7 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
+ {
+ gst_caps_unref(output_caps);
return S_OK;
+ }
EnterCriticalSection(&converter->cs);
hr = S_OK;
+ converter->inflight = FALSE;
+ gst_element_set_state(converter->container, GST_STATE_READY);
if (type)
{
@@ -404,6 +417,9 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
if (SUCCEEDED(hr))
hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->output_type);
if (!converter->output_type)
hr = MFCreateMediaType(&converter->output_type);
@@ -421,12 +442,18 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
if (SUCCEEDED(hr))
hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->output_type);
+ g_object_set(converter->appsink, "caps", output_caps, NULL);
+ gst_caps_unref(output_caps);
+ g_object_set(converter->appsink, "caps", output_caps, NULL);
+ gst_caps_unref(output_caps);
+
if (FAILED(hr))
{
IMFMediaType_Release(converter->output_type);
@@ -416,6 +432,9 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
if (FAILED(hr))
{
IMFMediaType_Release(converter->output_type);
converter->output_type = NULL;
}
@ -108,7 +130,7 @@ index 7fb0dee99f6..631c57d6d55 100644
LeaveCriticalSection(&converter->cs);
return hr;
@@ -479,17 +498,102 @@ static HRESULT WINAPI audio_converter_ProcessMessage(IMFTransform *iface, MFT_ME
@@ -538,17 +565,102 @@ static HRESULT WINAPI audio_converter_ProcessMessage(IMFTransform *iface, MFT_ME
static HRESULT WINAPI audio_converter_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
{
@ -151,7 +173,7 @@ index 7fb0dee99f6..631c57d6d55 100644
+ gst_buffer_unref(gst_buffer);
+ if (ret != GST_FLOW_OK)
+ {
+ ERR("Couldn't push buffer ret = %d (%s)\n", ret, gst_flow_get_name(ret));
+ ERR("Couldn't push buffer ret, (%s)\n", gst_flow_get_name(ret));
+ LeaveCriticalSection(&converter->cs);
+ return E_FAIL;
+ }
@ -215,7 +237,15 @@ index 7fb0dee99f6..631c57d6d55 100644
}
static const IMFTransformVtbl audio_converter_vtbl =
@@ -537,6 +641,65 @@ HRESULT audio_converter_create(REFIID riid, void **ret)
@@ -583,6 +695,7 @@ static const IMFTransformVtbl audio_converter_vtbl =
HRESULT audio_converter_create(REFIID riid, void **ret)
{
+ GstElement *audioconvert, *resampler;
struct audio_converter *object;
TRACE("%s %p\n", debugstr_guid(riid), ret);
@@ -596,6 +709,65 @@ HRESULT audio_converter_create(REFIID riid, void **ret)
InitializeCriticalSection(&object->cs);
object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": audio_converter_lock");
@ -230,23 +260,23 @@ index 7fb0dee99f6..631c57d6d55 100644
+ }
+ gst_bin_add(GST_BIN(object->container), object->appsrc);
+
+ if (!(object->audioconvert = gst_element_factory_make("audioconvert", NULL)))
+ if (!(audioconvert = gst_element_factory_make("audioconvert", NULL)))
+ {
+ ERR("Failed to create audioconvert, are %u-bit Gstreamer \"base\" plugins installed?\n",
+ 8 * (int)sizeof(void *));
+ IMFTransform_Release(&object->IMFTransform_iface);
+ return E_FAIL;
+ }
+ gst_bin_add(GST_BIN(object->container), object->audioconvert);
+ gst_bin_add(GST_BIN(object->container), audioconvert);
+
+ if (!(object->resampler = gst_element_factory_make("audioresample", NULL)))
+ if (!(resampler = gst_element_factory_make("audioresample", NULL)))
+ {
+ ERR("Failed to create audioresample, are %u-bit Gstreamer \"base\" plugins installed?\n",
+ 8 * (int)sizeof(void *));
+ IMFTransform_Release(&object->IMFTransform_iface);
+ return E_FAIL;
+ }
+ gst_bin_add(GST_BIN(object->container), object->resampler);
+ gst_bin_add(GST_BIN(object->container), resampler);
+
+ if (!(object->appsink = gst_element_factory_make("appsink", NULL)))
+ {
@ -257,21 +287,21 @@ index 7fb0dee99f6..631c57d6d55 100644
+ }
+ gst_bin_add(GST_BIN(object->container), object->appsink);
+
+ if (!gst_element_link(object->appsrc, object->audioconvert))
+ if (!gst_element_link(object->appsrc, audioconvert))
+ {
+ ERR("Failed to link appsrc to audioconvert\n");
+ IMFTransform_Release(&object->IMFTransform_iface);
+ return E_FAIL;
+ }
+
+ if (!gst_element_link(object->audioconvert, object->resampler))
+ if (!gst_element_link(audioconvert, resampler))
+ {
+ ERR("Failed to link audioconvert to resampler\n");
+ IMFTransform_Release(&object->IMFTransform_iface);
+ return E_FAIL;
+ }
+
+ if (!gst_element_link(object->resampler, object->appsink))
+ if (!gst_element_link(resampler, object->appsink))
+ {
+ ERR("Failed to link resampler to appsink\n");
+ IMFTransform_Release(&object->IMFTransform_iface);
@ -294,7 +324,7 @@ index 9518f721504..14b6a011ac2 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 f300988fc5c..883084b2d89 100644
index f300988fc5c..b2b5b247dac 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -865,3 +865,72 @@ done:
@ -302,7 +332,7 @@ index f300988fc5c..883084b2d89 100644
return out;
}
+
+GstBuffer* gst_buffer_from_mf_sample(IMFSample *mf_sample)
+GstBuffer *gst_buffer_from_mf_sample(IMFSample *mf_sample)
+{
+ GstBuffer *out = gst_buffer_new();
+ IMFMediaBuffer *mf_buffer = NULL;
@ -339,7 +369,7 @@ index f300988fc5c..883084b2d89 100644
+ memory = gst_allocator_alloc(NULL, buffer_size, NULL);
+ gst_memory_resize(memory, 0, buffer_size);
+
+ if (!(gst_memory_map(memory, &map_info, GST_MAP_WRITE)))
+ if (!gst_memory_map(memory, &map_info, GST_MAP_WRITE))
+ {
+ hr = E_FAIL;
+ goto fail;

View File

@ -1,4 +1,4 @@
From 13e0d5671caaeae69bde747e547a5bd4524dd2ff Mon Sep 17 00:00:00 2001
From 3b76c2693af28c4aded7dbf4955baac91578f726 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 18 Nov 2020 14:32:27 -0600
Subject: [PATCH] winegstreamer: Implement ::Get(Input/Output)StreamInfo for
@ -6,14 +6,14 @@ Subject: [PATCH] winegstreamer: Implement ::Get(Input/Output)StreamInfo for
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/audioconvert.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
dlls/winegstreamer/audioconvert.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
index 631c57d6d55..d204d9582ba 100644
index e16fc6f1a78..a95fc5506e7 100644
--- a/dlls/winegstreamer/audioconvert.c
+++ b/dlls/winegstreamer/audioconvert.c
@@ -123,16 +123,31 @@ static HRESULT WINAPI audio_converter_GetStreamIDs(IMFTransform *iface, DWORD in
@@ -123,16 +123,34 @@ static HRESULT WINAPI audio_converter_GetStreamIDs(IMFTransform *iface, DWORD in
static HRESULT WINAPI audio_converter_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info)
{
@ -28,6 +28,8 @@ index 631c57d6d55..d204d9582ba 100644
+ info->cbMaxLookahead = 0;
+ info->cbAlignment = 0;
+ info->hnsMaxLatency = 0;
+ /* TODO: this can be calculated using MFCalculateImageSize */
+ info->cbSize = 0;
+
+ return S_OK;
}
@ -41,9 +43,10 @@ index 631c57d6d55..d204d9582ba 100644
+ if (id != 0)
+ return MF_E_INVALIDSTREAMNUMBER;
+
+ info->dwFlags = MFT_OUTPUT_STREAM_PROVIDES_SAMPLES;
+ info->cbSize = 0;
+ info->dwFlags = MFT_OUTPUT_STREAM_PROVIDES_SAMPLES | MFT_OUTPUT_STREAM_WHOLE_SAMPLES;
+ info->cbAlignment = 0;
+ /* TODO: this can be calculated using MFCalculateImageSize */
+ info->cbSize = 0;
+
+ return S_OK;
}

View File

@ -1,7 +1,7 @@
From 91a772eb1cb4ec9e86b4ab007743a99a8bd75265 Mon Sep 17 00:00:00 2001
From 5a5f948685d65455b540eb4fb0127a72ca6bc00c Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 18 Nov 2020 14:34:56 -0600
Subject: [PATCH] winegstreamer: Implement Get*Attributes functions for audio
Subject: [PATCH] winegstreamer: Semi-stub Get*Attributes functions for audio
converter transform.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
@ -10,7 +10,7 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
index d204d9582ba..556aba44fc9 100644
index a95fc5506e7..2a5f87fec94 100644
--- a/dlls/winegstreamer/audioconvert.c
+++ b/dlls/winegstreamer/audioconvert.c
@@ -37,6 +37,8 @@ struct audio_converter
@ -33,7 +33,7 @@ index d204d9582ba..556aba44fc9 100644
gst_object_unref(transform->container);
heap_free(transform);
}
@@ -152,9 +158,14 @@ static HRESULT WINAPI audio_converter_GetOutputStreamInfo(IMFTransform *iface, D
@@ -155,9 +161,14 @@ static HRESULT WINAPI audio_converter_GetOutputStreamInfo(IMFTransform *iface, D
static HRESULT WINAPI audio_converter_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
{
@ -50,7 +50,7 @@ index d204d9582ba..556aba44fc9 100644
}
static HRESULT WINAPI audio_converter_GetInputStreamAttributes(IMFTransform *iface, DWORD id,
@@ -168,9 +179,14 @@ static HRESULT WINAPI audio_converter_GetInputStreamAttributes(IMFTransform *ifa
@@ -171,9 +182,14 @@ static HRESULT WINAPI audio_converter_GetInputStreamAttributes(IMFTransform *ifa
static HRESULT WINAPI audio_converter_GetOutputStreamAttributes(IMFTransform *iface, DWORD id,
IMFAttributes **attributes)
{
@ -67,15 +67,15 @@ index d204d9582ba..556aba44fc9 100644
}
static HRESULT WINAPI audio_converter_DeleteInputStream(IMFTransform *iface, DWORD id)
@@ -644,6 +660,7 @@ static const IMFTransformVtbl audio_converter_vtbl =
HRESULT audio_converter_create(REFIID riid, void **ret)
@@ -715,6 +731,7 @@ HRESULT audio_converter_create(REFIID riid, void **ret)
{
GstElement *audioconvert, *resampler;
struct audio_converter *object;
+ HRESULT hr;
TRACE("%s %p\n", debugstr_guid(riid), ret);
@@ -656,6 +673,18 @@ HRESULT audio_converter_create(REFIID riid, void **ret)
@@ -727,6 +744,18 @@ HRESULT audio_converter_create(REFIID riid, void **ret)
InitializeCriticalSection(&object->cs);
object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": audio_converter_lock");

View File

@ -1,18 +1,19 @@
From b5316e74275511a63372473cb6bb10b8f2f8d2e1 Mon Sep 17 00:00:00 2001
From 9ea8d5720eb283af1bcf6d69e9804415d56804d1 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Tue, 1 Dec 2020 13:16:27 -0500
Subject: [PATCH] winegstreamer: Introduce color conversion transform.
Serves as a wrapper of videoconvert, and roughly fills the roll of Windows' CColorConverterDMO.
Serves as a wrapper of videoconvert, and exposes the CColorConverterDMO MFT interface.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/Makefile.in | 1 +
dlls/winegstreamer/colorconvert.c | 302 +++++++++++++++++++
dlls/winegstreamer/gst_private.h | 1 +
dlls/winegstreamer/mfplat.c | 3 +
dlls/winegstreamer/mfplat.c | 2 +
dlls/winegstreamer/winegstreamer_classes.idl | 6 +
5 files changed, 313 insertions(+)
include/wmcodecdsp.idl | 5 +
6 files changed, 317 insertions(+)
create mode 100644 dlls/winegstreamer/colorconvert.c
diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in
@ -347,23 +348,22 @@ index 14b6a011ac2..075e0ce1f0f 100644
#endif /* __GST_PRIVATE_INCLUDED__ */
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 883084b2d89..288b79997cd 100644
index b2b5b247dac..5ec408eea34 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -407,6 +407,8 @@ static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618, 0x5e5a, 0x468a
@@ -26,6 +26,7 @@
#include "gst_private.h"
#include "mfapi.h"
#include "mfidl.h"
+#include "wmcodecdsp.h"
static const GUID CLSID_WINEAudioConverter = {0x6a170414,0xaad9,0x4693,{0xb8,0x06,0x3a,0x0c,0x47,0xc5,0x70,0xd6}};
+static GUID CLSID_WINEColorConverter = {0x2be8b27f,0xcd60,0x4b8a,{0x95,0xae,0xd1,0x74,0xcc,0x5c,0xba,0xa7}};
+
static const struct class_object
{
const GUID *clsid;
@@ -417,6 +419,7 @@ class_objects[] =
#include "wine/debug.h"
#include "wine/heap.h"
@@ -417,6 +418,7 @@ class_objects[] =
{ &CLSID_VideoProcessorMFT, &video_processor_create },
{ &CLSID_GStreamerByteStreamHandler, &winegstreamer_stream_handler_create },
{ &CLSID_WINEAudioConverter, &audio_converter_create },
+ { &CLSID_WINEColorConverter, &color_converter_create },
+ { &CLSID_CColorConvertDMO, &color_converter_create },
};
HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj)
@ -381,6 +381,19 @@ index cf1fc69f38a..47c10a09cf0 100644
+ uuid(2be8b27f-cd60-4b8a-95ae-d174cc5cbaa7)
+]
+coclass WINEColorConverter { }
diff --git a/include/wmcodecdsp.idl b/include/wmcodecdsp.idl
index 61381bee6d4..87305422332 100644
--- a/include/wmcodecdsp.idl
+++ b/include/wmcodecdsp.idl
@@ -30,3 +30,8 @@ coclass CMP3DecMediaObject {}
uuid(f447b69e-1884-4a7e-8055-346f74d6edb3)
]
coclass CResamplerMediaObject {}
+
+[
+ uuid(98230571-0087-4204-b020-3282538e57d3)
+]
+coclass CColorConvertDMO {}
--
2.29.2

View File

@ -1,4 +1,4 @@
From 18799e737ff065a62ea1c92c9a684940053d9dfb Mon Sep 17 00:00:00 2001
From 72a7be6182b55b44a9448d25f285a94dba36dc05 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 3 Dec 2020 12:45:48 -0500
Subject: [PATCH] winegstreamer: Register the color conversion transform.
@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 288b79997cd..1b19c43d991 100644
index 5ec408eea34..bab2ccce64c 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -455,6 +455,26 @@ static const GUID *audio_converter_supported_types[] =
@@ -454,6 +454,26 @@ static const GUID *audio_converter_supported_types[] =
&MFAudioFormat_Float,
};
@ -39,12 +39,12 @@ index 288b79997cd..1b19c43d991 100644
static const struct mft
{
const GUID *clsid;
@@ -482,13 +502,25 @@ mfts[] =
@@ -481,13 +501,25 @@ mfts[] =
audio_converter_supported_types,
NULL
},
+ {
+ &CLSID_WINEColorConverter,
+ &CLSID_CColorConvertDMO,
+ &MFT_CATEGORY_VIDEO_EFFECT,
+ color_converterW,
+ MFT_ENUM_FLAG_SYNCMFT,

View File

@ -1,4 +1,4 @@
From 15b54cf08d296483e6d4c211eeae50db62f70804 Mon Sep 17 00:00:00 2001
From f23000bf69fd7eb691eb3768f87ed08188f3c8ba Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 3 Dec 2020 12:55:14 -0500
Subject: [PATCH] winegstreamer: Implement ::GetInputAvailableType for color

View File

@ -1,4 +1,4 @@
From 096a5070ac3ce917e6c8ae010e8e80c8ffbde3c4 Mon Sep 17 00:00:00 2001
From dcc33149b4730c603dfd1c66e2d6ccd03d5e89a9 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 3 Dec 2020 14:34:07 -0500
Subject: [PATCH] winegstreamer: Implement ::SetInputType for color conversion
@ -6,11 +6,11 @@ Subject: [PATCH] winegstreamer: Implement ::SetInputType for color conversion
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/colorconvert.c | 76 ++++++++++++++++++++++++++++++-
1 file changed, 74 insertions(+), 2 deletions(-)
dlls/winegstreamer/colorconvert.c | 82 ++++++++++++++++++++++++++++++-
1 file changed, 80 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
index 9a1d2880234..5dd48188147 100644
index 9a1d2880234..a7660453766 100644
--- a/dlls/winegstreamer/colorconvert.c
+++ b/dlls/winegstreamer/colorconvert.c
@@ -52,6 +52,8 @@ struct color_converter
@ -31,11 +31,12 @@ index 9a1d2880234..5dd48188147 100644
heap_free(transform);
}
@@ -223,9 +227,74 @@ static HRESULT WINAPI color_converter_GetOutputAvailableType(IMFTransform *iface
@@ -223,9 +227,80 @@ static HRESULT WINAPI color_converter_GetOutputAvailableType(IMFTransform *iface
static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
{
- FIXME("%p, %u, %p, %#x.\n", iface, id, type, flags);
+ GUID major_type, subtype;
+ GstCaps *input_caps;
+ unsigned int i;
+ HRESULT hr;
@ -48,33 +49,46 @@ index 9a1d2880234..5dd48188147 100644
+ if (id != 0)
+ return MF_E_INVALIDSTREAMNUMBER;
+
+ if (type)
+ if (!type)
+ {
+ GUID major_type, subtype;
+ if (flags & MFT_SET_TYPE_TEST_ONLY)
+ return S_OK;
+
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major_type)))
+ return MF_E_INVALIDTYPE;
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
+ return MF_E_INVALIDTYPE;
+ EnterCriticalSection(&converter->cs);
+
+ if (!(IsEqualGUID(&major_type, &MFMediaType_Video)))
+ return MF_E_INVALIDTYPE;
+
+ for (i = 0; i < ARRAY_SIZE(raw_types); i++)
+ if (converter->input_type)
+ {
+ if (IsEqualGUID(&subtype, raw_types[i]))
+ break;
+ IMFMediaType_Release(converter->input_type);
+ converter->input_type = NULL;
+ }
+
+ if (i == ARRAY_SIZE(raw_types))
+ return MF_E_INVALIDTYPE;
+ LeaveCriticalSection(&converter->cs);
+
+ if (!(input_caps = caps_from_mf_media_type(type)))
+ return MF_E_INVALIDTYPE;
+
+ gst_caps_unref(input_caps);
+ return S_OK;
+ }
+
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major_type)))
+ return MF_E_INVALIDTYPE;
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
+ return MF_E_INVALIDTYPE;
+
+ if (!(IsEqualGUID(&major_type, &MFMediaType_Video)))
+ return MF_E_INVALIDTYPE;
+
+ for (i = 0; i < ARRAY_SIZE(raw_types); i++)
+ {
+ if (IsEqualGUID(&subtype, raw_types[i]))
+ break;
+ }
+
+ if (i == ARRAY_SIZE(raw_types))
+ return MF_E_INVALIDTYPE;
+
+ if (!(input_caps = caps_from_mf_media_type(type)))
+ return MF_E_INVALIDTYPE;
+
+ gst_caps_unref(input_caps);
+
+ if (flags & MFT_SET_TYPE_TEST_ONLY)
+ return S_OK;
+
@ -82,21 +96,13 @@ index 9a1d2880234..5dd48188147 100644
+
+ hr = S_OK;
+
+ if (type)
+ {
+ if (!converter->input_type)
+ hr = MFCreateMediaType(&converter->input_type);
+ if (!converter->input_type)
+ hr = MFCreateMediaType(&converter->input_type);
+
+ if (SUCCEEDED(hr))
+ hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->input_type);
+ if (SUCCEEDED(hr))
+ hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->input_type);
+
+ if (FAILED(hr))
+ {
+ IMFMediaType_Release(converter->input_type);
+ converter->input_type = NULL;
+ }
+ }
+ else
+ if (FAILED(hr))
+ {
+ IMFMediaType_Release(converter->input_type);
+ converter->input_type = NULL;
@ -108,7 +114,7 @@ index 9a1d2880234..5dd48188147 100644
}
static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
@@ -341,6 +410,9 @@ HRESULT color_converter_create(REFIID riid, void **ret)
@@ -341,6 +416,9 @@ HRESULT color_converter_create(REFIID riid, void **ret)
object->IMFTransform_iface.lpVtbl = &color_converter_vtbl;
object->refcount = 1;

View File

@ -1,4 +1,4 @@
From 64cfb2a80d7ebc22b12d8b6c1e41cf7a74e15d88 Mon Sep 17 00:00:00 2001
From 4971b983809a02ce8b61d4098703532deb8d3f29 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 3 Dec 2020 14:45:32 -0500
Subject: [PATCH] winegstreamer: Implement ::GetOutputAvailableType for color
@ -6,27 +6,14 @@ Subject: [PATCH] winegstreamer: Implement ::GetOutputAvailableType for color
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/colorconvert.c | 48 +++++++++++++++++++++++++++++--
1 file changed, 46 insertions(+), 2 deletions(-)
dlls/winegstreamer/colorconvert.c | 38 +++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
index 5dd48188147..b80232e195b 100644
index a7660453766..a7206408603 100644
--- a/dlls/winegstreamer/colorconvert.c
+++ b/dlls/winegstreamer/colorconvert.c
@@ -217,12 +217,56 @@ static HRESULT WINAPI color_converter_GetInputAvailableType(IMFTransform *iface,
return S_OK;
}
+static void copy_attr(IMFMediaType *target, IMFMediaType *source, const GUID *key)
+{
+ PROPVARIANT val;
+
+ if (SUCCEEDED(IMFAttributes_GetItem((IMFAttributes *)source, key, &val)))
+ {
+ IMFAttributes_SetItem((IMFAttributes* )target, key, &val);
+ }
+}
+
@@ -220,9 +220,43 @@ static HRESULT WINAPI color_converter_GetInputAvailableType(IMFTransform *iface,
static HRESULT WINAPI color_converter_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
IMFMediaType **type)
{

View File

@ -1,4 +1,4 @@
From f1714a949175290e9f01bd32fde1dacecfed7946 Mon Sep 17 00:00:00 2001
From 95f62008671a1cde75abce167806026ec75be681 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 3 Dec 2020 14:55:41 -0500
Subject: [PATCH] winegstreamer: Implement ::SetOutputType for color conversion
@ -6,11 +6,11 @@ Subject: [PATCH] winegstreamer: Implement ::SetOutputType for color conversion
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/colorconvert.c | 70 ++++++++++++++++++++++++++++++-
1 file changed, 68 insertions(+), 2 deletions(-)
dlls/winegstreamer/colorconvert.c | 76 ++++++++++++++++++++++++++++++-
1 file changed, 74 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
index b80232e195b..e7e84690738 100644
index a7206408603..c2665cbdacb 100644
--- a/dlls/winegstreamer/colorconvert.c
+++ b/dlls/winegstreamer/colorconvert.c
@@ -53,6 +53,7 @@ struct color_converter
@ -21,11 +21,12 @@ index b80232e195b..e7e84690738 100644
CRITICAL_SECTION cs;
};
@@ -343,9 +344,74 @@ static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id
@@ -339,9 +340,80 @@ static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id
static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
{
- FIXME("%p, %u, %p, %#x.\n", iface, id, type, flags);
+ GUID major_type, subtype;
+ GstCaps *output_caps;
+ unsigned int i;
+ HRESULT hr;
@ -38,33 +39,46 @@ index b80232e195b..e7e84690738 100644
+ if (id != 0)
+ return MF_E_INVALIDSTREAMNUMBER;
+
+ if (type)
+ if (!type)
+ {
+ GUID major_type, subtype;
+ if (flags & MFT_SET_TYPE_TEST_ONLY)
+ return S_OK;
+
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major_type)))
+ return MF_E_INVALIDTYPE;
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
+ return MF_E_INVALIDTYPE;
+ EnterCriticalSection(&converter->cs);
+
+ if (!(IsEqualGUID(&major_type, &MFMediaType_Video)))
+ return MF_E_INVALIDTYPE;
+
+ for (i = 0; i < ARRAY_SIZE(raw_types); i++)
+ if (converter->output_type)
+ {
+ if (IsEqualGUID(&subtype, raw_types[i]))
+ break;
+ IMFMediaType_Release(converter->output_type);
+ converter->output_type = NULL;
+ }
+
+ if (i == ARRAY_SIZE(raw_types))
+ return MF_E_INVALIDTYPE;
+ LeaveCriticalSection(&converter->cs);
+
+ if (!(output_caps = caps_from_mf_media_type(type)))
+ return MF_E_INVALIDTYPE;
+
+ gst_caps_unref(output_caps);
+ return S_OK;
+ }
+
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major_type)))
+ return MF_E_INVALIDTYPE;
+ if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype)))
+ return MF_E_INVALIDTYPE;
+
+ if (!(IsEqualGUID(&major_type, &MFMediaType_Video)))
+ return MF_E_INVALIDTYPE;
+
+ for (i = 0; i < ARRAY_SIZE(raw_types); i++)
+ {
+ if (IsEqualGUID(&subtype, raw_types[i]))
+ break;
+ }
+
+ if (i == ARRAY_SIZE(raw_types))
+ return MF_E_INVALIDTYPE;
+
+ if (!(output_caps = caps_from_mf_media_type(type)))
+ return MF_E_INVALIDTYPE;
+
+ gst_caps_unref(output_caps);
+
+ if (flags & MFT_SET_TYPE_TEST_ONLY)
+ return S_OK;
+
@ -72,21 +86,13 @@ index b80232e195b..e7e84690738 100644
+
+ hr = S_OK;
+
+ if (type)
+ {
+ if (!converter->output_type)
+ hr = MFCreateMediaType(&converter->output_type);
+ if (!converter->output_type)
+ hr = MFCreateMediaType(&converter->output_type);
+
+ if (SUCCEEDED(hr))
+ hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->output_type);
+ if (SUCCEEDED(hr))
+ hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->output_type);
+
+ if (FAILED(hr))
+ {
+ IMFMediaType_Release(converter->output_type);
+ converter->output_type = NULL;
+ }
+ }
+ else
+ if (FAILED(hr))
+ {
+ IMFMediaType_Release(converter->output_type);
+ converter->output_type = NULL;

View File

@ -1,4 +1,4 @@
From c94cfbf0ec1c10452c2cf1496f32eeefe5794cea Mon Sep 17 00:00:00 2001
From 126c7b1289899ea86527acb20f3bfc296a4dde2f Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 3 Dec 2020 15:22:20 -0500
Subject: [PATCH] winegstreamer: Implement ::Process(Input/Output) for color
@ -6,11 +6,11 @@ Subject: [PATCH] winegstreamer: Implement ::Process(Input/Output) for color
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/colorconvert.c | 159 +++++++++++++++++++++++++++++-
1 file changed, 154 insertions(+), 5 deletions(-)
dlls/winegstreamer/colorconvert.c | 172 ++++++++++++++++++++++++++++--
1 file changed, 165 insertions(+), 7 deletions(-)
diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
index e7e84690738..b77f3358c52 100644
index c2665cbdacb..4aa563ab0d9 100644
--- a/dlls/winegstreamer/colorconvert.c
+++ b/dlls/winegstreamer/colorconvert.c
@@ -55,6 +55,8 @@ struct color_converter
@ -18,7 +18,7 @@ index e7e84690738..b77f3358c52 100644
IMFMediaType *output_type;
CRITICAL_SECTION cs;
+ BOOL inflight;
+ GstElement *container, *appsrc, *videoconvert, *appsink;
+ GstElement *container, *appsrc, *appsink;
};
static struct color_converter *impl_color_converter_from_IMFTransform(IMFTransform *iface)
@ -30,35 +30,46 @@ index e7e84690738..b77f3358c52 100644
heap_free(transform);
}
@@ -307,7 +310,8 @@ static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id
if (!(input_caps = caps_from_mf_media_type(type)))
return MF_E_INVALIDTYPE;
@@ -281,6 +284,9 @@ static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id
- gst_caps_unref(input_caps);
+ if (flags & MFT_SET_TYPE_TEST_ONLY)
+ gst_caps_unref(input_caps);
}
EnterCriticalSection(&converter->cs);
+ converter->inflight = FALSE;
+ gst_element_set_state(converter->container, GST_STATE_READY);
+
if (converter->input_type)
{
IMFMediaType_Release(converter->input_type);
@@ -312,14 +318,17 @@ static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id
if (!(input_caps = caps_from_mf_media_type(type)))
return MF_E_INVALIDTYPE;
- gst_caps_unref(input_caps);
-
if (flags & MFT_SET_TYPE_TEST_ONLY)
@@ -316,6 +320,7 @@ static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id
+ {
+ gst_caps_unref(input_caps);
return S_OK;
+ }
EnterCriticalSection(&converter->cs);
hr = S_OK;
+ converter->inflight = FALSE;
+ gst_element_set_state(converter->container, GST_STATE_READY);
if (type)
{
@@ -325,6 +330,9 @@ static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id
if (SUCCEEDED(hr))
hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->input_type);
if (!converter->input_type)
hr = MFCreateMediaType(&converter->input_type);
@@ -327,12 +336,18 @@ static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id
if (SUCCEEDED(hr))
hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->input_type);
+ g_object_set(converter->appsrc, "caps", input_caps, NULL);
+ gst_caps_unref(input_caps);
+ g_object_set(converter->appsrc, "caps", input_caps, NULL);
+ gst_caps_unref(input_caps);
+
if (FAILED(hr))
{
IMFMediaType_Release(converter->input_type);
@@ -337,6 +345,9 @@ static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id
if (FAILED(hr))
{
IMFMediaType_Release(converter->input_type);
converter->input_type = NULL;
}
@ -68,35 +79,46 @@ index e7e84690738..b77f3358c52 100644
LeaveCriticalSection(&converter->cs);
return hr;
@@ -379,7 +390,8 @@ static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD i
if (!(output_caps = caps_from_mf_media_type(type)))
return MF_E_INVALIDTYPE;
@@ -359,6 +374,9 @@ static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD i
- gst_caps_unref(output_caps);
+ if (flags & MFT_SET_TYPE_TEST_ONLY)
+ gst_caps_unref(output_caps);
}
EnterCriticalSection(&converter->cs);
+ converter->inflight = FALSE;
+ gst_element_set_state(converter->container, GST_STATE_READY);
+
if (converter->output_type)
{
IMFMediaType_Release(converter->output_type);
@@ -390,14 +408,17 @@ static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD i
if (!(output_caps = caps_from_mf_media_type(type)))
return MF_E_INVALIDTYPE;
- gst_caps_unref(output_caps);
-
if (flags & MFT_SET_TYPE_TEST_ONLY)
@@ -388,6 +400,7 @@ static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD i
+ {
+ gst_caps_unref(output_caps);
return S_OK;
+ }
EnterCriticalSection(&converter->cs);
hr = S_OK;
+ converter->inflight = FALSE;
+ gst_element_set_state(converter->container, GST_STATE_READY);
if (type)
{
@@ -397,6 +410,9 @@ static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD i
if (SUCCEEDED(hr))
hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->output_type);
if (!converter->output_type)
hr = MFCreateMediaType(&converter->output_type);
@@ -405,12 +426,18 @@ static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD i
if (SUCCEEDED(hr))
hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->output_type);
+ g_object_set(converter->appsink, "caps", output_caps, NULL);
+ gst_caps_unref(output_caps);
+ g_object_set(converter->appsink, "caps", output_caps, NULL);
+ gst_caps_unref(output_caps);
+
if (FAILED(hr))
{
IMFMediaType_Release(converter->output_type);
@@ -409,6 +425,9 @@ static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD i
if (FAILED(hr))
{
IMFMediaType_Release(converter->output_type);
converter->output_type = NULL;
}
@ -106,7 +128,7 @@ index e7e84690738..b77f3358c52 100644
LeaveCriticalSection(&converter->cs);
return hr;
@@ -465,15 +484,102 @@ static HRESULT WINAPI color_converter_ProcessMessage(IMFTransform *iface, MFT_ME
@@ -467,15 +494,102 @@ static HRESULT WINAPI color_converter_ProcessMessage(IMFTransform *iface, MFT_ME
static HRESULT WINAPI color_converter_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
{
@ -149,7 +171,7 @@ index e7e84690738..b77f3358c52 100644
+ gst_buffer_unref(gst_buffer);
+ if (ret != GST_FLOW_OK)
+ {
+ ERR("Couldn't push buffer ret = %d (%s)\n", ret, gst_flow_get_name(ret));
+ ERR("Couldn't push buffer, (%s)\n", gst_flow_get_name(ret));
+ LeaveCriticalSection(&converter->cs);
+ return E_FAIL;
+ }
@ -198,7 +220,7 @@ index e7e84690738..b77f3358c52 100644
+
+ g_signal_emit_by_name(converter->appsink, "pull-sample", &sample);
+
+ converter->inflight = FALSE;
+ converter->inflight = FALSE;
+
+ samples[0].pSample = mf_sample_from_gst_buffer(gst_sample_get_buffer(sample));
+ gst_sample_unref(sample);
@ -212,7 +234,15 @@ index e7e84690738..b77f3358c52 100644
return E_NOTIMPL;
}
@@ -523,6 +629,49 @@ HRESULT color_converter_create(REFIID riid, void **ret)
@@ -513,6 +627,7 @@ static const IMFTransformVtbl color_converter_vtbl =
HRESULT color_converter_create(REFIID riid, void **ret)
{
struct color_converter *object;
+ GstElement *videoconvert;
TRACE("%s %p\n", debugstr_guid(riid), ret);
@@ -525,6 +640,49 @@ HRESULT color_converter_create(REFIID riid, void **ret)
InitializeCriticalSection(&object->cs);
object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": color_converter_lock");
@ -227,14 +257,14 @@ index e7e84690738..b77f3358c52 100644
+ }
+ gst_bin_add(GST_BIN(object->container), object->appsrc);
+
+ if (!(object->videoconvert = gst_element_factory_make("videoconvert", NULL)))
+ if (!(videoconvert = gst_element_factory_make("videoconvert", NULL)))
+ {
+ ERR("Failed to create videoconvert, are %u-bit Gstreamer \"base\" plugins installed?\n",
+ 8 * (int)sizeof(void *));
+ IMFTransform_Release(&object->IMFTransform_iface);
+ return E_FAIL;
+ }
+ gst_bin_add(GST_BIN(object->container), object->videoconvert);
+ gst_bin_add(GST_BIN(object->container), videoconvert);
+
+ if (!(object->appsink = gst_element_factory_make("appsink", NULL)))
+ {
@ -245,14 +275,14 @@ index e7e84690738..b77f3358c52 100644
+ }
+ gst_bin_add(GST_BIN(object->container), object->appsink);
+
+ if (!gst_element_link(object->appsrc, object->videoconvert))
+ if (!gst_element_link(object->appsrc, videoconvert))
+ {
+ ERR("Failed to link appsrc to videoconvert\n");
+ IMFTransform_Release(&object->IMFTransform_iface);
+ return E_FAIL;
+ }
+
+ if (!gst_element_link(object->videoconvert, object->appsink))
+ if (!gst_element_link(videoconvert, object->appsink))
+ {
+ ERR("Failed to link videoconvert to appsink\n");
+ IMFTransform_Release(&object->IMFTransform_iface);

View File

@ -1,4 +1,4 @@
From d68df1b4131caa500cea5c4241be3c55b2728d4c Mon Sep 17 00:00:00 2001
From b1eba110c4c5d4d6797f23c54bb339056b03dbc9 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 3 Dec 2020 16:02:20 -0500
Subject: [PATCH] winegstreamer: Implement ::ProcessMessage for color
@ -10,10 +10,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
index b77f3358c52..c07ef22acc3 100644
index 4aa563ab0d9..bbc6cf83905 100644
--- a/dlls/winegstreamer/colorconvert.c
+++ b/dlls/winegstreamer/colorconvert.c
@@ -477,9 +477,16 @@ static HRESULT WINAPI color_converter_ProcessEvent(IMFTransform *iface, DWORD id
@@ -487,9 +487,16 @@ static HRESULT WINAPI color_converter_ProcessEvent(IMFTransform *iface, DWORD id
static HRESULT WINAPI color_converter_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param)
{
@ -23,7 +23,7 @@ index b77f3358c52..c07ef22acc3 100644
- return E_NOTIMPL;
+ switch(message)
+ {
+ case MFT_MESSAGE_NOTIFY_START_OF_STREAM:
+ case MFT_MESSAGE_NOTIFY_BEGIN_STREAMING:
+ return S_OK;
+ default:
+ FIXME("Unhandled message type %x.\n", message);

View File

@ -1,4 +1,4 @@
From e8eef3f90da399a077f5853e2a399c7e27a6418e Mon Sep 17 00:00:00 2001
From 37119259d559a7ccc529d57e869d2b6bb8b2e6fa Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 3 Dec 2020 15:28:42 -0500
Subject: [PATCH] winegstreamer: Implement ::Get(Input/Output)StreamInfo for
@ -6,14 +6,14 @@ Subject: [PATCH] winegstreamer: Implement ::Get(Input/Output)StreamInfo for
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/colorconvert.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
dlls/winegstreamer/colorconvert.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
index c07ef22acc3..43b8dddeee7 100644
index bbc6cf83905..5bfe194ffcc 100644
--- a/dlls/winegstreamer/colorconvert.c
+++ b/dlls/winegstreamer/colorconvert.c
@@ -138,16 +138,31 @@ static HRESULT WINAPI color_converter_GetStreamIDs(IMFTransform *iface, DWORD in
@@ -138,16 +138,34 @@ static HRESULT WINAPI color_converter_GetStreamIDs(IMFTransform *iface, DWORD in
static HRESULT WINAPI color_converter_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info)
{
@ -28,6 +28,8 @@ index c07ef22acc3..43b8dddeee7 100644
+ info->cbMaxLookahead = 0;
+ info->cbAlignment = 0;
+ info->hnsMaxLatency = 0;
+ /* TODO: this can be calculated using MFCalculateImageSize */
+ info->cbSize = 0;
+
+ return S_OK;
}
@ -41,9 +43,10 @@ index c07ef22acc3..43b8dddeee7 100644
+ if (id != 0)
+ return MF_E_INVALIDSTREAMNUMBER;
+
+ info->dwFlags = MFT_OUTPUT_STREAM_PROVIDES_SAMPLES;
+ info->cbSize = 0;
+ info->dwFlags = MFT_OUTPUT_STREAM_PROVIDES_SAMPLES | MFT_OUTPUT_STREAM_WHOLE_SAMPLES;
+ info->cbAlignment = 0;
+ /* TODO: this can be calculated using MFCalculateImageSize */
+ info->cbSize = 0;
+
+ return S_OK;
}

View File

@ -1,7 +1,7 @@
From 7bc3f13dd779e7b998a877012c83a8ca9e7aba4f Mon Sep 17 00:00:00 2001
From ce99ae246416151f46a778ccbc6eeb9f95f509c2 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 3 Dec 2020 15:37:10 -0500
Subject: [PATCH] winegstreamer: Implement Get*Attributes functions for color
Subject: [PATCH] winegstreamer: Semi-stub Get*Attributes functions for color
converter transform.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
@ -10,7 +10,7 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
index 43b8dddeee7..9e6ece796f3 100644
index 5bfe194ffcc..c4e72b3d0ff 100644
--- a/dlls/winegstreamer/colorconvert.c
+++ b/dlls/winegstreamer/colorconvert.c
@@ -52,6 +52,8 @@ struct color_converter
@ -33,7 +33,7 @@ index 43b8dddeee7..9e6ece796f3 100644
gst_object_unref(transform->container);
heap_free(transform);
}
@@ -167,9 +173,14 @@ static HRESULT WINAPI color_converter_GetOutputStreamInfo(IMFTransform *iface, D
@@ -170,9 +176,14 @@ static HRESULT WINAPI color_converter_GetOutputStreamInfo(IMFTransform *iface, D
static HRESULT WINAPI color_converter_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
{
@ -50,7 +50,7 @@ index 43b8dddeee7..9e6ece796f3 100644
}
static HRESULT WINAPI color_converter_GetInputStreamAttributes(IMFTransform *iface, DWORD id,
@@ -183,9 +194,14 @@ static HRESULT WINAPI color_converter_GetInputStreamAttributes(IMFTransform *ifa
@@ -186,9 +197,14 @@ static HRESULT WINAPI color_converter_GetInputStreamAttributes(IMFTransform *ifa
static HRESULT WINAPI color_converter_GetOutputStreamAttributes(IMFTransform *iface, DWORD id,
IMFAttributes **attributes)
{
@ -67,15 +67,15 @@ index 43b8dddeee7..9e6ece796f3 100644
}
static HRESULT WINAPI color_converter_DeleteInputStream(IMFTransform *iface, DWORD id)
@@ -639,6 +655,7 @@ static const IMFTransformVtbl color_converter_vtbl =
HRESULT color_converter_create(REFIID riid, void **ret)
@@ -653,6 +669,7 @@ HRESULT color_converter_create(REFIID riid, void **ret)
{
struct color_converter *object;
GstElement *videoconvert;
+ HRESULT hr;
TRACE("%s %p\n", debugstr_guid(riid), ret);
@@ -651,6 +668,18 @@ HRESULT color_converter_create(REFIID riid, void **ret)
@@ -665,6 +682,18 @@ HRESULT color_converter_create(REFIID riid, void **ret)
InitializeCriticalSection(&object->cs);
object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": color_converter_lock");

View File

@ -1,4 +1,4 @@
From 54919766d0ad2cf17e8cc6a8783794312964677c Mon Sep 17 00:00:00 2001
From b8a39fad1ce3137765760c98d36ac030e6e47f25 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 3 Dec 2020 15:43:21 -0500
Subject: [PATCH] winegstreamer: Implement Get(Input/Output)CurrentType
@ -10,10 +10,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
1 file changed, 54 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
index 9e6ece796f3..c7b1fae393f 100644
index c4e72b3d0ff..8b459b0cc18 100644
--- a/dlls/winegstreamer/colorconvert.c
+++ b/dlls/winegstreamer/colorconvert.c
@@ -466,16 +466,66 @@ static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD i
@@ -479,16 +479,66 @@ static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD i
static HRESULT WINAPI color_converter_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
{

View File

@ -1,4 +1,4 @@
From 1472041682ce09e0e8bdda78ed0366fba6aa41a0 Mon Sep 17 00:00:00 2001
From b4945173bc1dd6c0fd7229c5492b3e08d76f336d 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.

View File

@ -1,4 +1,4 @@
From fbf25644246c31e0116b319a1876c89697c07bc5 Mon Sep 17 00:00:00 2001
From f100f20f4079d0f1d7bc34c5667b9af3a26a316f Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 25 Nov 2020 12:29:50 -0500
Subject: [PATCH] winegstreamer: Set MF_MT_ALL_SAMPLES_INDEPENDENT attribute on
@ -10,10 +10,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
1 file changed, 1 insertion(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 1b19c43d991..f4a0c5b00f0 100644
index bab2ccce64c..3a63c9ddc99 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -604,6 +604,7 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps)
@@ -603,6 +603,7 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps)
unsigned int i;
IMFMediaType_SetUINT32(media_type, &MF_MT_COMPRESSED, FALSE);

View File

@ -1,4 +1,4 @@
From f85db2dd85e074dcb3373d711a937c00c3a5bc73 Mon Sep 17 00:00:00 2001
From ca4c81b98b9275e5b19b39ffd7819eb7027e12df 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.
@ -9,10 +9,10 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index fd7f1a7f55e..2c6b82c43b4 100644
index 655e765fee7..c7af077db8a 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -1636,11 +1636,12 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
@@ -1387,11 +1387,12 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
for (i = 0; i < object->stream_count; i++)
{
@ -28,7 +28,7 @@ index fd7f1a7f55e..2c6b82c43b4 100644
if (stream_pres_time > total_pres_time)
total_pres_time = stream_pres_time;
}
@@ -1648,6 +1649,31 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
@@ -1399,6 +1400,31 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
{
WARN("Unable to get presentation time of stream %u\n", i);
}

View File

@ -1,54 +0,0 @@
From 539f0ad63d83dd1f60a9a54063f3cb108d71f794 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 30 Nov 2020 11:56:48 -0500
Subject: [PATCH] mf: Add invalid connect method test.
Nikolay stripped out this test in his updated version of the patchset, which is fine. But I think it's useful to have it somewhere.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/mf/tests/mf.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 8272064466f..32ae84b837b 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -1824,6 +1824,34 @@ static void test_topology_loader(void)
LOADER_TODO,
},
+ {
+ /* MP3 -> PCM */
+ &MFMediaType_Audio,
+ {
+ {
+ { &MF_MT_SUBTYPE, WAVE_FORMAT_MPEGLAYER3 },
+ { &MF_MT_AUDIO_NUM_CHANNELS, 2 },
+ { &MF_MT_AUDIO_SAMPLES_PER_SECOND, 44100 },
+ { &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 16000 },
+ { &MF_MT_AUDIO_BLOCK_ALIGNMENT, 1 },
+ }
+ },
+ {
+ {
+ { &MF_MT_SUBTYPE, WAVE_FORMAT_PCM },
+ { &MF_MT_AUDIO_NUM_CHANNELS, 1 },
+ { &MF_MT_AUDIO_SAMPLES_PER_SECOND, 44100 },
+ { &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 44100 },
+ { &MF_MT_AUDIO_BLOCK_ALIGNMENT, 1 },
+ { &MF_MT_AUDIO_BITS_PER_SAMPLE, 8 },
+ }
+ },
+
+ MF_CONNECT_ALLOW_DECODER &~ MF_CONNECT_ALLOW_CONVERTER,
+ MF_E_INVALIDMEDIATYPE,
+ LOADER_TODO,
+ },
+
{
/* MP3 -> PCM */
&MFMediaType_Audio,
--
2.29.2

Some files were not shown because too many files have changed in this diff Show More