Commit 73fae7aa authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf: Slightly improve topoloader Load().

parent e1d23a33
TESTDLL = mf.dll
IMPORTS = mf mfplat mfuuid
IMPORTS = mf mfplat mfuuid ole32
C_SRCS = \
mf.c
RC_SRCS = resource.rc
/*
* Copyright 2019 Nikolay Sivov for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windef.h"
/* @makedep: test.wav */
test.wav RCDATA test.wav
......@@ -791,6 +791,13 @@ static const IMFTopologyVtbl topologyvtbl =
topology_GetOutputNodeCollection,
};
static struct topology *unsafe_impl_from_IMFTopology(IMFTopology *iface)
{
if (!iface || iface->lpVtbl != &topologyvtbl)
return NULL;
return impl_from_IMFTopology(iface);
}
static TOPOID topology_generate_id(void)
{
TOPOID old;
......@@ -1720,9 +1727,44 @@ static ULONG WINAPI topology_loader_Release(IMFTopoLoader *iface)
static HRESULT WINAPI topology_loader_Load(IMFTopoLoader *iface, IMFTopology *input_topology,
IMFTopology **output_topology, IMFTopology *current_topology)
{
struct topology *topology = unsafe_impl_from_IMFTopology(input_topology);
IMFMediaSink *sink;
HRESULT hr;
size_t i;
FIXME("%p, %p, %p, %p.\n", iface, input_topology, output_topology, current_topology);
return E_NOTIMPL;
if (current_topology)
FIXME("Current topology instance is ignored.\n");
for (i = 0; i < topology->nodes.count; ++i)
{
struct topology_node *node = topology->nodes.nodes[i];
switch (node->node_type)
{
case MF_TOPOLOGY_OUTPUT_NODE:
if (node->object)
{
/* Sinks must be bound beforehand. */
if (FAILED(IUnknown_QueryInterface(node->object, &IID_IMFMediaSink, (void **)&sink)))
return MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED;
IMFMediaSink_Release(sink);
}
break;
case MF_TOPOLOGY_SOURCESTREAM_NODE:
if (FAILED(hr = IMFAttributes_GetItem(node->attributes, &MF_TOPONODE_STREAM_DESCRIPTOR, NULL)))
return hr;
break;
default:
;
}
}
if (FAILED(hr = MFCreateTopology(output_topology)))
return hr;
return IMFTopology_CloneFrom(*output_topology, input_topology);
}
static const IMFTopoLoaderVtbl topologyloadervtbl =
......
......@@ -76,6 +76,13 @@ typedef enum MFSESSION_GETFULLTOPOLOGY_FLAGS
MFSESSION_GETFULLTOPOLOGY_CURRENT = 0x00000001,
} MFSESSION_GETFULLTOPOLOGY_FLAGS;
typedef enum _MF_TOPOLOGY_RESOLUTION_STATUS_FLAGS
{
MF_TOPOLOGY_RESOLUTION_SUCCEEDED = 0x00000000,
MF_OPTIONAL_NODE_REJECTED_MEDIA_TYPE = 0x00000001,
MF_OPTIONAL_NODE_REJECTED_PROTECTED_PROCESS = 0x00000002,
} MF_TOPOLOGY_RESOLUTION_STATUS_FLAGS;
[
object,
uuid(2eb1e945-18b8-4139-9b1a-d5d584818530),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment