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"),