Module: wine Branch: master Commit: c91211f315e8f3a42b2c626355eb99e9f22263f2 URL: https://gitlab.winehq.org/wine/wine/-/commit/c91211f315e8f3a42b2c626355eb99e...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri Apr 12 16:45:37 2024 +0200
winegstreamer/video_processor: Allow clearing input / output types.
---
dlls/winegstreamer/video_processor.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index 3075bf997d2..cce077ae63b 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -347,6 +347,22 @@ static HRESULT WINAPI video_processor_SetInputType(IMFTransform *iface, DWORD id
TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags);
+ if (!type) + { + if (impl->input_type) + { + IMFMediaType_Release(impl->input_type); + impl->input_type = NULL; + } + if (impl->wg_transform) + { + wg_transform_destroy(impl->wg_transform); + impl->wg_transform = 0; + } + + return S_OK; + } + if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major)) || !IsEqualGUID(&major, &MFMediaType_Video)) return E_INVALIDARG; @@ -390,6 +406,22 @@ static HRESULT WINAPI video_processor_SetOutputType(IMFTransform *iface, DWORD i
TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags);
+ if (!type) + { + if (impl->output_type) + { + IMFMediaType_Release(impl->output_type); + impl->output_type = NULL; + } + if (impl->wg_transform) + { + wg_transform_destroy(impl->wg_transform); + impl->wg_transform = 0; + } + + return S_OK; + } + if (FAILED(IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major)) || !IsEqualGUID(&major, &MFMediaType_Video)) return E_INVALIDARG;