From 167ad8ca49542661a75697874f1375bd6a93ca74 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 26 Mar 2016 14:31:03 +0100
Subject: mfplat: Add stub for MFCreateSourceResolver.

---
 dlls/mf/mf.spec         |  2 +-
 dlls/mfplat/main.c      | 11 +++++++++++
 dlls/mfplat/mfplat.spec |  2 +-
 include/mfidl.idl       | 40 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/dlls/mf/mf.spec b/dlls/mf/mf.spec
index 546a697..f70538e 100644
--- a/dlls/mf/mf.spec
+++ b/dlls/mf/mf.spec
@@ -57,7 +57,7 @@
 @ stub MFCreateSequencerSource
 @ stub MFCreateSequencerSourceRemoteStream
 @ stub MFCreateSimpleTypeHandler
-@ stub MFCreateSourceResolver
+@ stdcall MFCreateSourceResolver(ptr) mfplat.MFCreateSourceResolver
 @ stub MFCreateStandardQualityManager
 @ stub MFCreateTopoLoader
 @ stub MFCreateTopology
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index 3d029d8..7daeded 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -30,6 +30,7 @@
 #include "initguid.h"
 #include "mfapi.h"
 #include "mferror.h"
+#include "mfidl.h"
 
 #include "wine/debug.h"
 #include "wine/unicode.h"
@@ -522,3 +523,13 @@ HRESULT WINAPI MFGetPluginControl(IMFPluginControl **ret)
     *ret = &plugin_control;
     return S_OK;
 }
+
+/***********************************************************************
+ *      MFCreateSourceResolver (mfplat.@)
+ */
+HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **source_resolver)
+{
+    FIXME("(%p): stub\n", source_resolver);
+
+    return E_NOTIMPL;
+}
diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec
index cb16e8c..e1ef001 100644
--- a/dlls/mfplat/mfplat.spec
+++ b/dlls/mfplat/mfplat.spec
@@ -58,7 +58,7 @@
 @ stub MFCreateSample
 @ stub MFCreateSocket
 @ stub MFCreateSocketListener
-@ stub MFCreateSourceResolver
+@ stdcall MFCreateSourceResolver(ptr)
 @ stub MFCreateStreamDescriptor
 @ stub MFCreateSystemTimeSource
 @ stub MFCreateSystemUnderlyingClock
diff --git a/include/mfidl.idl b/include/mfidl.idl
index 3431260..a99b02e 100644
--- a/include/mfidl.idl
+++ b/include/mfidl.idl
@@ -48,6 +48,13 @@ typedef struct _MFCLOCK_PROPERTIES
     DWORD            dwClockJitter;
 } MFCLOCK_PROPERTIES;
 
+typedef enum MF_OBJECT_TYPE
+{
+    MF_OBJECT_MEDIASOURCE,
+    MF_OBJECT_BYTESTREAM,
+    MF_OBJECT_INVALID
+} MF_OBJECT_TYPE;
+
 [
     object,
     uuid(2eb1e945-18b8-4139-9b1a-d5d584818530),
@@ -124,3 +131,36 @@ interface IMFMediaSession : IMFMediaEventGenerator
     HRESULT GetSessionCapabilities([out] DWORD *caps);
     HRESULT GetFullTopology([in] DWORD flags, [in] TOPOID id, [out] IMFTopology **topology);
 }
+
+[
+    object,
+    uuid(fbe5a32d-a497-4b61-bb85-97b1a848a6e3),
+]
+interface IMFSourceResolver : IUnknown
+{
+    [local] HRESULT CreateObjectFromURL([in] const WCHAR *url, [in] DWORD flags, [in] IPropertyStore *props,
+                                        [out] MF_OBJECT_TYPE *type, [out] IUnknown **object);
+    [local] HRESULT CreateObjectFromByteStream([in] IMFByteStream *stream, [in] const WCHAR *url,
+                                               [in] DWORD flags, [in] IPropertyStore *props,
+                                               [out] MF_OBJECT_TYPE *type, [out] IUnknown **object);
+    [local] HRESULT BeginCreateObjectFromURL([in] const WCHAR *url, [in] DWORD flags,
+                                             [in] IPropertyStore *props, [out] IUnknown **cancel_cookie,
+                                             [in] IMFAsyncCallback *callback, [in] IUnknown *unk_state);
+    [call_as(BeginCreateObjectFromURL)] HRESULT RemoteBeginCreateObjectFromURL([in, string] const WCHAR *url,
+            [in] DWORD flags, [in] IPropertyStore *props, [in] IMFRemoteAsyncCallback *callback);
+    [local] HRESULT EndCreateObjectFromURL([in] IMFAsyncResult *result, [out] MF_OBJECT_TYPE *type,
+                                           [out] IUnknown **object);
+    [call_as(EndCreateObjectFromURL)] HRESULT RemoteEndCreateObjectFromURL([in] IUnknown *result,
+            [out]  MF_OBJECT_TYPE *type, [out] IUnknown **object);
+    [local] HRESULT BeginCreateObjectFromByteStream([in] IMFByteStream *stream, [in] const WCHAR *url,
+            [in] DWORD flags, [in] IPropertyStore *props, [out] IUnknown **cancel_cookie,
+            [in] IMFAsyncCallback *callback, [in] IUnknown *unk_state);
+    [call_as(BeginCreateObjectFromByteStream)] HRESULT RemoteBeginCreateObjectFromByteStream(
+            [in] IMFByteStream *stream, [in, unique] const WCHAR *url, [in] DWORD flags,
+            [in, unique] IPropertyStore *props, [in] IMFRemoteAsyncCallback *callback);
+    [local] HRESULT EndCreateObjectFromByteStream([in] IMFAsyncResult *result, [out] MF_OBJECT_TYPE *type,
+                                                  [out] IUnknown **object);
+    [call_as(EndCreateObjectFromByteStream)] HRESULT RemoteEndCreateObjectFromByteStream([in] IUnknown *result,
+            [out] MF_OBJECT_TYPE *type, [out] IUnknown **object);
+    [local] HRESULT CancelObjectCreation([in] IUnknown *cancel_cookie);
+}
-- 
2.7.1

