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 ef3fae4f415..b226ec353d1 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); @@ -537,6 +570,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"),