winegstreamer: Convert media type registration to IRegistrar mechanism.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-04-22 21:13:01 -05:00 committed by Alexandre Julliard
parent 5bacbaf793
commit cf345813de
4 changed files with 22 additions and 84 deletions

View File

@ -24,16 +24,11 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "advpub.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "gst_private.h" #include "gst_private.h"
#include "rpcproxy.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "initguid.h" #include "initguid.h"
#include "gst_guids.h" #include "gst_guids.h"
@ -308,65 +303,6 @@ BOOL init_gstreamer(void)
return status; return status;
} }
#define INF_SET_ID(id) \
do \
{ \
static CHAR name[] = #id; \
\
pse[i].pszName = name; \
clsids[i++] = &id; \
} while (0)
#define INF_SET_CLSID(clsid) INF_SET_ID(CLSID_ ## clsid)
static HRESULT register_server(BOOL do_register)
{
HRESULT hres;
HMODULE hAdvpack;
HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable);
STRTABLEA strtable;
STRENTRYA pse[3];
static CLSID const *clsids[3];
unsigned int i = 0;
static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0};
TRACE("(%x)\n", do_register);
INF_SET_CLSID(AsyncReader);
INF_SET_ID(MEDIATYPE_Stream);
INF_SET_ID(WINESUBTYPE_Gstreamer);
for(i = 0; i < ARRAY_SIZE(pse); i++) {
pse[i].pszValue = HeapAlloc(GetProcessHeap(),0,39);
sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0],
clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4],
clsids[i]->Data4[5], clsids[i]->Data4[6], clsids[i]->Data4[7]);
}
strtable.cEntries = ARRAY_SIZE(pse);
strtable.pse = pse;
hAdvpack = LoadLibraryW(wszAdvpack);
pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall");
hres = pRegInstall(hInst, do_register ? "RegisterDll" : "UnregisterDll", &strtable);
for(i = 0; i < ARRAY_SIZE(pse); i++)
HeapFree(GetProcessHeap(),0,pse[i].pszValue);
if(FAILED(hres)) {
ERR("RegInstall failed: %08x\n", hres);
return hres;
}
return hres;
}
#undef INF_SET_CLSID
#undef INF_SET_ID
/*********************************************************************** /***********************************************************************
* DllRegisterServer * DllRegisterServer
*/ */
@ -378,7 +314,7 @@ HRESULT WINAPI DllRegisterServer(void)
hr = AMovieDllRegisterServer2(TRUE); hr = AMovieDllRegisterServer2(TRUE);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = register_server(TRUE); hr = __wine_register_resources(hInst);
return hr; return hr;
} }
@ -393,6 +329,6 @@ HRESULT WINAPI DllUnregisterServer(void)
hr = AMovieDllRegisterServer2(FALSE); hr = AMovieDllRegisterServer2(FALSE);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = register_server(FALSE); hr = __wine_unregister_resources(hInst);
return hr; return hr;
} }

View File

@ -24,5 +24,5 @@
#include "wine/wine_common_ver.rc" #include "wine/wine_common_ver.rc"
/* @makedep: winegstreamer.inf */ /* @makedep: winegstreamer.rgs */
REGINST REGINST winegstreamer.inf 1 WINE_REGISTRY winegstreamer.rgs

View File

@ -1,12 +0,0 @@
[version]
Signature="$CHICAGO$"
[RegisterDll]
AddReg=MediaParsing.Reg
[UnregisterDll]
DelReg=MediaParsing.Reg
[MediaParsing.Reg]
HKCR,"Media Type\%MEDIATYPE_Stream%\%WINESUBTYPE_Gstreamer%","0",,"0,1,00,0"
HKCR,"Media Type\%MEDIATYPE_Stream%\%WINESUBTYPE_Gstreamer%","Source Filter",,"%CLSID_AsyncReader%"

View File

@ -0,0 +1,14 @@
HKCR
{
NoRemove 'Media Type'
{
'{e436eb83-524f-11ce-9f53-0020af0ba770}'
{
ForceRemove '{ffffffff-128f-4dd1-ad22-becfa66ce7aa}'
{
val '0' = s '0,1,00,0'
val 'Source Filter' = s '{e436ebb5-524f-11ce-9f53-0020af0ba770}'
}
}
}
}