Rémi Bernon : mf: Propagate missing attributes to downstream media types.

Alexandre Julliard julliard at winehq.org
Mon Aug 8 15:16:45 CDT 2022


Module: wine
Branch: master
Commit: ee0e10be895fa4e2660917ff87013212fd547a94
URL:    https://gitlab.winehq.org/wine/wine/-/commit/ee0e10be895fa4e2660917ff87013212fd547a94

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Mon Aug  1 15:05:53 2022 +0200

mf: Propagate missing attributes to downstream media types.

---

 dlls/mf/tests/mf.c        |  2 +-
 dlls/mf/topology_loader.c | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index f5d110174b0..9dab87b928d 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -2283,7 +2283,7 @@ static void test_topology_loader(void)
             /* I420 -> RGB32, Video Processor media type without frame size */
             .input_type = &video_i420_1280, .output_type = &video_video_processor_rgb32, .sink_method = -1, .source_method = -1,
             .expected_result = S_OK,
-            .flags = LOADER_NEEDS_VIDEO_PROCESSOR | LOADER_EXPECTED_CONVERTER | LOADER_TODO,
+            .flags = LOADER_NEEDS_VIDEO_PROCESSOR | LOADER_EXPECTED_CONVERTER,
         },
     };
 
diff --git a/dlls/mf/topology_loader.c b/dlls/mf/topology_loader.c
index f7d1007971d..08ee7922094 100644
--- a/dlls/mf/topology_loader.c
+++ b/dlls/mf/topology_loader.c
@@ -215,6 +215,30 @@ static HRESULT topology_node_list_branches(IMFTopologyNode *node, struct list *b
     return hr;
 }
 
+static HRESULT topology_branch_fill_media_type(IMFMediaType *up_type, IMFMediaType *down_type)
+{
+    HRESULT hr = S_OK;
+    PROPVARIANT value;
+    UINT32 count;
+    GUID key;
+
+    if (FAILED(hr = IMFMediaType_GetCount(up_type, &count)))
+        return hr;
+
+    while (count--)
+    {
+        PropVariantInit(&value);
+        hr = IMFMediaType_GetItemByIndex(up_type, count, &key, &value);
+        if (SUCCEEDED(hr) && FAILED(IMFMediaType_GetItem(down_type, &key, NULL)))
+            hr = IMFMediaType_SetItem(down_type, &key, &value);
+        PropVariantClear(&value);
+        if (FAILED(hr))
+            return hr;
+    }
+
+    return hr;
+}
+
 static HRESULT topology_branch_connect(IMFTopology *topology, MF_CONNECT_METHOD method_mask,
         struct topology_branch *branch);
 static HRESULT topology_branch_connect_down(IMFTopology *topology, MF_CONNECT_METHOD method_mask,
@@ -276,6 +300,8 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC
             IMFTopologyNode_SetGUID(node, &MF_TOPONODE_TRANSFORM_OBJECTID, &guid);
 
         hr = topology_branch_connect_down(topology, MF_CONNECT_DIRECT, &up_branch, up_type);
+        if (SUCCEEDED(hr))
+            hr = topology_branch_fill_media_type(up_type, down_type);
         if (SUCCEEDED(hr))
             hr = IMFTransform_SetOutputType(transform, 0, down_type, 0);
         IMFTransform_Release(transform);




More information about the wine-cvs mailing list