Similar to !6430 and !6362, this should make it possible to use native override for these classes.
-- v2: l3codecx.ax: Register the MP3 Decoder class. quartz: Register the MPEG Video Decoder class. quartz: Register the MPEG Audio Decoder class. quartz: Register the WAVE Parser class. quartz: Register the AVI Splitter class. quartz: Register the MPEG1 Splitter class. quartz: Move registration code to main.c. quartz: Simplify the filter registration code.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/quartz/regsvr.c | 401 +++++++++++++++++++------------------------ 1 file changed, 175 insertions(+), 226 deletions(-)
diff --git a/dlls/quartz/regsvr.c b/dlls/quartz/regsvr.c index f203f0b7fa7..28ae50ade0c 100644 --- a/dlls/quartz/regsvr.c +++ b/dlls/quartz/regsvr.c @@ -37,226 +37,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
-/* - * Near the bottom of this file are the exported DllRegisterServer and - * DllUnregisterServer, which make all this worthwhile. - */ - -struct mediatype -{ - CLSID const *majortype; /* NULL for end of list */ - CLSID const *subtype; - DWORD fourcc; -}; - -struct pin -{ - DWORD flags; /* 0xFFFFFFFF for end of list */ - struct mediatype mediatypes[11]; -}; - -struct regsvr_filter -{ - CLSID const *clsid; /* NULL for end of list */ - CLSID const *category; - WCHAR name[50]; - DWORD merit; - struct pin pins[11]; -}; - -/*********************************************************************** - * register_filters - */ -static HRESULT register_filters(struct regsvr_filter const *list) -{ - HRESULT hr; - IFilterMapper2* pFM2 = NULL; - - CoInitialize(NULL); - hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&pFM2); - - if (SUCCEEDED(hr)) { - for (; SUCCEEDED(hr) && list->clsid; ++list) { - REGFILTER2 rf2; - REGFILTERPINS2* prfp2; - int i; - - for (i = 0; list->pins[i].flags != 0xFFFFFFFF; i++) ; - rf2.dwVersion = 2; - rf2.dwMerit = list->merit; - rf2.cPins2 = i; - rf2.rgPins2 = prfp2 = CoTaskMemAlloc(i*sizeof(REGFILTERPINS2)); - if (!prfp2) { - hr = E_OUTOFMEMORY; - break; - } - for (i = 0; list->pins[i].flags != 0xFFFFFFFF; i++) { - REGPINTYPES* lpMediatype; - CLSID* lpClsid; - int j, nbmt; - - for (nbmt = 0; list->pins[i].mediatypes[nbmt].majortype; nbmt++) ; - /* Allocate a single buffer for regpintypes struct and clsids */ - lpMediatype = CoTaskMemAlloc(nbmt*(sizeof(REGPINTYPES) + 2*sizeof(CLSID))); - if (!lpMediatype) { - hr = E_OUTOFMEMORY; - break; - } - lpClsid = (CLSID*) (lpMediatype + nbmt); - for (j = 0; j < nbmt; j++) { - (lpMediatype + j)->clsMajorType = lpClsid + j*2; - memcpy(lpClsid + j*2, list->pins[i].mediatypes[j].majortype, sizeof(CLSID)); - (lpMediatype + j)->clsMinorType = lpClsid + j*2 + 1; - if (list->pins[i].mediatypes[j].subtype) - memcpy(lpClsid + j*2 + 1, list->pins[i].mediatypes[j].subtype, sizeof(CLSID)); - else { - /* Subtypes are often a combination of major type + fourcc/tag */ - memcpy(lpClsid + j*2 + 1, list->pins[i].mediatypes[j].majortype, sizeof(CLSID)); - *(DWORD*)(lpClsid + j*2 + 1) = list->pins[i].mediatypes[j].fourcc; - } - } - prfp2[i].dwFlags = list->pins[i].flags; - prfp2[i].cInstances = 0; - prfp2[i].nMediaTypes = j; - prfp2[i].lpMediaType = lpMediatype; - prfp2[i].nMediums = 0; - prfp2[i].lpMedium = NULL; - prfp2[i].clsPinCategory = NULL; - } - - if (FAILED(hr)) { - ERR("failed to register with hresult %#lx\n", hr); - CoTaskMemFree(prfp2); - break; - } - - hr = IFilterMapper2_RegisterFilter(pFM2, list->clsid, list->name, NULL, list->category, NULL, &rf2); - - while (i) { - CoTaskMemFree((REGPINTYPES*)prfp2[i-1].lpMediaType); - i--; - } - CoTaskMemFree(prfp2); - } - } - - if (pFM2) - IFilterMapper2_Release(pFM2); - - CoUninitialize(); - - return hr; -} - -/*********************************************************************** - * unregister_filters - */ -static HRESULT unregister_filters(struct regsvr_filter const *list) -{ - HRESULT hr; - IFilterMapper2* pFM2; - - hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&pFM2); - - if (SUCCEEDED(hr)) { - for (; SUCCEEDED(hr) && list->clsid; ++list) - hr = IFilterMapper2_UnregisterFilter(pFM2, list->category, NULL, list->clsid); - IFilterMapper2_Release(pFM2); - } - - return hr; -} - -/*********************************************************************** - * filter list - */ - -static struct regsvr_filter const filter_list[] = { - { &CLSID_VideoRenderer, - &CLSID_LegacyAmFilterCategory, - L"Video Renderer", - 0x800000, - { { REG_PINFLAG_B_RENDERER, - { { &MEDIATYPE_Video, &GUID_NULL }, - { NULL } - }, - }, - { 0xFFFFFFFF }, - } - }, - { &CLSID_VideoRendererDefault, - &CLSID_LegacyAmFilterCategory, - L"Video Renderer", - 0x800001, - { { REG_PINFLAG_B_RENDERER, - { { &MEDIATYPE_Video, &GUID_NULL }, - { NULL } - }, - }, - { 0xFFFFFFFF }, - } - }, - { &CLSID_VideoMixingRenderer9, - &CLSID_LegacyAmFilterCategory, - L"Video Mixing Renderer 9", - 0x200000, - { { REG_PINFLAG_B_RENDERER, - { { &MEDIATYPE_Video, &GUID_NULL }, - { NULL } - }, - }, - { 0xFFFFFFFF }, - } - }, - { &CLSID_AVIDec, - &CLSID_LegacyAmFilterCategory, - L"AVI Decompressor", - 0x5ffff0, - { { 0, - { { &MEDIATYPE_Video, &GUID_NULL }, - { NULL } - }, - }, - { REG_PINFLAG_B_OUTPUT, - { { &MEDIATYPE_Video, &GUID_NULL }, - { NULL } - }, - }, - { 0xFFFFFFFF }, - } - }, - { &CLSID_AsyncReader, - &CLSID_LegacyAmFilterCategory, - L"File Source (Async.)", - 0x400000, - { { REG_PINFLAG_B_OUTPUT, - { { &MEDIATYPE_Stream, &GUID_NULL }, - { NULL } - }, - }, - { 0xFFFFFFFF }, - } - }, - { &CLSID_ACMWrapper, - &CLSID_LegacyAmFilterCategory, - L"ACM Wrapper", - 0x5ffff0, - { { 0, - { { &MEDIATYPE_Audio, &GUID_NULL }, - { NULL } - }, - }, - { REG_PINFLAG_B_OUTPUT, - { { &MEDIATYPE_Audio, &GUID_NULL }, - { NULL } - }, - }, - { 0xFFFFFFFF }, - } - }, - { NULL } /* list terminator */ -}; - extern HRESULT WINAPI QUARTZ_DllRegisterServer(void); extern HRESULT WINAPI QUARTZ_DllUnregisterServer(void);
@@ -265,13 +45,162 @@ extern HRESULT WINAPI QUARTZ_DllUnregisterServer(void); */ HRESULT WINAPI DllRegisterServer(void) { + static const REGPINTYPES video_renderer_inputs[] = + { + {&MEDIATYPE_Video, &GUID_NULL}, + }; + static const REGFILTERPINS2 video_renderer_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(video_renderer_inputs), + .lpMediaType = video_renderer_inputs, + .dwFlags = REG_PINFLAG_B_RENDERER, + }, + }; + static const REGFILTER2 video_renderer_default_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_PREFERRED + 1, + .cPins2 = ARRAY_SIZE(video_renderer_pins), + .rgPins2 = video_renderer_pins, + }; + static const REGFILTER2 video_renderer_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_PREFERRED, + .cPins2 = ARRAY_SIZE(video_renderer_pins), + .rgPins2 = video_renderer_pins, + }; + + static const REGPINTYPES vmr9_filter_inputs[] = + { + {&MEDIATYPE_Video, &GUID_NULL}, + }; + static const REGFILTERPINS2 vmr9_filter_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(vmr9_filter_inputs), + .lpMediaType = vmr9_filter_inputs, + .dwFlags = REG_PINFLAG_B_RENDERER, + }, + }; + static const REGFILTER2 vmr9_filter_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_DO_NOT_USE, + .cPins2 = ARRAY_SIZE(vmr9_filter_pins), + .rgPins2 = vmr9_filter_pins, + }; + + static const REGPINTYPES avi_decompressor_inputs[] = + { + {&MEDIATYPE_Video, &GUID_NULL}, + }; + static const REGPINTYPES avi_decompressor_outputs[] = + { + {&MEDIATYPE_Video, &GUID_NULL}, + }; + static const REGFILTERPINS2 avi_decompressor_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(avi_decompressor_inputs), + .lpMediaType = avi_decompressor_inputs, + }, + { + .nMediaTypes = ARRAY_SIZE(avi_decompressor_outputs), + .lpMediaType = avi_decompressor_outputs, + .dwFlags = REG_PINFLAG_B_OUTPUT, + }, + }; + static const REGFILTER2 avi_decompressor_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_NORMAL - 16, + .cPins2 = ARRAY_SIZE(avi_decompressor_pins), + .rgPins2 = avi_decompressor_pins, + }; + + static const REGPINTYPES async_reader_outputs[] = + { + {&MEDIATYPE_Stream, &GUID_NULL}, + }; + static const REGFILTERPINS2 async_reader_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(async_reader_outputs), + .lpMediaType = async_reader_outputs, + .dwFlags = REG_PINFLAG_B_OUTPUT, + }, + }; + static const REGFILTER2 async_reader_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_UNLIKELY, + .cPins2 = ARRAY_SIZE(async_reader_pins), + .rgPins2 = async_reader_pins, + }; + + static const REGPINTYPES acm_wrapper_inputs[] = + { + {&MEDIATYPE_Audio, &GUID_NULL}, + }; + static const REGPINTYPES acm_wrapper_outputs[] = + { + {&MEDIATYPE_Audio, &GUID_NULL}, + }; + static const REGFILTERPINS2 acm_wrapper_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(acm_wrapper_inputs), + .lpMediaType = acm_wrapper_inputs, + }, + { + .nMediaTypes = ARRAY_SIZE(acm_wrapper_outputs), + .lpMediaType = acm_wrapper_outputs, + .dwFlags = REG_PINFLAG_B_OUTPUT, + }, + }; + static const REGFILTER2 acm_wrapper_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_NORMAL - 16, + .cPins2 = ARRAY_SIZE(acm_wrapper_pins), + .rgPins2 = acm_wrapper_pins, + }; + + IFilterMapper2 *mapper; HRESULT hr;
TRACE("\n");
- hr = QUARTZ_DllRegisterServer(); - if (SUCCEEDED(hr)) - hr = register_filters(filter_list); + if (FAILED(hr = QUARTZ_DllRegisterServer())) + return hr; + + if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterMapper2, (void **)&mapper))) + return hr; + + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoRenderer, L"Video Renderer", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &video_renderer_reg))) + goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoRendererDefault, L"Video Renderer", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &video_renderer_default_reg))) + goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoMixingRenderer9, L"Video Mixing Renderer 9", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &vmr9_filter_reg))) + goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_AVIDec, L"AVI Decompressor", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &avi_decompressor_reg))) + goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_AsyncReader, L"File Source (Async.)", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &async_reader_reg))) + goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_ACMWrapper, L"ACM Wrapper", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &acm_wrapper_reg))) + goto done; + +done: + IFilterMapper2_Release(mapper); return hr; }
@@ -280,12 +209,32 @@ HRESULT WINAPI DllRegisterServer(void) */ HRESULT WINAPI DllUnregisterServer(void) { + IFilterMapper2 *mapper; HRESULT hr;
TRACE("\n");
- hr = unregister_filters(filter_list); - if (SUCCEEDED(hr)) - hr = QUARTZ_DllUnregisterServer(); + if (FAILED(hr = QUARTZ_DllUnregisterServer())) + return hr; + + if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterMapper2, (void **)&mapper))) + return hr; + + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoRenderer))) + goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoRendererDefault))) + goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoMixingRenderer9))) + goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_AVIDec))) + goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_AsyncReader))) + goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_ACMWrapper))) + goto done; + +done: + IFilterMapper2_Release(mapper); return hr; }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/quartz/Makefile.in | 1 - dlls/quartz/main.c | 201 +++++++++++++++++++++++++++++++++ dlls/quartz/regsvr.c | 240 ---------------------------------------- 3 files changed, 201 insertions(+), 241 deletions(-) delete mode 100644 dlls/quartz/regsvr.c
diff --git a/dlls/quartz/Makefile.in b/dlls/quartz/Makefile.in index db6280f27ed..f1b47adaf72 100644 --- a/dlls/quartz/Makefile.in +++ b/dlls/quartz/Makefile.in @@ -16,7 +16,6 @@ SOURCES = \ passthrough.c \ quartz.rc \ quartz_strmif.idl \ - regsvr.c \ systemclock.c \ videorenderer.c \ vmr7.c \ diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index f52884afb34..725ae56190a 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -25,6 +25,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz);
extern HRESULT WINAPI QUARTZ_DllGetClassObject(REFCLSID, REFIID, LPVOID *); extern BOOL WINAPI QUARTZ_DllMain(HINSTANCE, DWORD, LPVOID); +extern HRESULT WINAPI QUARTZ_DllRegisterServer(void); +extern HRESULT WINAPI QUARTZ_DllUnregisterServer(void);
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { @@ -191,6 +193,205 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) return QUARTZ_DllGetClassObject( rclsid, riid, ppv ); }
+/*********************************************************************** + * DllRegisterServer (QUARTZ.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + static const REGPINTYPES video_renderer_inputs[] = + { + {&MEDIATYPE_Video, &GUID_NULL}, + }; + static const REGFILTERPINS2 video_renderer_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(video_renderer_inputs), + .lpMediaType = video_renderer_inputs, + .dwFlags = REG_PINFLAG_B_RENDERER, + }, + }; + static const REGFILTER2 video_renderer_default_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_PREFERRED + 1, + .cPins2 = ARRAY_SIZE(video_renderer_pins), + .rgPins2 = video_renderer_pins, + }; + static const REGFILTER2 video_renderer_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_PREFERRED, + .cPins2 = ARRAY_SIZE(video_renderer_pins), + .rgPins2 = video_renderer_pins, + }; + + static const REGPINTYPES vmr9_filter_inputs[] = + { + {&MEDIATYPE_Video, &GUID_NULL}, + }; + static const REGFILTERPINS2 vmr9_filter_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(vmr9_filter_inputs), + .lpMediaType = vmr9_filter_inputs, + .dwFlags = REG_PINFLAG_B_RENDERER, + }, + }; + static const REGFILTER2 vmr9_filter_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_DO_NOT_USE, + .cPins2 = ARRAY_SIZE(vmr9_filter_pins), + .rgPins2 = vmr9_filter_pins, + }; + + static const REGPINTYPES avi_decompressor_inputs[] = + { + {&MEDIATYPE_Video, &GUID_NULL}, + }; + static const REGPINTYPES avi_decompressor_outputs[] = + { + {&MEDIATYPE_Video, &GUID_NULL}, + }; + static const REGFILTERPINS2 avi_decompressor_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(avi_decompressor_inputs), + .lpMediaType = avi_decompressor_inputs, + }, + { + .nMediaTypes = ARRAY_SIZE(avi_decompressor_outputs), + .lpMediaType = avi_decompressor_outputs, + .dwFlags = REG_PINFLAG_B_OUTPUT, + }, + }; + static const REGFILTER2 avi_decompressor_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_NORMAL - 16, + .cPins2 = ARRAY_SIZE(avi_decompressor_pins), + .rgPins2 = avi_decompressor_pins, + }; + + static const REGPINTYPES async_reader_outputs[] = + { + {&MEDIATYPE_Stream, &GUID_NULL}, + }; + static const REGFILTERPINS2 async_reader_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(async_reader_outputs), + .lpMediaType = async_reader_outputs, + .dwFlags = REG_PINFLAG_B_OUTPUT, + }, + }; + static const REGFILTER2 async_reader_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_UNLIKELY, + .cPins2 = ARRAY_SIZE(async_reader_pins), + .rgPins2 = async_reader_pins, + }; + + static const REGPINTYPES acm_wrapper_inputs[] = + { + {&MEDIATYPE_Audio, &GUID_NULL}, + }; + static const REGPINTYPES acm_wrapper_outputs[] = + { + {&MEDIATYPE_Audio, &GUID_NULL}, + }; + static const REGFILTERPINS2 acm_wrapper_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(acm_wrapper_inputs), + .lpMediaType = acm_wrapper_inputs, + }, + { + .nMediaTypes = ARRAY_SIZE(acm_wrapper_outputs), + .lpMediaType = acm_wrapper_outputs, + .dwFlags = REG_PINFLAG_B_OUTPUT, + }, + }; + static const REGFILTER2 acm_wrapper_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_NORMAL - 16, + .cPins2 = ARRAY_SIZE(acm_wrapper_pins), + .rgPins2 = acm_wrapper_pins, + }; + + IFilterMapper2 *mapper; + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = QUARTZ_DllRegisterServer())) + return hr; + + if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterMapper2, (void **)&mapper))) + return hr; + + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoRenderer, L"Video Renderer", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &video_renderer_reg))) + goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoRendererDefault, L"Video Renderer", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &video_renderer_default_reg))) + goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoMixingRenderer9, L"Video Mixing Renderer 9", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &vmr9_filter_reg))) + goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_AVIDec, L"AVI Decompressor", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &avi_decompressor_reg))) + goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_AsyncReader, L"File Source (Async.)", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &async_reader_reg))) + goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_ACMWrapper, L"ACM Wrapper", NULL, + &CLSID_LegacyAmFilterCategory, NULL, &acm_wrapper_reg))) + goto done; + +done: + IFilterMapper2_Release(mapper); + return hr; +} + +/*********************************************************************** + * DllUnregisterServer (QUARTZ.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + IFilterMapper2 *mapper; + HRESULT hr; + + TRACE("\n"); + + if (FAILED(hr = QUARTZ_DllUnregisterServer())) + return hr; + + if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterMapper2, (void **)&mapper))) + return hr; + + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoRenderer))) + goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoRendererDefault))) + goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoMixingRenderer9))) + goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_AVIDec))) + goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_AsyncReader))) + goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_ACMWrapper))) + goto done; + +done: + IFilterMapper2_Release(mapper); + return hr; +} + #define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } , #name },
diff --git a/dlls/quartz/regsvr.c b/dlls/quartz/regsvr.c deleted file mode 100644 index 28ae50ade0c..00000000000 --- a/dlls/quartz/regsvr.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - * self-registerable dll functions for quartz.dll - * - * Copyright (C) 2003 John K. Hohm - * - * 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 - */ - -#define COBJMACROS -#include <stdarg.h> -#include <string.h> - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "winreg.h" -#include "winerror.h" - -#include "ole2.h" -#include "uuids.h" -#include "strmif.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(quartz); - -extern HRESULT WINAPI QUARTZ_DllRegisterServer(void); -extern HRESULT WINAPI QUARTZ_DllUnregisterServer(void); - -/*********************************************************************** - * DllRegisterServer (QUARTZ.@) - */ -HRESULT WINAPI DllRegisterServer(void) -{ - static const REGPINTYPES video_renderer_inputs[] = - { - {&MEDIATYPE_Video, &GUID_NULL}, - }; - static const REGFILTERPINS2 video_renderer_pins[] = - { - { - .nMediaTypes = ARRAY_SIZE(video_renderer_inputs), - .lpMediaType = video_renderer_inputs, - .dwFlags = REG_PINFLAG_B_RENDERER, - }, - }; - static const REGFILTER2 video_renderer_default_reg = - { - .dwVersion = 2, - .dwMerit = MERIT_PREFERRED + 1, - .cPins2 = ARRAY_SIZE(video_renderer_pins), - .rgPins2 = video_renderer_pins, - }; - static const REGFILTER2 video_renderer_reg = - { - .dwVersion = 2, - .dwMerit = MERIT_PREFERRED, - .cPins2 = ARRAY_SIZE(video_renderer_pins), - .rgPins2 = video_renderer_pins, - }; - - static const REGPINTYPES vmr9_filter_inputs[] = - { - {&MEDIATYPE_Video, &GUID_NULL}, - }; - static const REGFILTERPINS2 vmr9_filter_pins[] = - { - { - .nMediaTypes = ARRAY_SIZE(vmr9_filter_inputs), - .lpMediaType = vmr9_filter_inputs, - .dwFlags = REG_PINFLAG_B_RENDERER, - }, - }; - static const REGFILTER2 vmr9_filter_reg = - { - .dwVersion = 2, - .dwMerit = MERIT_DO_NOT_USE, - .cPins2 = ARRAY_SIZE(vmr9_filter_pins), - .rgPins2 = vmr9_filter_pins, - }; - - static const REGPINTYPES avi_decompressor_inputs[] = - { - {&MEDIATYPE_Video, &GUID_NULL}, - }; - static const REGPINTYPES avi_decompressor_outputs[] = - { - {&MEDIATYPE_Video, &GUID_NULL}, - }; - static const REGFILTERPINS2 avi_decompressor_pins[] = - { - { - .nMediaTypes = ARRAY_SIZE(avi_decompressor_inputs), - .lpMediaType = avi_decompressor_inputs, - }, - { - .nMediaTypes = ARRAY_SIZE(avi_decompressor_outputs), - .lpMediaType = avi_decompressor_outputs, - .dwFlags = REG_PINFLAG_B_OUTPUT, - }, - }; - static const REGFILTER2 avi_decompressor_reg = - { - .dwVersion = 2, - .dwMerit = MERIT_NORMAL - 16, - .cPins2 = ARRAY_SIZE(avi_decompressor_pins), - .rgPins2 = avi_decompressor_pins, - }; - - static const REGPINTYPES async_reader_outputs[] = - { - {&MEDIATYPE_Stream, &GUID_NULL}, - }; - static const REGFILTERPINS2 async_reader_pins[] = - { - { - .nMediaTypes = ARRAY_SIZE(async_reader_outputs), - .lpMediaType = async_reader_outputs, - .dwFlags = REG_PINFLAG_B_OUTPUT, - }, - }; - static const REGFILTER2 async_reader_reg = - { - .dwVersion = 2, - .dwMerit = MERIT_UNLIKELY, - .cPins2 = ARRAY_SIZE(async_reader_pins), - .rgPins2 = async_reader_pins, - }; - - static const REGPINTYPES acm_wrapper_inputs[] = - { - {&MEDIATYPE_Audio, &GUID_NULL}, - }; - static const REGPINTYPES acm_wrapper_outputs[] = - { - {&MEDIATYPE_Audio, &GUID_NULL}, - }; - static const REGFILTERPINS2 acm_wrapper_pins[] = - { - { - .nMediaTypes = ARRAY_SIZE(acm_wrapper_inputs), - .lpMediaType = acm_wrapper_inputs, - }, - { - .nMediaTypes = ARRAY_SIZE(acm_wrapper_outputs), - .lpMediaType = acm_wrapper_outputs, - .dwFlags = REG_PINFLAG_B_OUTPUT, - }, - }; - static const REGFILTER2 acm_wrapper_reg = - { - .dwVersion = 2, - .dwMerit = MERIT_NORMAL - 16, - .cPins2 = ARRAY_SIZE(acm_wrapper_pins), - .rgPins2 = acm_wrapper_pins, - }; - - IFilterMapper2 *mapper; - HRESULT hr; - - TRACE("\n"); - - if (FAILED(hr = QUARTZ_DllRegisterServer())) - return hr; - - if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, - &IID_IFilterMapper2, (void **)&mapper))) - return hr; - - if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoRenderer, L"Video Renderer", NULL, - &CLSID_LegacyAmFilterCategory, NULL, &video_renderer_reg))) - goto done; - if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoRendererDefault, L"Video Renderer", NULL, - &CLSID_LegacyAmFilterCategory, NULL, &video_renderer_default_reg))) - goto done; - if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_VideoMixingRenderer9, L"Video Mixing Renderer 9", NULL, - &CLSID_LegacyAmFilterCategory, NULL, &vmr9_filter_reg))) - goto done; - if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_AVIDec, L"AVI Decompressor", NULL, - &CLSID_LegacyAmFilterCategory, NULL, &avi_decompressor_reg))) - goto done; - if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_AsyncReader, L"File Source (Async.)", NULL, - &CLSID_LegacyAmFilterCategory, NULL, &async_reader_reg))) - goto done; - if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_ACMWrapper, L"ACM Wrapper", NULL, - &CLSID_LegacyAmFilterCategory, NULL, &acm_wrapper_reg))) - goto done; - -done: - IFilterMapper2_Release(mapper); - return hr; -} - -/*********************************************************************** - * DllUnregisterServer (QUARTZ.@) - */ -HRESULT WINAPI DllUnregisterServer(void) -{ - IFilterMapper2 *mapper; - HRESULT hr; - - TRACE("\n"); - - if (FAILED(hr = QUARTZ_DllUnregisterServer())) - return hr; - - if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, - &IID_IFilterMapper2, (void **)&mapper))) - return hr; - - if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoRenderer))) - goto done; - if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoRendererDefault))) - goto done; - if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_VideoMixingRenderer9))) - goto done; - if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_AVIDec))) - goto done; - if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_AsyncReader))) - goto done; - if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_ACMWrapper))) - goto done; - -done: - IFilterMapper2_Release(mapper); - return hr; -}
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/quartz/Makefile.in | 1 + dlls/quartz/main.c | 48 ++++++++++++++++++ dlls/quartz/parser.c | 25 ++++++++++ dlls/quartz/quartz_private.h | 1 + dlls/quartz/quartz_strmif.idl | 7 +++ dlls/winegstreamer/main.c | 52 +------------------- dlls/winegstreamer/winegstreamer_classes.idl | 5 +- 7 files changed, 86 insertions(+), 53 deletions(-) create mode 100644 dlls/quartz/parser.c
diff --git a/dlls/quartz/Makefile.in b/dlls/quartz/Makefile.in index f1b47adaf72..d1bd73db9be 100644 --- a/dlls/quartz/Makefile.in +++ b/dlls/quartz/Makefile.in @@ -13,6 +13,7 @@ SOURCES = \ filtermapper.c \ main.c \ memallocator.c \ + parser.c \ passthrough.c \ quartz.rc \ quartz_strmif.idl \ diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 725ae56190a..c05b849835e 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -71,6 +71,7 @@ static const struct object_creation_info object_creation[] = { &CLSID_FilterMapper, filter_mapper_create }, { &CLSID_FilterMapper2, filter_mapper_create }, { &CLSID_MemoryAllocator, mem_allocator_create }, + { &CLSID_MPEG1Splitter, mpeg1_splitter_create }, { &CLSID_SeekingPassThru, seeking_passthrough_create }, { &CLSID_SystemClock, system_clock_create }, { &CLSID_VideoRenderer, video_renderer_create }, @@ -321,6 +322,48 @@ HRESULT WINAPI DllRegisterServer(void) .rgPins2 = acm_wrapper_pins, };
+ static const REGPINTYPES mpeg_splitter_inputs[] = + { + {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1Audio}, + {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1Video}, + {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1System}, + {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1VideoCD}, + }; + static const REGPINTYPES mpeg_splitter_audio_outputs[] = + { + {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Packet}, + {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1AudioPayload}, + }; + static const REGPINTYPES mpeg_splitter_video_outputs[] = + { + {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Packet}, + {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Payload}, + }; + static const REGFILTERPINS2 mpeg_splitter_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(mpeg_splitter_inputs), + .lpMediaType = mpeg_splitter_inputs, + }, + { + .dwFlags = REG_PINFLAG_B_ZERO | REG_PINFLAG_B_OUTPUT, + .nMediaTypes = ARRAY_SIZE(mpeg_splitter_audio_outputs), + .lpMediaType = mpeg_splitter_audio_outputs, + }, + { + .dwFlags = REG_PINFLAG_B_ZERO | REG_PINFLAG_B_OUTPUT, + .nMediaTypes = ARRAY_SIZE(mpeg_splitter_video_outputs), + .lpMediaType = mpeg_splitter_video_outputs, + }, + }; + static const REGFILTER2 mpeg_splitter_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_NORMAL, + .cPins2 = ARRAY_SIZE(mpeg_splitter_pins), + .rgPins2 = mpeg_splitter_pins, + }; + IFilterMapper2 *mapper; HRESULT hr;
@@ -351,6 +394,9 @@ HRESULT WINAPI DllRegisterServer(void) if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_ACMWrapper, L"ACM Wrapper", NULL, &CLSID_LegacyAmFilterCategory, NULL, &acm_wrapper_reg))) goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_MPEG1Splitter, L"MPEG-I Stream Splitter", NULL, + NULL, NULL, &mpeg_splitter_reg))) + goto done;
done: IFilterMapper2_Release(mapper); @@ -386,6 +432,8 @@ HRESULT WINAPI DllUnregisterServer(void) goto done; if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_ACMWrapper))) goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_MPEG1Splitter))) + goto done;
done: IFilterMapper2_Release(mapper); diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c new file mode 100644 index 00000000000..b4ef9e00c01 --- /dev/null +++ b/dlls/quartz/parser.c @@ -0,0 +1,25 @@ +/* + * Copyright 2024 Rémi Bernon 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 "quartz_private.h" + +HRESULT mpeg1_splitter_create(IUnknown *outer, IUnknown **out) +{ + static const GUID CLSID_wg_mpeg1_splitter = {0xa8edbf98,0x2442,0x42c5,{0x85,0xa1,0xab,0x05,0xa5,0x80,0xdf,0x53}}; + return CoCreateInstance(&CLSID_wg_mpeg1_splitter, outer, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)out); +} diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index 946709f936a..c307b493fc0 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -56,6 +56,7 @@ HRESULT filter_graph_create(IUnknown *outer, IUnknown **out); HRESULT filter_graph_no_thread_create(IUnknown *outer, IUnknown **out); HRESULT filter_mapper_create(IUnknown *outer, IUnknown **out); HRESULT mem_allocator_create(IUnknown *outer, IUnknown **out); +HRESULT mpeg1_splitter_create(IUnknown *outer, IUnknown **out); HRESULT system_clock_create(IUnknown *outer, IUnknown **out); HRESULT seeking_passthrough_create(IUnknown *outer, IUnknown **out); HRESULT video_renderer_create(IUnknown *outer, IUnknown **out); diff --git a/dlls/quartz/quartz_strmif.idl b/dlls/quartz/quartz_strmif.idl index 51812f4be30..bca51a59b31 100644 --- a/dlls/quartz/quartz_strmif.idl +++ b/dlls/quartz/quartz_strmif.idl @@ -145,3 +145,10 @@ coclass VideoMixingRenderer9 { interface IBaseFilter; } uuid(99d54f63-1a69-41ae-aa4d-c976eb3f0713) ] coclass AllocPresenter {} + +[ + helpstring("MPEG-I Stream Splitter"), + threading(both), + uuid(336475d0-942a-11ce-a870-00aa002feab5) +] +coclass MPEG1Splitter {} diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 006cd370d99..6bc37e7e024 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -997,6 +997,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) static const GUID CLSID_wg_resampler = {0x92f35e78,0x15a5,0x486b,{0x88,0x8e,0x57,0x5f,0x99,0x65,0x1c,0xe2}}; static const GUID CLSID_wg_wma_decoder = {0x5b4d4e54,0x0620,0x4cf9,{0x94,0xae,0x78,0x23,0x96,0x5c,0x28,0xb6}}; static const GUID CLSID_wg_wmv_decoder = {0x62ee5ddb,0x4f52,0x48e2,{0x89,0x28,0x78,0x7b,0x02,0x53,0xa0,0xbc}}; + static const GUID CLSID_wg_mpeg1_splitter = {0xa8edbf98,0x2442,0x42c5,{0x85,0xa1,0xab,0x05,0xa5,0x80,0xdf,0x53}}; struct class_factory *factory; HRESULT hr;
@@ -1018,7 +1019,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) factory = &mpeg_video_codec_cf; else if (IsEqualGUID(clsid, &CLSID_mpeg_layer3_decoder)) factory = &mpeg_layer3_decoder_cf; - else if (IsEqualGUID(clsid, &CLSID_MPEG1Splitter)) + else if (IsEqualGUID(clsid, &CLSID_wg_mpeg1_splitter)) factory = &mpeg_splitter_cf; else if (IsEqualGUID(clsid, &CLSID_WAVEParser)) factory = &wave_parser_cf; @@ -1198,52 +1199,6 @@ static const REGFILTER2 reg_mpeg_layer3_decoder = .u.s2.rgPins2 = reg_mpeg_layer3_decoder_pins, };
-static const REGPINTYPES reg_mpeg_splitter_sink_mts[4] = -{ - {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1Audio}, - {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1Video}, - {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1System}, - {&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1VideoCD}, -}; - -static const REGPINTYPES reg_mpeg_splitter_audio_mts[2] = -{ - {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Packet}, - {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1AudioPayload}, -}; - -static const REGPINTYPES reg_mpeg_splitter_video_mts[2] = -{ - {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Packet}, - {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Payload}, -}; - -static const REGFILTERPINS2 reg_mpeg_splitter_pins[3] = -{ - { - .nMediaTypes = 4, - .lpMediaType = reg_mpeg_splitter_sink_mts, - }, - { - .dwFlags = REG_PINFLAG_B_ZERO | REG_PINFLAG_B_OUTPUT, - .nMediaTypes = 2, - .lpMediaType = reg_mpeg_splitter_audio_mts, - }, - { - .dwFlags = REG_PINFLAG_B_ZERO | REG_PINFLAG_B_OUTPUT, - .nMediaTypes = 2, - .lpMediaType = reg_mpeg_splitter_video_mts, - }, -}; - -static const REGFILTER2 reg_mpeg_splitter = -{ - .dwVersion = 2, - .dwMerit = MERIT_NORMAL, - .u.s2.cPins2 = 3, - .u.s2.rgPins2 = reg_mpeg_splitter_pins, -}; - static const REGPINTYPES reg_wave_parser_sink_mts[3] = { {&MEDIATYPE_Stream, &MEDIASUBTYPE_WAVE}, @@ -1321,8 +1276,6 @@ HRESULT WINAPI DllRegisterServer(void) L"MPEG Video Decoder", NULL, NULL, NULL, ®_mpeg_video_codec); IFilterMapper2_RegisterFilter(mapper, &CLSID_mpeg_layer3_decoder, L"MPEG Layer-3 Decoder", NULL, NULL, NULL, ®_mpeg_layer3_decoder); - IFilterMapper2_RegisterFilter(mapper, &CLSID_MPEG1Splitter, - L"MPEG-I Stream Splitter", NULL, NULL, NULL, ®_mpeg_splitter); IFilterMapper2_RegisterFilter(mapper, &CLSID_WAVEParser, L"Wave Parser", NULL, NULL, NULL, ®_wave_parser);
IFilterMapper2_Release(mapper); @@ -1349,7 +1302,6 @@ HRESULT WINAPI DllUnregisterServer(void) IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegAudioCodec); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegVideoCodec); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_mpeg_layer3_decoder); - IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_MPEG1Splitter); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_WAVEParser);
IFilterMapper2_Release(mapper); diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index 65d3e3c5c1a..34170690de9 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -50,11 +50,10 @@ coclass CMpegVideoCodec {} coclass mpeg_layer3_decoder {}
[ - helpstring("MPEG-I Stream Splitter"), threading(both), - uuid(336475d0-942a-11ce-a870-00aa002feab5) + uuid(a8edbf98-2442-42c5-85a1-ab05a580df53) ] -coclass MPEG1Splitter {} +coclass wg_mpeg1_splitter {}
[ helpstring("Wave Parser"),
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/quartz/main.c | 34 ++++++++++++++++++++ dlls/quartz/parser.c | 6 ++++ dlls/quartz/quartz_private.h | 3 +- dlls/quartz/quartz_strmif.idl | 7 ++++ dlls/winegstreamer/main.c | 28 ++-------------- dlls/winegstreamer/winegstreamer_classes.idl | 5 ++- 6 files changed, 53 insertions(+), 30 deletions(-)
diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index c05b849835e..747c80378e9 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -65,6 +65,7 @@ static const struct object_creation_info object_creation[] = { &CLSID_AsyncReader, async_reader_create }, { &CLSID_AudioRender, dsound_render_create }, { &CLSID_AVIDec, avi_dec_create }, + { &CLSID_AviSplitter, avi_splitter_create }, { &CLSID_DSoundRender, dsound_render_create }, { &CLSID_FilterGraph, filter_graph_create }, { &CLSID_FilterGraphNoThread, filter_graph_no_thread_create }, @@ -364,6 +365,34 @@ HRESULT WINAPI DllRegisterServer(void) .rgPins2 = mpeg_splitter_pins, };
+ static const REGPINTYPES avi_splitter_inputs[] = + { + {&MEDIATYPE_Stream, &MEDIASUBTYPE_Avi}, + }; + static const REGPINTYPES avi_splitter_outputs[] = + { + {&MEDIATYPE_Video, &GUID_NULL}, + }; + static const REGFILTERPINS2 avi_splitter_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(avi_splitter_inputs), + .lpMediaType = avi_splitter_inputs, + }, + { + .dwFlags = REG_PINFLAG_B_OUTPUT, + .nMediaTypes = ARRAY_SIZE(avi_splitter_outputs), + .lpMediaType = avi_splitter_outputs, + }, + }; + static const REGFILTER2 avi_splitter_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_NORMAL, + .cPins2 = ARRAY_SIZE(avi_splitter_pins), + .rgPins2 = avi_splitter_pins, + }; + IFilterMapper2 *mapper; HRESULT hr;
@@ -394,6 +423,9 @@ HRESULT WINAPI DllRegisterServer(void) if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_ACMWrapper, L"ACM Wrapper", NULL, &CLSID_LegacyAmFilterCategory, NULL, &acm_wrapper_reg))) goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_AviSplitter, L"AVI Splitter", NULL, + NULL, NULL, &avi_splitter_reg))) + goto done; if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_MPEG1Splitter, L"MPEG-I Stream Splitter", NULL, NULL, NULL, &mpeg_splitter_reg))) goto done; @@ -432,6 +464,8 @@ HRESULT WINAPI DllUnregisterServer(void) goto done; if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, &CLSID_LegacyAmFilterCategory, NULL, &CLSID_ACMWrapper))) goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_AviSplitter))) + goto done; if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_MPEG1Splitter))) goto done;
diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index b4ef9e00c01..32ba5d0041a 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -18,6 +18,12 @@
#include "quartz_private.h"
+HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out) +{ + static const GUID CLSID_wg_avi_splitter = {0x272bfbfb,0x50d0,0x4078,{0xb6,0x00,0x1e,0x95,0x9c,0x30,0x13,0x37}}; + return CoCreateInstance(&CLSID_wg_avi_splitter, outer, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)out); +} + HRESULT mpeg1_splitter_create(IUnknown *outer, IUnknown **out) { static const GUID CLSID_wg_mpeg1_splitter = {0xa8edbf98,0x2442,0x42c5,{0x85,0xa1,0xab,0x05,0xa5,0x80,0xdf,0x53}}; diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index c307b493fc0..449db400131 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -49,8 +49,9 @@ #define BYTES_FROM_MEDIATIME(time) ((time) / 10000000)
HRESULT acm_wrapper_create(IUnknown *outer, IUnknown **out); -HRESULT avi_dec_create(IUnknown *outer, IUnknown **out); HRESULT async_reader_create(IUnknown *outer, IUnknown **out); +HRESULT avi_dec_create(IUnknown *outer, IUnknown **out); +HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out); HRESULT dsound_render_create(IUnknown *outer, IUnknown **out); HRESULT filter_graph_create(IUnknown *outer, IUnknown **out); HRESULT filter_graph_no_thread_create(IUnknown *outer, IUnknown **out); diff --git a/dlls/quartz/quartz_strmif.idl b/dlls/quartz/quartz_strmif.idl index bca51a59b31..74158a7fe90 100644 --- a/dlls/quartz/quartz_strmif.idl +++ b/dlls/quartz/quartz_strmif.idl @@ -152,3 +152,10 @@ coclass AllocPresenter {} uuid(336475d0-942a-11ce-a870-00aa002feab5) ] coclass MPEG1Splitter {} + +[ + helpstring("AVI Splitter"), + threading(both), + uuid(1b544c20-fd0b-11ce-8c63-00aa0044b51e) +] +coclass AviSplitter {} diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 6bc37e7e024..c95927cefb4 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -991,6 +991,7 @@ static struct class_factory mpeg4_sink_class_factory_cf = {{&class_factory_vtbl}
HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) { + static const GUID CLSID_wg_avi_splitter = {0x272bfbfb,0x50d0,0x4078,{0xb6,0x00,0x1e,0x95,0x9c,0x30,0x13,0x37}}; static const GUID CLSID_wg_color_converter = {0xf47e2da5,0xe370,0x47b7,{0x90,0x3a,0x07,0x8d,0xdd,0x45,0xa5,0xcc}}; static const GUID CLSID_wg_mp3_sink_factory = {0x1f302877,0xaaab,0x40a3,{0xb9,0xe0,0x9f,0x48,0xda,0xf3,0x5b,0xc8}}; static const GUID CLSID_wg_mpeg4_sink_factory = {0x5d5407d9,0xc6ca,0x4770,{0xa7,0xcc,0x27,0xc0,0xcb,0x8a,0x76,0x27}}; @@ -1009,7 +1010,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) if (SUCCEEDED(hr = mfplat_get_class_object(clsid, iid, out))) return hr;
- if (IsEqualGUID(clsid, &CLSID_AviSplitter)) + if (IsEqualGUID(clsid, &CLSID_wg_avi_splitter)) factory = &avi_splitter_cf; else if (IsEqualGUID(clsid, &CLSID_decodebin_parser)) factory = &decodebin_parser_cf; @@ -1080,29 +1081,6 @@ static const REGPINTYPES reg_audio_mt = {&MEDIATYPE_Audio, &GUID_NULL}; static const REGPINTYPES reg_stream_mt = {&MEDIATYPE_Stream, &GUID_NULL}; static const REGPINTYPES reg_video_mt = {&MEDIATYPE_Video, &GUID_NULL};
-static const REGPINTYPES reg_avi_splitter_sink_mt = {&MEDIATYPE_Stream, &MEDIASUBTYPE_Avi}; - -static const REGFILTERPINS2 reg_avi_splitter_pins[2] = -{ - { - .nMediaTypes = 1, - .lpMediaType = ®_avi_splitter_sink_mt, - }, - { - .dwFlags = REG_PINFLAG_B_OUTPUT, - .nMediaTypes = 1, - .lpMediaType = ®_video_mt, - }, -}; - -static const REGFILTER2 reg_avi_splitter = -{ - .dwVersion = 2, - .dwMerit = MERIT_NORMAL, - .u.s2.cPins2 = 2, - .u.s2.rgPins2 = reg_avi_splitter_pins, -}; - static const REGPINTYPES reg_mpeg_audio_codec_sink_mts[3] = { {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Packet}, @@ -1267,7 +1245,6 @@ HRESULT WINAPI DllRegisterServer(void) &IID_IFilterMapper2, (void **)&mapper))) return hr;
- IFilterMapper2_RegisterFilter(mapper, &CLSID_AviSplitter, L"AVI Splitter", NULL, NULL, NULL, ®_avi_splitter); IFilterMapper2_RegisterFilter(mapper, &CLSID_decodebin_parser, L"GStreamer splitter filter", NULL, NULL, NULL, ®_decodebin_parser); IFilterMapper2_RegisterFilter(mapper, &CLSID_CMpegAudioCodec, @@ -1297,7 +1274,6 @@ HRESULT WINAPI DllUnregisterServer(void) &IID_IFilterMapper2, (void **)&mapper))) return hr;
- IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_AviSplitter); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_decodebin_parser); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegAudioCodec); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegVideoCodec); diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index 34170690de9..665cb9826c4 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -22,11 +22,10 @@ #pragma makedep register
[ - helpstring("AVI Splitter"), threading(both), - uuid(1b544c20-fd0b-11ce-8c63-00aa0044b51e) + uuid(272bfbfb-50d0-4078-b600-1e959c301337) ] -coclass AviSplitter {} +coclass wg_avi_splitter {}
[ helpstring("MPEG Audio Decoder"),
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/quartz/main.c | 36 ++++++++++++++++++++ dlls/quartz/parser.c | 6 ++++ dlls/quartz/quartz_private.h | 1 + dlls/quartz/quartz_strmif.idl | 7 ++++ dlls/winegstreamer/main.c | 32 ++--------------- dlls/winegstreamer/winegstreamer_classes.idl | 5 ++- 6 files changed, 54 insertions(+), 33 deletions(-)
diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 747c80378e9..57b60445d6d 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -79,6 +79,7 @@ static const struct object_creation_info object_creation[] = { &CLSID_VideoMixingRenderer, vmr7_create }, { &CLSID_VideoMixingRenderer9, vmr9_create }, { &CLSID_VideoRendererDefault, video_renderer_default_create }, + { &CLSID_WAVEParser, wave_parser_create }, };
static HRESULT WINAPI DSCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj) @@ -393,6 +394,36 @@ HRESULT WINAPI DllRegisterServer(void) .rgPins2 = avi_splitter_pins, };
+ static const REGPINTYPES wave_parser_inputs[] = + { + {&MEDIATYPE_Stream, &MEDIASUBTYPE_WAVE}, + {&MEDIATYPE_Stream, &MEDIASUBTYPE_AU}, + {&MEDIATYPE_Stream, &MEDIASUBTYPE_AIFF}, + }; + static const REGPINTYPES wave_parser_outputs[] = + { + {&MEDIATYPE_Audio, &GUID_NULL}, + }; + static const REGFILTERPINS2 wave_parser_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(wave_parser_inputs), + .lpMediaType = wave_parser_inputs, + }, + { + .dwFlags = REG_PINFLAG_B_OUTPUT, + .nMediaTypes = ARRAY_SIZE(wave_parser_outputs), + .lpMediaType = wave_parser_outputs, + }, + }; + static const REGFILTER2 wave_parser_reg = + { + .dwVersion = 2, + .dwMerit = MERIT_UNLIKELY, + .cPins2 = ARRAY_SIZE(wave_parser_pins), + .rgPins2 = wave_parser_pins, + }; + IFilterMapper2 *mapper; HRESULT hr;
@@ -429,6 +460,9 @@ HRESULT WINAPI DllRegisterServer(void) if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_MPEG1Splitter, L"MPEG-I Stream Splitter", NULL, NULL, NULL, &mpeg_splitter_reg))) goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_WAVEParser, L"Wave Parser", NULL, + NULL, NULL, &wave_parser_reg))) + goto done;
done: IFilterMapper2_Release(mapper); @@ -468,6 +502,8 @@ HRESULT WINAPI DllUnregisterServer(void) goto done; if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_MPEG1Splitter))) goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_WAVEParser))) + goto done;
done: IFilterMapper2_Release(mapper); diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 32ba5d0041a..aa325f5e656 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -29,3 +29,9 @@ HRESULT mpeg1_splitter_create(IUnknown *outer, IUnknown **out) static const GUID CLSID_wg_mpeg1_splitter = {0xa8edbf98,0x2442,0x42c5,{0x85,0xa1,0xab,0x05,0xa5,0x80,0xdf,0x53}}; return CoCreateInstance(&CLSID_wg_mpeg1_splitter, outer, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)out); } + +HRESULT wave_parser_create(IUnknown *outer, IUnknown **out) +{ + static const GUID CLSID_wg_wave_parser = {0x3f839ec7,0x5ea6,0x49e1,{0x80,0xc2,0x1e,0xa3,0x00,0xf8,0xb0,0xe0}}; + return CoCreateInstance(&CLSID_wg_wave_parser, outer, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)out); +} diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index 449db400131..5925fc80620 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -65,6 +65,7 @@ HRESULT video_renderer_default_create(IUnknown *outer, IUnknown **out); HRESULT vmr7_presenter_create(IUnknown *outer, IUnknown **out); HRESULT vmr7_create(IUnknown *outer, IUnknown **out); HRESULT vmr9_create(IUnknown *outer, IUnknown **out); +HRESULT wave_parser_create(IUnknown *outer, IUnknown **out);
extern const char * qzdebugstr_guid(const GUID * id); extern void video_unregister_windowclass(void); diff --git a/dlls/quartz/quartz_strmif.idl b/dlls/quartz/quartz_strmif.idl index 74158a7fe90..4ea198c5ea0 100644 --- a/dlls/quartz/quartz_strmif.idl +++ b/dlls/quartz/quartz_strmif.idl @@ -159,3 +159,10 @@ coclass MPEG1Splitter {} uuid(1b544c20-fd0b-11ce-8c63-00aa0044b51e) ] coclass AviSplitter {} + +[ + helpstring("Wave Parser"), + threading(both), + uuid(d51bd5a1-7548-11cf-a520-0080c77ef58a) +] +coclass WAVEParser {} diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index c95927cefb4..33cd3439f62 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -999,6 +999,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) static const GUID CLSID_wg_wma_decoder = {0x5b4d4e54,0x0620,0x4cf9,{0x94,0xae,0x78,0x23,0x96,0x5c,0x28,0xb6}}; static const GUID CLSID_wg_wmv_decoder = {0x62ee5ddb,0x4f52,0x48e2,{0x89,0x28,0x78,0x7b,0x02,0x53,0xa0,0xbc}}; static const GUID CLSID_wg_mpeg1_splitter = {0xa8edbf98,0x2442,0x42c5,{0x85,0xa1,0xab,0x05,0xa5,0x80,0xdf,0x53}}; + static const GUID CLSID_wg_wave_parser = {0x3f839ec7,0x5ea6,0x49e1,{0x80,0xc2,0x1e,0xa3,0x00,0xf8,0xb0,0xe0}}; struct class_factory *factory; HRESULT hr;
@@ -1022,7 +1023,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) factory = &mpeg_layer3_decoder_cf; else if (IsEqualGUID(clsid, &CLSID_wg_mpeg1_splitter)) factory = &mpeg_splitter_cf; - else if (IsEqualGUID(clsid, &CLSID_WAVEParser)) + else if (IsEqualGUID(clsid, &CLSID_wg_wave_parser)) factory = &wave_parser_cf; else if (IsEqualGUID(clsid, &CLSID_wg_wma_decoder)) factory = &wma_decoder_cf; @@ -1177,33 +1178,6 @@ static const REGFILTER2 reg_mpeg_layer3_decoder = .u.s2.rgPins2 = reg_mpeg_layer3_decoder_pins, };
-static const REGPINTYPES reg_wave_parser_sink_mts[3] = -{ - {&MEDIATYPE_Stream, &MEDIASUBTYPE_WAVE}, - {&MEDIATYPE_Stream, &MEDIASUBTYPE_AU}, - {&MEDIATYPE_Stream, &MEDIASUBTYPE_AIFF}, -}; - -static const REGFILTERPINS2 reg_wave_parser_pins[2] = -{ - { - .nMediaTypes = 3, - .lpMediaType = reg_wave_parser_sink_mts, - }, - { - .dwFlags = REG_PINFLAG_B_OUTPUT, - .nMediaTypes = 1, - .lpMediaType = ®_audio_mt, - }, -}; - -static const REGFILTER2 reg_wave_parser = -{ - .dwVersion = 2, - .dwMerit = MERIT_UNLIKELY, - .u.s2.cPins2 = 2, - .u.s2.rgPins2 = reg_wave_parser_pins, -};
static const REGFILTERPINS2 reg_decodebin_parser_pins[3] = { @@ -1253,7 +1227,6 @@ HRESULT WINAPI DllRegisterServer(void) L"MPEG Video Decoder", NULL, NULL, NULL, ®_mpeg_video_codec); IFilterMapper2_RegisterFilter(mapper, &CLSID_mpeg_layer3_decoder, L"MPEG Layer-3 Decoder", NULL, NULL, NULL, ®_mpeg_layer3_decoder); - IFilterMapper2_RegisterFilter(mapper, &CLSID_WAVEParser, L"Wave Parser", NULL, NULL, NULL, ®_wave_parser);
IFilterMapper2_Release(mapper);
@@ -1278,7 +1251,6 @@ HRESULT WINAPI DllUnregisterServer(void) IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegAudioCodec); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegVideoCodec); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_mpeg_layer3_decoder); - IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_WAVEParser);
IFilterMapper2_Release(mapper);
diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index 665cb9826c4..f34cf998288 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -55,11 +55,10 @@ coclass mpeg_layer3_decoder {} coclass wg_mpeg1_splitter {}
[ - helpstring("Wave Parser"), threading(both), - uuid(d51bd5a1-7548-11cf-a520-0080c77ef58a) + uuid(3f839ec7-5ea6-49e1-80c2-1ea300f8b0e0) ] -coclass WAVEParser {} +coclass wg_wave_parser {}
[ helpstring("GStreamer parser using decodebin"),
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/quartz/Makefile.in | 1 + dlls/quartz/decoder.c | 25 +++++++++++++ dlls/quartz/main.c | 36 ++++++++++++++++++ dlls/quartz/quartz_private.h | 1 + dlls/quartz/quartz_strmif.idl | 7 ++++ dlls/winegstreamer/main.c | 39 +------------------- dlls/winegstreamer/winegstreamer_classes.idl | 5 +-- 7 files changed, 74 insertions(+), 40 deletions(-) create mode 100644 dlls/quartz/decoder.c
diff --git a/dlls/quartz/Makefile.in b/dlls/quartz/Makefile.in index d1bd73db9be..6eeeac9a723 100644 --- a/dlls/quartz/Makefile.in +++ b/dlls/quartz/Makefile.in @@ -7,6 +7,7 @@ SOURCES = \ acmwrapper.c \ avidec.c \ control_tlb.idl \ + decoder.c \ dsoundrender.c \ filesource.c \ filtergraph.c \ diff --git a/dlls/quartz/decoder.c b/dlls/quartz/decoder.c new file mode 100644 index 00000000000..2a80db5d3d5 --- /dev/null +++ b/dlls/quartz/decoder.c @@ -0,0 +1,25 @@ +/* + * Copyright 2024 Rémi Bernon 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 "quartz_private.h" + +HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out) +{ + static const GUID CLSID_wg_mpeg_audio_decoder = {0xc9f285f8,0x4380,0x4121,{0x97,0x1f,0x49,0xa9,0x53,0x16,0xc2,0x7b}}; + return CoCreateInstance(&CLSID_wg_mpeg_audio_decoder, outer, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)out); +} diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 57b60445d6d..126b447cfa7 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -66,6 +66,7 @@ static const struct object_creation_info object_creation[] = { &CLSID_AudioRender, dsound_render_create }, { &CLSID_AVIDec, avi_dec_create }, { &CLSID_AviSplitter, avi_splitter_create }, + { &CLSID_CMpegAudioCodec, mpeg_audio_codec_create }, { &CLSID_DSoundRender, dsound_render_create }, { &CLSID_FilterGraph, filter_graph_create }, { &CLSID_FilterGraphNoThread, filter_graph_no_thread_create }, @@ -424,6 +425,36 @@ HRESULT WINAPI DllRegisterServer(void) .rgPins2 = wave_parser_pins, };
+ static const REGPINTYPES mpeg_audio_codec_inputs[] = + { + {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Packet}, + {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Payload}, + {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1AudioPayload}, + }; + static const REGPINTYPES mpeg_audio_codec_outputs[] = + { + {&MEDIATYPE_Audio, &MEDIASUBTYPE_PCM}, + }; + static const REGFILTERPINS2 mpeg_audio_codec_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(mpeg_audio_codec_inputs), + .lpMediaType = mpeg_audio_codec_inputs, + }, + { + .dwFlags = REG_PINFLAG_B_OUTPUT, + .nMediaTypes = ARRAY_SIZE(mpeg_audio_codec_outputs), + .lpMediaType = mpeg_audio_codec_outputs, + }, + }; + static const REGFILTER2 mpeg_audio_codec_reg = + { + .dwVersion = 2, + .dwMerit = 0x03680001, + .cPins2 = ARRAY_SIZE(mpeg_audio_codec_pins), + .rgPins2 = mpeg_audio_codec_pins, + }; + IFilterMapper2 *mapper; HRESULT hr;
@@ -463,6 +494,9 @@ HRESULT WINAPI DllRegisterServer(void) if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_WAVEParser, L"Wave Parser", NULL, NULL, NULL, &wave_parser_reg))) goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_CMpegAudioCodec, L"MPEG Audio Decoder", NULL, + NULL, NULL, &mpeg_audio_codec_reg))) + goto done;
done: IFilterMapper2_Release(mapper); @@ -504,6 +538,8 @@ HRESULT WINAPI DllUnregisterServer(void) goto done; if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_WAVEParser))) goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegAudioCodec))) + goto done;
done: IFilterMapper2_Release(mapper); diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index 5925fc80620..c4ebf0802ad 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -57,6 +57,7 @@ HRESULT filter_graph_create(IUnknown *outer, IUnknown **out); HRESULT filter_graph_no_thread_create(IUnknown *outer, IUnknown **out); HRESULT filter_mapper_create(IUnknown *outer, IUnknown **out); HRESULT mem_allocator_create(IUnknown *outer, IUnknown **out); +HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out); HRESULT mpeg1_splitter_create(IUnknown *outer, IUnknown **out); HRESULT system_clock_create(IUnknown *outer, IUnknown **out); HRESULT seeking_passthrough_create(IUnknown *outer, IUnknown **out); diff --git a/dlls/quartz/quartz_strmif.idl b/dlls/quartz/quartz_strmif.idl index 4ea198c5ea0..b39ac041662 100644 --- a/dlls/quartz/quartz_strmif.idl +++ b/dlls/quartz/quartz_strmif.idl @@ -166,3 +166,10 @@ coclass AviSplitter {} uuid(d51bd5a1-7548-11cf-a520-0080c77ef58a) ] coclass WAVEParser {} + +[ + helpstring("MPEG Audio Decoder"), + threading(both), + uuid(4a2286e0-7bef-11ce-9bd9-0000e202599c) +] +coclass CMpegAudioCodec {} diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 33cd3439f62..6e0ce7284ea 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -995,6 +995,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) static const GUID CLSID_wg_color_converter = {0xf47e2da5,0xe370,0x47b7,{0x90,0x3a,0x07,0x8d,0xdd,0x45,0xa5,0xcc}}; static const GUID CLSID_wg_mp3_sink_factory = {0x1f302877,0xaaab,0x40a3,{0xb9,0xe0,0x9f,0x48,0xda,0xf3,0x5b,0xc8}}; static const GUID CLSID_wg_mpeg4_sink_factory = {0x5d5407d9,0xc6ca,0x4770,{0xa7,0xcc,0x27,0xc0,0xcb,0x8a,0x76,0x27}}; + static const GUID CLSID_wg_mpeg_audio_decoder = {0xc9f285f8,0x4380,0x4121,{0x97,0x1f,0x49,0xa9,0x53,0x16,0xc2,0x7b}}; static const GUID CLSID_wg_resampler = {0x92f35e78,0x15a5,0x486b,{0x88,0x8e,0x57,0x5f,0x99,0x65,0x1c,0xe2}}; static const GUID CLSID_wg_wma_decoder = {0x5b4d4e54,0x0620,0x4cf9,{0x94,0xae,0x78,0x23,0x96,0x5c,0x28,0xb6}}; static const GUID CLSID_wg_wmv_decoder = {0x62ee5ddb,0x4f52,0x48e2,{0x89,0x28,0x78,0x7b,0x02,0x53,0xa0,0xbc}}; @@ -1015,7 +1016,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) factory = &avi_splitter_cf; else if (IsEqualGUID(clsid, &CLSID_decodebin_parser)) factory = &decodebin_parser_cf; - else if (IsEqualGUID(clsid, &CLSID_CMpegAudioCodec)) + else if (IsEqualGUID(clsid, &CLSID_wg_mpeg_audio_decoder)) factory = &mpeg_audio_codec_cf; else if (IsEqualGUID(clsid, &CLSID_CMpegVideoCodec)) factory = &mpeg_video_codec_cf; @@ -1082,39 +1083,6 @@ static const REGPINTYPES reg_audio_mt = {&MEDIATYPE_Audio, &GUID_NULL}; static const REGPINTYPES reg_stream_mt = {&MEDIATYPE_Stream, &GUID_NULL}; static const REGPINTYPES reg_video_mt = {&MEDIATYPE_Video, &GUID_NULL};
-static const REGPINTYPES reg_mpeg_audio_codec_sink_mts[3] = -{ - {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Packet}, - {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Payload}, - {&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1AudioPayload}, -}; - -static const REGPINTYPES reg_mpeg_audio_codec_source_mts[1] = -{ - {&MEDIATYPE_Audio, &MEDIASUBTYPE_PCM}, -}; - -static const REGFILTERPINS2 reg_mpeg_audio_codec_pins[2] = -{ - { - .nMediaTypes = 3, - .lpMediaType = reg_mpeg_audio_codec_sink_mts, - }, - { - .dwFlags = REG_PINFLAG_B_OUTPUT, - .nMediaTypes = 1, - .lpMediaType = reg_mpeg_audio_codec_source_mts, - }, -}; - -static const REGFILTER2 reg_mpeg_audio_codec = -{ - .dwVersion = 2, - .dwMerit = 0x03680001, - .u.s2.cPins2 = 2, - .u.s2.rgPins2 = reg_mpeg_audio_codec_pins, -}; - static const REGPINTYPES reg_mpeg_video_codec_sink_mts[2] = { {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Packet}, @@ -1221,8 +1189,6 @@ HRESULT WINAPI DllRegisterServer(void)
IFilterMapper2_RegisterFilter(mapper, &CLSID_decodebin_parser, L"GStreamer splitter filter", NULL, NULL, NULL, ®_decodebin_parser); - IFilterMapper2_RegisterFilter(mapper, &CLSID_CMpegAudioCodec, - L"MPEG Audio Decoder", NULL, NULL, NULL, ®_mpeg_audio_codec); IFilterMapper2_RegisterFilter(mapper, &CLSID_CMpegVideoCodec, L"MPEG Video Decoder", NULL, NULL, NULL, ®_mpeg_video_codec); IFilterMapper2_RegisterFilter(mapper, &CLSID_mpeg_layer3_decoder, @@ -1248,7 +1214,6 @@ HRESULT WINAPI DllUnregisterServer(void) return hr;
IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_decodebin_parser); - IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegAudioCodec); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegVideoCodec); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_mpeg_layer3_decoder);
diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index f34cf998288..821f7db3763 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -28,11 +28,10 @@ coclass wg_avi_splitter {}
[ - helpstring("MPEG Audio Decoder"), threading(both), - uuid(4a2286e0-7bef-11ce-9bd9-0000e202599c) + uuid(c9f285f8-4380-4121-971f-49a95316c27b) ] -coclass CMpegAudioCodec {} +coclass wg_mpeg_audio_decoder {}
[ helpstring("MPEG Video Decoder"),
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/quartz/decoder.c | 6 ++++ dlls/quartz/main.c | 35 ++++++++++++++++++ dlls/quartz/quartz_private.h | 1 + dlls/quartz/quartz_strmif.idl | 7 ++++ dlls/winegstreamer/main.c | 38 ++------------------ dlls/winegstreamer/winegstreamer_classes.idl | 5 ++- 6 files changed, 53 insertions(+), 39 deletions(-)
diff --git a/dlls/quartz/decoder.c b/dlls/quartz/decoder.c index 2a80db5d3d5..31fcdf25bb8 100644 --- a/dlls/quartz/decoder.c +++ b/dlls/quartz/decoder.c @@ -23,3 +23,9 @@ HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out) static const GUID CLSID_wg_mpeg_audio_decoder = {0xc9f285f8,0x4380,0x4121,{0x97,0x1f,0x49,0xa9,0x53,0x16,0xc2,0x7b}}; return CoCreateInstance(&CLSID_wg_mpeg_audio_decoder, outer, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)out); } + +HRESULT mpeg_video_codec_create(IUnknown *outer, IUnknown **out) +{ + static const GUID CLSID_wg_mpeg_video_decoder = {0x5ed2e5f6,0xbf3e,0x4180,{0x83,0xa4,0x48,0x47,0xcc,0x5b,0x4e,0xa3}}; + return CoCreateInstance(&CLSID_wg_mpeg_video_decoder, outer, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)out); +} diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 126b447cfa7..584f3429908 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -67,6 +67,7 @@ static const struct object_creation_info object_creation[] = { &CLSID_AVIDec, avi_dec_create }, { &CLSID_AviSplitter, avi_splitter_create }, { &CLSID_CMpegAudioCodec, mpeg_audio_codec_create }, + { &CLSID_CMpegVideoCodec, mpeg_video_codec_create }, { &CLSID_DSoundRender, dsound_render_create }, { &CLSID_FilterGraph, filter_graph_create }, { &CLSID_FilterGraphNoThread, filter_graph_no_thread_create }, @@ -455,6 +456,35 @@ HRESULT WINAPI DllRegisterServer(void) .rgPins2 = mpeg_audio_codec_pins, };
+ static const REGPINTYPES mpeg_video_codec_inputs[] = + { + {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Packet}, + {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Payload}, + }; + static const REGPINTYPES mpeg_video_codec_outputs[] = + { + {&MEDIATYPE_Video, &GUID_NULL}, + }; + static const REGFILTERPINS2 mpeg_video_codec_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(mpeg_video_codec_inputs), + .lpMediaType = mpeg_video_codec_inputs, + }, + { + .dwFlags = REG_PINFLAG_B_OUTPUT, + .nMediaTypes = ARRAY_SIZE(mpeg_video_codec_outputs), + .lpMediaType = mpeg_video_codec_outputs, + }, + }; + static const REGFILTER2 mpeg_video_codec_reg = + { + .dwVersion = 2, + .dwMerit = 0x40000001, + .cPins2 = ARRAY_SIZE(mpeg_video_codec_pins), + .rgPins2 = mpeg_video_codec_pins, + }; + IFilterMapper2 *mapper; HRESULT hr;
@@ -497,6 +527,9 @@ HRESULT WINAPI DllRegisterServer(void) if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_CMpegAudioCodec, L"MPEG Audio Decoder", NULL, NULL, NULL, &mpeg_audio_codec_reg))) goto done; + if (FAILED(hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_CMpegVideoCodec, L"MPEG Video Decoder", NULL, + NULL, NULL, &mpeg_video_codec_reg))) + goto done;
done: IFilterMapper2_Release(mapper); @@ -540,6 +573,8 @@ HRESULT WINAPI DllUnregisterServer(void) goto done; if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegAudioCodec))) goto done; + if (FAILED(hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegVideoCodec))) + goto done;
done: IFilterMapper2_Release(mapper); diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index c4ebf0802ad..6df189d5520 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -58,6 +58,7 @@ HRESULT filter_graph_no_thread_create(IUnknown *outer, IUnknown **out); HRESULT filter_mapper_create(IUnknown *outer, IUnknown **out); HRESULT mem_allocator_create(IUnknown *outer, IUnknown **out); HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out); +HRESULT mpeg_video_codec_create(IUnknown *outer, IUnknown **out); HRESULT mpeg1_splitter_create(IUnknown *outer, IUnknown **out); HRESULT system_clock_create(IUnknown *outer, IUnknown **out); HRESULT seeking_passthrough_create(IUnknown *outer, IUnknown **out); diff --git a/dlls/quartz/quartz_strmif.idl b/dlls/quartz/quartz_strmif.idl index b39ac041662..ad63352ff07 100644 --- a/dlls/quartz/quartz_strmif.idl +++ b/dlls/quartz/quartz_strmif.idl @@ -173,3 +173,10 @@ coclass WAVEParser {} uuid(4a2286e0-7bef-11ce-9bd9-0000e202599c) ] coclass CMpegAudioCodec {} + +[ + helpstring("MPEG Video Decoder"), + threading(both), + uuid(feb50740-7bef-11ce-9bd9-0000e202599c) +] +coclass CMpegVideoCodec {} diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 6e0ce7284ea..5822723722d 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -996,6 +996,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) static const GUID CLSID_wg_mp3_sink_factory = {0x1f302877,0xaaab,0x40a3,{0xb9,0xe0,0x9f,0x48,0xda,0xf3,0x5b,0xc8}}; static const GUID CLSID_wg_mpeg4_sink_factory = {0x5d5407d9,0xc6ca,0x4770,{0xa7,0xcc,0x27,0xc0,0xcb,0x8a,0x76,0x27}}; static const GUID CLSID_wg_mpeg_audio_decoder = {0xc9f285f8,0x4380,0x4121,{0x97,0x1f,0x49,0xa9,0x53,0x16,0xc2,0x7b}}; + static const GUID CLSID_wg_mpeg_video_decoder = {0x5ed2e5f6,0xbf3e,0x4180,{0x83,0xa4,0x48,0x47,0xcc,0x5b,0x4e,0xa3}}; static const GUID CLSID_wg_resampler = {0x92f35e78,0x15a5,0x486b,{0x88,0x8e,0x57,0x5f,0x99,0x65,0x1c,0xe2}}; static const GUID CLSID_wg_wma_decoder = {0x5b4d4e54,0x0620,0x4cf9,{0x94,0xae,0x78,0x23,0x96,0x5c,0x28,0xb6}}; static const GUID CLSID_wg_wmv_decoder = {0x62ee5ddb,0x4f52,0x48e2,{0x89,0x28,0x78,0x7b,0x02,0x53,0xa0,0xbc}}; @@ -1018,7 +1019,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) factory = &decodebin_parser_cf; else if (IsEqualGUID(clsid, &CLSID_wg_mpeg_audio_decoder)) factory = &mpeg_audio_codec_cf; - else if (IsEqualGUID(clsid, &CLSID_CMpegVideoCodec)) + else if (IsEqualGUID(clsid, &CLSID_wg_mpeg_video_decoder)) factory = &mpeg_video_codec_cf; else if (IsEqualGUID(clsid, &CLSID_mpeg_layer3_decoder)) factory = &mpeg_layer3_decoder_cf; @@ -1083,38 +1084,6 @@ static const REGPINTYPES reg_audio_mt = {&MEDIATYPE_Audio, &GUID_NULL}; static const REGPINTYPES reg_stream_mt = {&MEDIATYPE_Stream, &GUID_NULL}; static const REGPINTYPES reg_video_mt = {&MEDIATYPE_Video, &GUID_NULL};
-static const REGPINTYPES reg_mpeg_video_codec_sink_mts[2] = -{ - {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Packet}, - {&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Payload}, -}; - -static const REGPINTYPES reg_mpeg_video_codec_source_mts[1] = -{ - {&MEDIATYPE_Video, &GUID_NULL}, -}; - -static const REGFILTERPINS2 reg_mpeg_video_codec_pins[2] = -{ - { - .nMediaTypes = 2, - .lpMediaType = reg_mpeg_video_codec_sink_mts, - }, - { - .dwFlags = REG_PINFLAG_B_OUTPUT, - .nMediaTypes = 1, - .lpMediaType = reg_mpeg_video_codec_source_mts, - }, -}; - -static const REGFILTER2 reg_mpeg_video_codec = -{ - .dwVersion = 2, - .dwMerit = 0x40000001, - .u.s2.cPins2 = 2, - .u.s2.rgPins2 = reg_mpeg_video_codec_pins, -}; - static const REGPINTYPES reg_mpeg_layer3_decoder_sink_mts[1] = { {&MEDIATYPE_Audio, &MEDIASUBTYPE_MP3}, @@ -1189,8 +1158,6 @@ HRESULT WINAPI DllRegisterServer(void)
IFilterMapper2_RegisterFilter(mapper, &CLSID_decodebin_parser, L"GStreamer splitter filter", NULL, NULL, NULL, ®_decodebin_parser); - IFilterMapper2_RegisterFilter(mapper, &CLSID_CMpegVideoCodec, - L"MPEG Video Decoder", NULL, NULL, NULL, ®_mpeg_video_codec); IFilterMapper2_RegisterFilter(mapper, &CLSID_mpeg_layer3_decoder, L"MPEG Layer-3 Decoder", NULL, NULL, NULL, ®_mpeg_layer3_decoder);
@@ -1214,7 +1181,6 @@ HRESULT WINAPI DllUnregisterServer(void) return hr;
IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_decodebin_parser); - IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_CMpegVideoCodec); IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_mpeg_layer3_decoder);
IFilterMapper2_Release(mapper); diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index 821f7db3763..1438f9d663c 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -34,11 +34,10 @@ coclass wg_avi_splitter {} coclass wg_mpeg_audio_decoder {}
[ - helpstring("MPEG Video Decoder"), threading(both), - uuid(feb50740-7bef-11ce-9bd9-0000e202599c) + uuid(5ed2e5f6-bf3e-4180-83a4-4847cc5b4ea3) ] -coclass CMpegVideoCodec {} +coclass wg_mpeg_video_decoder {}
[ helpstring("MPEG Layer-3 Decoder"),
From: Rémi Bernon rbernon@codeweavers.com
--- configure.ac | 1 + dlls/l3codecx.ax/Makefile.in | 6 + dlls/l3codecx.ax/l3codecx.ax.spec | 3 + dlls/l3codecx.ax/l3codecx.c | 156 +++++++++++++++++++ dlls/l3codecx.ax/l3codecx.idl | 26 ++++ dlls/quartz/quartz_private.h | 1 + dlls/winegstreamer/main.c | 40 +---- dlls/winegstreamer/winegstreamer_classes.idl | 5 +- loader/wine.inf.in | 1 + 9 files changed, 198 insertions(+), 41 deletions(-) create mode 100644 dlls/l3codecx.ax/Makefile.in create mode 100644 dlls/l3codecx.ax/l3codecx.ax.spec create mode 100644 dlls/l3codecx.ax/l3codecx.c create mode 100644 dlls/l3codecx.ax/l3codecx.idl
diff --git a/configure.ac b/configure.ac index 4dcb780013a..be0b9d3a930 100644 --- a/configure.ac +++ b/configure.ac @@ -2785,6 +2785,7 @@ WINE_CONFIG_MAKEFILE(dlls/ksproxy.ax) WINE_CONFIG_MAKEFILE(dlls/ksuser) WINE_CONFIG_MAKEFILE(dlls/ktmw32) WINE_CONFIG_MAKEFILE(dlls/l3codeca.acm) +WINE_CONFIG_MAKEFILE(dlls/l3codecx.ax) WINE_CONFIG_MAKEFILE(dlls/light.msstyles) WINE_CONFIG_MAKEFILE(dlls/loadperf) WINE_CONFIG_MAKEFILE(dlls/localspl) diff --git a/dlls/l3codecx.ax/Makefile.in b/dlls/l3codecx.ax/Makefile.in new file mode 100644 index 00000000000..85fdd96fad1 --- /dev/null +++ b/dlls/l3codecx.ax/Makefile.in @@ -0,0 +1,6 @@ +MODULE = l3codecx.ax +IMPORTS = combase msdmo dmoguids strmiids wmcodecdspuuid uuid + +SOURCES = \ + l3codecx.c \ + l3codecx.idl diff --git a/dlls/l3codecx.ax/l3codecx.ax.spec b/dlls/l3codecx.ax/l3codecx.ax.spec new file mode 100644 index 00000000000..b717c9c9371 --- /dev/null +++ b/dlls/l3codecx.ax/l3codecx.ax.spec @@ -0,0 +1,3 @@ +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/dlls/l3codecx.ax/l3codecx.c b/dlls/l3codecx.ax/l3codecx.c new file mode 100644 index 00000000000..6ebf80e2cc6 --- /dev/null +++ b/dlls/l3codecx.ax/l3codecx.c @@ -0,0 +1,156 @@ +/* + * Copyright 2024 Rémi Bernon 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 <stdarg.h> +#include <stddef.h> + +#define COBJMACROS +#include "windef.h" +#include "winbase.h" + +#include "dshow.h" +#include "mpegtype.h" +#include "rpcproxy.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(quartz); + +#include "initguid.h" + +DEFINE_GUID(CLSID_MPEGLayer3Decoder,0x38be3000,0xdbf4,0x11d0,0x86,0x0e,0x00,0xa0,0x24,0xcf,0xef,0x6d); +DEFINE_GUID(MEDIASUBTYPE_MP3,WAVE_FORMAT_MPEGLAYER3,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71); + +static inline HRESULT WINAPI class_factory_QueryInterface(IClassFactory *iface, REFIID riid, void **out) +{ + *out = IsEqualGUID(riid, &IID_IClassFactory) || IsEqualGUID(riid, &IID_IUnknown) ? iface : NULL; + return *out ? S_OK : E_NOINTERFACE; +} +static inline ULONG WINAPI class_factory_AddRef(IClassFactory *iface) +{ + return 2; +} +static inline ULONG WINAPI class_factory_Release(IClassFactory *iface) +{ + return 1; +} +static HRESULT WINAPI mpeg_layer3_decoder_factory_CreateInstance(IClassFactory *iface, + IUnknown *outer, REFIID riid, void **out) +{ + static const GUID CLSID_wg_mp3_decoder = {0x84cd8e3e,0xb221,0x434a,{0x88,0x82,0x9d,0x6c,0x8d,0xf4,0x90,0xe1}}; + return CoCreateInstance(&CLSID_wg_mp3_decoder, outer, CLSCTX_INPROC_SERVER, riid, out); +} +static inline HRESULT WINAPI class_factory_LockServer(IClassFactory *iface, BOOL dolock) +{ + return S_OK; +} + +static const IClassFactoryVtbl mpeg_layer3_decoder_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + mpeg_layer3_decoder_factory_CreateInstance, + class_factory_LockServer, +}; + +static IClassFactory mpeg_layer3_decoder_factory = {&mpeg_layer3_decoder_factory_vtbl}; + +/*********************************************************************** + * DllGetClassObject (l3codecx.@) + */ +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) +{ + if (IsEqualGUID(clsid, &CLSID_MPEGLayer3Decoder)) + return IClassFactory_QueryInterface(&mpeg_layer3_decoder_factory, iid, out); + + *out = NULL; + FIXME("Unknown clsid %s.\n", debugstr_guid(clsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * DllRegisterServer (l3codecx.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + static const REGPINTYPES mpeg_layer3_decoder_inputs[] = + { + {&MEDIATYPE_Audio, &MEDIASUBTYPE_MP3}, + }; + static const REGPINTYPES mpeg_layer3_decoder_outputs[] = + { + {&MEDIATYPE_Audio, &MEDIASUBTYPE_PCM}, + }; + static const REGFILTERPINS2 mpeg_layer3_decoder_pins[] = + { + { + .nMediaTypes = ARRAY_SIZE(mpeg_layer3_decoder_inputs), + .lpMediaType = mpeg_layer3_decoder_inputs, + }, + { + .dwFlags = REG_PINFLAG_B_OUTPUT, + .nMediaTypes = ARRAY_SIZE(mpeg_layer3_decoder_outputs), + .lpMediaType = mpeg_layer3_decoder_outputs, + }, + }; + static const REGFILTER2 mpeg_layer3_decoder_desc = + { + .dwVersion = 2, + .dwMerit = 0x00810000, + .cPins2 = ARRAY_SIZE(mpeg_layer3_decoder_pins), + .rgPins2 = mpeg_layer3_decoder_pins, + }; + + IFilterMapper2 *mapper; + HRESULT hr; + + TRACE(".\n"); + + if (FAILED(hr = __wine_register_resources())) + return hr; + + if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterMapper2, (void **)&mapper))) + return hr; + hr = IFilterMapper2_RegisterFilter(mapper, &CLSID_MPEGLayer3Decoder, L"MPEG Layer-3 Decoder", NULL, + NULL, NULL, &mpeg_layer3_decoder_desc); + IFilterMapper2_Release(mapper); + return hr; +} + +/*********************************************************************** + * DllUnregisterServer (l3codecx.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + IFilterMapper2 *mapper; + HRESULT hr; + + TRACE(".\n"); + + if (FAILED(hr = __wine_unregister_resources())) + return hr; + + if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterMapper2, (void **)&mapper))) + return hr; + hr = IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_MPEGLayer3Decoder); + IFilterMapper2_Release(mapper); + return S_OK; +} diff --git a/dlls/l3codecx.ax/l3codecx.idl b/dlls/l3codecx.ax/l3codecx.idl new file mode 100644 index 00000000000..22f5a5f285d --- /dev/null +++ b/dlls/l3codecx.ax/l3codecx.idl @@ -0,0 +1,26 @@ +/* + * Copyright 2024 Rémi Bernon 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 + */ + +#pragma makedep register + +[ + helpstring("MPEG Layer-3 Decoder"), + threading(both), + uuid(38be3000-dbf4-11d0-860e-00a024cfef6d) +] +coclass MPEGLayer3Decoder {} diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index 6df189d5520..e219ed01583 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -58,6 +58,7 @@ HRESULT filter_graph_no_thread_create(IUnknown *outer, IUnknown **out); HRESULT filter_mapper_create(IUnknown *outer, IUnknown **out); HRESULT mem_allocator_create(IUnknown *outer, IUnknown **out); HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out); +HRESULT mpeg_layer3_decoder_create(IUnknown *outer, IUnknown **out); HRESULT mpeg_video_codec_create(IUnknown *outer, IUnknown **out); HRESULT mpeg1_splitter_create(IUnknown *outer, IUnknown **out); HRESULT system_clock_create(IUnknown *outer, IUnknown **out); diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 5822723722d..d18db8b21e8 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -41,8 +41,6 @@ WINE_DECLARE_DEBUG_CHANNEL(wmvcore); DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); DEFINE_GUID(MEDIASUBTYPE_VC1S,MAKEFOURCC('V','C','1','S'),0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71);
-static const GUID MEDIASUBTYPE_MP3 = {0x00000055, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; - bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size) { unsigned int new_capacity, max_capacity; @@ -1000,6 +998,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) static const GUID CLSID_wg_resampler = {0x92f35e78,0x15a5,0x486b,{0x88,0x8e,0x57,0x5f,0x99,0x65,0x1c,0xe2}}; static const GUID CLSID_wg_wma_decoder = {0x5b4d4e54,0x0620,0x4cf9,{0x94,0xae,0x78,0x23,0x96,0x5c,0x28,0xb6}}; static const GUID CLSID_wg_wmv_decoder = {0x62ee5ddb,0x4f52,0x48e2,{0x89,0x28,0x78,0x7b,0x02,0x53,0xa0,0xbc}}; + static const GUID CLSID_wg_mp3_decoder = {0x84cd8e3e,0xb221,0x434a,{0x88,0x82,0x9d,0x6c,0x8d,0xf4,0x90,0xe1}}; static const GUID CLSID_wg_mpeg1_splitter = {0xa8edbf98,0x2442,0x42c5,{0x85,0xa1,0xab,0x05,0xa5,0x80,0xdf,0x53}}; static const GUID CLSID_wg_wave_parser = {0x3f839ec7,0x5ea6,0x49e1,{0x80,0xc2,0x1e,0xa3,0x00,0xf8,0xb0,0xe0}}; struct class_factory *factory; @@ -1021,7 +1020,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out) factory = &mpeg_audio_codec_cf; else if (IsEqualGUID(clsid, &CLSID_wg_mpeg_video_decoder)) factory = &mpeg_video_codec_cf; - else if (IsEqualGUID(clsid, &CLSID_mpeg_layer3_decoder)) + else if (IsEqualGUID(clsid, &CLSID_wg_mp3_decoder)) factory = &mpeg_layer3_decoder_cf; else if (IsEqualGUID(clsid, &CLSID_wg_mpeg1_splitter)) factory = &mpeg_splitter_cf; @@ -1084,38 +1083,6 @@ static const REGPINTYPES reg_audio_mt = {&MEDIATYPE_Audio, &GUID_NULL}; static const REGPINTYPES reg_stream_mt = {&MEDIATYPE_Stream, &GUID_NULL}; static const REGPINTYPES reg_video_mt = {&MEDIATYPE_Video, &GUID_NULL};
-static const REGPINTYPES reg_mpeg_layer3_decoder_sink_mts[1] = -{ - {&MEDIATYPE_Audio, &MEDIASUBTYPE_MP3}, -}; - -static const REGPINTYPES reg_mpeg_layer3_decoder_source_mts[1] = -{ - {&MEDIATYPE_Audio, &MEDIASUBTYPE_PCM}, -}; - -static const REGFILTERPINS2 reg_mpeg_layer3_decoder_pins[2] = -{ - { - .nMediaTypes = 1, - .lpMediaType = reg_mpeg_layer3_decoder_sink_mts, - }, - { - .dwFlags = REG_PINFLAG_B_OUTPUT, - .nMediaTypes = 1, - .lpMediaType = reg_mpeg_layer3_decoder_source_mts, - }, -}; - -static const REGFILTER2 reg_mpeg_layer3_decoder = -{ - .dwVersion = 2, - .dwMerit = 0x00810000, - .u.s2.cPins2 = 2, - .u.s2.rgPins2 = reg_mpeg_layer3_decoder_pins, -}; - - static const REGFILTERPINS2 reg_decodebin_parser_pins[3] = { { @@ -1158,8 +1125,6 @@ HRESULT WINAPI DllRegisterServer(void)
IFilterMapper2_RegisterFilter(mapper, &CLSID_decodebin_parser, L"GStreamer splitter filter", NULL, NULL, NULL, ®_decodebin_parser); - IFilterMapper2_RegisterFilter(mapper, &CLSID_mpeg_layer3_decoder, - L"MPEG Layer-3 Decoder", NULL, NULL, NULL, ®_mpeg_layer3_decoder);
IFilterMapper2_Release(mapper);
@@ -1181,7 +1146,6 @@ HRESULT WINAPI DllUnregisterServer(void) return hr;
IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_decodebin_parser); - IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_mpeg_layer3_decoder);
IFilterMapper2_Release(mapper);
diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl index 1438f9d663c..bb9f81c2341 100644 --- a/dlls/winegstreamer/winegstreamer_classes.idl +++ b/dlls/winegstreamer/winegstreamer_classes.idl @@ -40,11 +40,10 @@ coclass wg_mpeg_audio_decoder {} coclass wg_mpeg_video_decoder {}
[ - helpstring("MPEG Layer-3 Decoder"), threading(both), - uuid(38be3000-dbf4-11d0-860e-00a024cfef6d) + uuid(84cd8e3e-b221-434a-8882-9d6c8df490e1) ] -coclass mpeg_layer3_decoder {} +coclass wg_mp3_decoder {}
[ threading(both), diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 7adba6e080a..ac1a20ef46a 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2107,6 +2107,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,cryptdlg.dll,1 11,,cryptnet.dll,1 11,,devenum.dll,1 +11,,l3codecx.ax,1 11,,mfasfsrcsnk.dll,1 11,,mfh264enc.dll,1 11,,mfmp4srcsnk.dll,1
On Thu Sep 5 09:00:13 2024 +0000, Rémi Bernon wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/6441/diffs?diff_id=130342&start_sha=bc3baafc7a9a0224217899ee9f13e4c72b4dc4aa#68d175f722aa7f27bb95c13a01da9d79bfed6fb6_5_3)
I dropped the prefer-native, the class was already implemented before and we weren't preferring native for it.
On Thu Sep 5 09:02:43 2024 +0000, Elizabeth Figura wrote:
As I'm forwarding the call to another CoCreateInstance it seemed
better to pass all the parameters through untouched. I'm not sure I see why? What parameters are meaningfully touched?
The iid isn't passed to the creation callbacks, it's checked upfront. Anyway, I changed it.
Emil Velikov (@xexaxo) commented about dlls/quartz/regsvr.c:
*/ HRESULT WINAPI DllUnregisterServer(void) {
IFilterMapper2 *mapper; HRESULT hr;
TRACE("\n");
- hr = unregister_filters(filter_list);
- if (SUCCEEDED(hr))
hr = QUARTZ_DllUnregisterServer();
- if (FAILED(hr = QUARTZ_DllUnregisterServer()))
Is the filters<>quartz call order intentional?
I suspect ideally the filters will go first. Plus one will continue to unregister the whole thing even if one of those fail.
In other projects, these matter not sure about here though. Take it fwiw.