Derek Lesho : winegstreamer: Implement ::GetInputAvailableType for audio conversion transform.
Module: wine Branch: master Commit: 8aa77a445017207ae3bea1fda4d91bf8991afceb URL: https://source.winehq.org/git/wine.git/?a=commit;h=8aa77a445017207ae3bea1fda... Author: Derek Lesho <dlesho(a)codeweavers.com> Date: Wed Dec 2 17:36:33 2020 -0500 winegstreamer: Implement ::GetInputAvailableType for audio conversion transform. Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/audioconvert.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c index 1c0fcf660c9..bba7d6f5830 100644 --- a/dlls/winegstreamer/audioconvert.c +++ b/dlls/winegstreamer/audioconvert.c @@ -166,9 +166,35 @@ static HRESULT WINAPI audio_converter_AddInputStreams(IMFTransform *iface, DWORD static HRESULT WINAPI audio_converter_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) { - FIXME("%p, %u, %u, %p.\n", iface, id, index, type); + IMFMediaType *ret; + HRESULT hr; - return E_NOTIMPL; + TRACE("%p, %u, %u, %p.\n", iface, id, index, type); + + if (id != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (index >= 2) + return MF_E_NO_MORE_TYPES; + + if (FAILED(hr = MFCreateMediaType(&ret))) + return hr; + + if (FAILED(hr = IMFMediaType_SetGUID(ret, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio))) + { + IMFMediaType_Release(ret); + return hr; + } + + if (FAILED(hr = IMFMediaType_SetGUID(ret, &MF_MT_SUBTYPE, index ? &MFAudioFormat_Float : &MFAudioFormat_PCM))) + { + IMFMediaType_Release(ret); + return hr; + } + + *type = ret; + + return S_OK; } static HRESULT WINAPI audio_converter_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
participants (1)
-
Alexandre Julliard