Commit ddf7026d authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Support MFT_SET_TYPE_TEST_ONLY flag in the MF transforms.

parent d4e6a01f
...@@ -278,7 +278,6 @@ static void check_mft_set_input_type_required_(int line, IMFTransform *transform ...@@ -278,7 +278,6 @@ static void check_mft_set_input_type_required_(int line, IMFTransform *transform
hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY);
ok_(__FILE__, line)(hr == S_OK, "SetInputType returned %#lx.\n", hr); ok_(__FILE__, line)(hr == S_OK, "SetInputType returned %#lx.\n", hr);
ref = IMFMediaType_Release(media_type); ref = IMFMediaType_Release(media_type);
todo_wine_if(ref == 1)
ok_(__FILE__, line)(!ref, "Release returned %lu\n", ref); ok_(__FILE__, line)(!ref, "Release returned %lu\n", ref);
} }
...@@ -309,7 +308,6 @@ static void check_mft_set_output_type_required_(int line, IMFTransform *transfor ...@@ -309,7 +308,6 @@ static void check_mft_set_output_type_required_(int line, IMFTransform *transfor
hr = IMFTransform_SetOutputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); hr = IMFTransform_SetOutputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY);
ok_(__FILE__, line)(hr == S_OK, "SetOutputType returned %#lx.\n", hr); ok_(__FILE__, line)(hr == S_OK, "SetOutputType returned %#lx.\n", hr);
ref = IMFMediaType_Release(media_type); ref = IMFMediaType_Release(media_type);
todo_wine_if(ref == 1)
ok_(__FILE__, line)(!ref, "Release returned %lu\n", ref); ok_(__FILE__, line)(!ref, "Release returned %lu\n", ref);
} }
......
...@@ -401,6 +401,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM ...@@ -401,6 +401,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM
break; break;
if (i == ARRAY_SIZE(input_types)) if (i == ARRAY_SIZE(input_types))
return MF_E_INVALIDMEDIATYPE; return MF_E_INVALIDMEDIATYPE;
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
if (!impl->input_type && FAILED(hr = MFCreateMediaType(&impl->input_type))) if (!impl->input_type && FAILED(hr = MFCreateMediaType(&impl->input_type)))
return hr; return hr;
...@@ -444,6 +446,8 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF ...@@ -444,6 +446,8 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
break; break;
if (i == ARRAY_SIZE(output_types)) if (i == ARRAY_SIZE(output_types))
return MF_E_INVALIDMEDIATYPE; return MF_E_INVALIDMEDIATYPE;
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
if (!impl->output_type && FAILED(hr = MFCreateMediaType(&impl->output_type))) if (!impl->output_type && FAILED(hr = MFCreateMediaType(&impl->output_type)))
return hr; return hr;
......
...@@ -419,6 +419,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM ...@@ -419,6 +419,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM
break; break;
if (i == ARRAY_SIZE(h264_decoder_input_types)) if (i == ARRAY_SIZE(h264_decoder_input_types))
return MF_E_INVALIDMEDIATYPE; return MF_E_INVALIDMEDIATYPE;
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
if (decoder->output_type) if (decoder->output_type)
{ {
...@@ -469,6 +471,8 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF ...@@ -469,6 +471,8 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
|| (frame_size >> 32) != decoder->wg_format.u.video.width || (frame_size >> 32) != decoder->wg_format.u.video.width
|| (UINT32)frame_size != decoder->wg_format.u.video.height) || (UINT32)frame_size != decoder->wg_format.u.video.height)
return MF_E_INVALIDMEDIATYPE; return MF_E_INVALIDMEDIATYPE;
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
if (decoder->output_type) if (decoder->output_type)
IMFMediaType_Release(decoder->output_type); IMFMediaType_Release(decoder->output_type);
......
...@@ -383,6 +383,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM ...@@ -383,6 +383,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM
if (FAILED(hr = check_media_type(type))) if (FAILED(hr = check_media_type(type)))
return hr; return hr;
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
if (!impl->input_type && FAILED(hr = MFCreateMediaType(&impl->input_type))) if (!impl->input_type && FAILED(hr = MFCreateMediaType(&impl->input_type)))
return hr; return hr;
...@@ -414,6 +416,8 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF ...@@ -414,6 +416,8 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
if (FAILED(hr = check_media_type(type))) if (FAILED(hr = check_media_type(type)))
return hr; return hr;
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
if (!impl->output_type && FAILED(hr = MFCreateMediaType(&impl->output_type))) if (!impl->output_type && FAILED(hr = MFCreateMediaType(&impl->output_type)))
return hr; return hr;
......
...@@ -376,6 +376,8 @@ static HRESULT WINAPI video_processor_SetInputType(IMFTransform *iface, DWORD id ...@@ -376,6 +376,8 @@ static HRESULT WINAPI video_processor_SetInputType(IMFTransform *iface, DWORD id
break; break;
if (i == ARRAY_SIZE(input_types)) if (i == ARRAY_SIZE(input_types))
return MF_E_INVALIDMEDIATYPE; return MF_E_INVALIDMEDIATYPE;
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
if (impl->input_type) if (impl->input_type)
IMFMediaType_Release(impl->input_type); IMFMediaType_Release(impl->input_type);
...@@ -413,6 +415,8 @@ static HRESULT WINAPI video_processor_SetOutputType(IMFTransform *iface, DWORD i ...@@ -413,6 +415,8 @@ static HRESULT WINAPI video_processor_SetOutputType(IMFTransform *iface, DWORD i
break; break;
if (i == ARRAY_SIZE(output_types)) if (i == ARRAY_SIZE(output_types))
return MF_E_INVALIDMEDIATYPE; return MF_E_INVALIDMEDIATYPE;
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
if (impl->output_type) if (impl->output_type)
IMFMediaType_Release(impl->output_type); IMFMediaType_Release(impl->output_type);
......
...@@ -387,6 +387,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM ...@@ -387,6 +387,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM
if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_NUM_CHANNELS, &item_type)) || if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_NUM_CHANNELS, &item_type)) ||
item_type != MF_ATTRIBUTE_UINT32) item_type != MF_ATTRIBUTE_UINT32)
return MF_E_INVALIDMEDIATYPE; return MF_E_INVALIDMEDIATYPE;
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
if (!decoder->input_type && FAILED(hr = MFCreateMediaType(&decoder->input_type))) if (!decoder->input_type && FAILED(hr = MFCreateMediaType(&decoder->input_type)))
return hr; return hr;
...@@ -443,9 +445,6 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF ...@@ -443,9 +445,6 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
return hr; return hr;
} }
if (FAILED(IMFMediaType_SetUINT32(decoder->input_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, sample_size)))
return MF_E_INVALIDMEDIATYPE;
if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &item_type)) || if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &item_type)) ||
item_type != MF_ATTRIBUTE_UINT32) item_type != MF_ATTRIBUTE_UINT32)
return MF_E_INVALIDMEDIATYPE; return MF_E_INVALIDMEDIATYPE;
...@@ -461,6 +460,11 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF ...@@ -461,6 +460,11 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &item_type)) || if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &item_type)) ||
item_type != MF_ATTRIBUTE_UINT32) item_type != MF_ATTRIBUTE_UINT32)
return MF_E_INVALIDMEDIATYPE; return MF_E_INVALIDMEDIATYPE;
if (flags & MFT_SET_TYPE_TEST_ONLY)
return S_OK;
if (FAILED(IMFMediaType_SetUINT32(decoder->input_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, sample_size)))
return MF_E_INVALIDMEDIATYPE;
if (!decoder->output_type && FAILED(hr = MFCreateMediaType(&decoder->output_type))) if (!decoder->output_type && FAILED(hr = MFCreateMediaType(&decoder->output_type)))
return hr; return hr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment