[PATCH 2/4] mfplat: Write flags when registering MFT.

Nikolay Sivov nsivov at codeweavers.com
Tue May 7 07:25:43 CDT 2019


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/mfplat/main.c | 14 +++++++++-----
 include/mfapi.h    | 16 ++++++++++++++++
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index 4f634e0d82..d10e643868 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -71,6 +71,7 @@ static const WCHAR categories_keyW[] = {'M','e','d','i','a','F','o','u','n','d',
 static const WCHAR inputtypesW[]  = {'I','n','p','u','t','T','y','p','e','s',0};
 static const WCHAR outputtypesW[] = {'O','u','t','p','u','t','T','y','p','e','s',0};
 static const WCHAR attributesW[] = {'A','t','t','r','i','b','u','t','e','s',0};
+static const WCHAR mftflagsW[] = {'M','F','T','F','l','a','g','s',0};
 static const WCHAR szGUIDFmt[] =
 {
     '%','0','8','x','-','%','0','4','x','-','%','0','4','x','-','%','0',
@@ -167,7 +168,7 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
     return TRUE;
 }
 
-static HRESULT register_transform(const CLSID *clsid, const WCHAR *name,
+static HRESULT register_transform(const CLSID *clsid, const WCHAR *name, UINT32 flags,
         UINT32 cinput, const MFT_REGISTER_TYPE_INFO *input_types, UINT32 coutput,
         const MFT_REGISTER_TYPE_INFO *output_types, IMFAttributes *attributes)
 {
@@ -224,6 +225,12 @@ static HRESULT register_transform(const CLSID *clsid, const WCHAR *name,
         }
     }
 
+    if (SUCCEEDED(hr) && flags)
+    {
+        if ((ret = RegSetValueExW(hclsid, mftflagsW, 0, REG_DWORD, (BYTE *)&flags, sizeof(flags))))
+            hr = HRESULT_FROM_WIN32(ret);
+    }
+
     RegCloseKey(hclsid);
     return hr;
 }
@@ -259,10 +266,7 @@ HRESULT WINAPI MFTRegister(CLSID clsid, GUID category, LPWSTR name, UINT32 flags
     TRACE("%s, %s, %s, %#x, %u, %p, %u, %p, %p.\n", debugstr_guid(&clsid), debugstr_guid(&category),
             debugstr_w(name), flags, cinput, input_types, coutput, output_types, attributes);
 
-    if (flags)
-        FIXME("flags not yet supported.\n");
-
-    hr = register_transform(&clsid, name, cinput, input_types, coutput, output_types, attributes);
+    hr = register_transform(&clsid, name, flags, cinput, input_types, coutput, output_types, attributes);
     if(FAILED(hr))
         ERR("Failed to write register transform\n");
 
diff --git a/include/mfapi.h b/include/mfapi.h
index d172db147a..f3ca3d9444 100644
--- a/include/mfapi.h
+++ b/include/mfapi.h
@@ -350,6 +350,22 @@ typedef enum _MFWaveFormatExConvertFlags
     MFWaveFormatExConvertFlag_ForceExtensible = 1,
 } MFWaveFormatExConvertFlags;
 
+enum _MFT_ENUM_FLAG
+{
+    MFT_ENUM_FLAG_SYNCMFT                         = 0x00000001,
+    MFT_ENUM_FLAG_ASYNCMFT                        = 0x00000002,
+    MFT_ENUM_FLAG_HARDWARE                        = 0x00000004,
+    MFT_ENUM_FLAG_FIELDOFUSE                      = 0x00000008,
+    MFT_ENUM_FLAG_LOCALMFT                        = 0x00000010,
+    MFT_ENUM_FLAG_TRANSCODE_ONLY                  = 0x00000020,
+    MFT_ENUM_FLAG_ALL                             = 0x0000003f,
+    MFT_ENUM_FLAG_SORTANDFILTER                   = 0x00000040,
+    MFT_ENUM_FLAG_SORTANDFILTER_APPROVED_ONLY     = 0x000000c0,
+    MFT_ENUM_FLAG_SORTANDFILTER_WEB_ONLY          = 0x00000140,
+    MFT_ENUM_FLAG_SORTANDFILTER_WEB_ONLY_EDGEMODE = 0x00000240,
+    MFT_ENUM_FLAG_UNTRUSTED_STOREMFT              = 0x00000400,
+};
+
 HRESULT WINAPI MFAddPeriodicCallback(MFPERIODICCALLBACK callback, IUnknown *context, DWORD *key);
 HRESULT WINAPI MFAllocateWorkQueue(DWORD *queue);
 HRESULT WINAPI MFAllocateWorkQueueEx(MFASYNC_WORKQUEUE_TYPE queue_type, DWORD *queue);
-- 
2.20.1




More information about the wine-devel mailing list