Nikolay Sivov : mf: Implement GetFullTopology().

Alexandre Julliard julliard at winehq.org
Mon Mar 2 16:22:23 CST 2020


Module: wine
Branch: master
Commit: 0b4e460184da4ed6d2f771d6047ab1e60c6f3bde
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0b4e460184da4ed6d2f771d6047ab1e60c6f3bde

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Mar  2 13:31:05 2020 +0300

mf: Implement GetFullTopology().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mf/session.c | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/dlls/mf/session.c b/dlls/mf/session.c
index 76310040ee..8edab28935 100644
--- a/dlls/mf/session.c
+++ b/dlls/mf/session.c
@@ -1395,9 +1395,42 @@ static HRESULT WINAPI mfsession_GetSessionCapabilities(IMFMediaSession *iface, D
 
 static HRESULT WINAPI mfsession_GetFullTopology(IMFMediaSession *iface, DWORD flags, TOPOID id, IMFTopology **topology)
 {
-    FIXME("%p, %#x, %s, %p.\n", iface, flags, wine_dbgstr_longlong(id), topology);
+    struct media_session *session = impl_from_IMFMediaSession(iface);
+    struct queued_topology *queued;
+    HRESULT hr = S_OK;
+    TOPOID topo_id;
 
-    return E_NOTIMPL;
+    TRACE("%p, %#x, %s, %p.\n", iface, flags, wine_dbgstr_longlong(id), topology);
+
+    *topology = NULL;
+
+    EnterCriticalSection(&session->cs);
+
+    if (flags & MFSESSION_GETFULLTOPOLOGY_CURRENT)
+    {
+        if (session->presentation.topo_status != MF_TOPOSTATUS_INVALID)
+            *topology = session->presentation.current_topology;
+        else
+            hr = MF_E_INVALIDREQUEST;
+    }
+    else
+    {
+        LIST_FOR_EACH_ENTRY(queued, &session->topologies, struct queued_topology, entry)
+        {
+            if (SUCCEEDED(IMFTopology_GetTopologyID(queued->topology, &topo_id)) && topo_id == id)
+            {
+                *topology = queued->topology;
+                break;
+            }
+        }
+    }
+
+    if (*topology)
+        IMFTopology_AddRef(*topology);
+
+    LeaveCriticalSection(&session->cs);
+
+    return hr;
 }
 
 static const IMFMediaSessionVtbl mfmediasessionvtbl =




More information about the wine-cvs mailing list