From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winegstreamer/mfplat.c | 184 ++++++++++++++++-------------------- 1 file changed, 82 insertions(+), 102 deletions(-)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 97e27bb7301..ef52fcf19d2 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -437,114 +437,93 @@ HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) return CLASS_E_CLASSNOTAVAILABLE; }
-static WCHAR audio_converterW[] = L"Audio Converter"; -static const GUID *const audio_converter_supported_types[] = -{ - &MFAudioFormat_PCM, - &MFAudioFormat_Float, -}; - -static WCHAR wma_decoderW[] = L"WMAudio Decoder MFT"; -static const GUID *const wma_decoder_input_types[] = -{ - &MEDIASUBTYPE_MSAUDIO1, - &MFAudioFormat_WMAudioV8, - &MFAudioFormat_WMAudioV9, - &MFAudioFormat_WMAudio_Lossless, -}; -static const GUID *const wma_decoder_output_types[] = -{ - &MFAudioFormat_PCM, - &MFAudioFormat_Float, -}; - -static WCHAR h264_decoderW[] = L"Microsoft H264 Video Decoder MFT"; -static const GUID *const h264_decoder_input_types[] = -{ - &MFVideoFormat_H264, - &MFVideoFormat_H264_ES, -}; -static const GUID *const h264_decoder_output_types[] = -{ - &MFVideoFormat_NV12, - &MFVideoFormat_YV12, - &MFVideoFormat_IYUV, - &MFVideoFormat_I420, - &MFVideoFormat_YUY2, -}; - -static const struct mft -{ - const GUID *clsid; - const GUID *category; - LPWSTR name; - const UINT32 flags; - const GUID *major_type; - const UINT32 input_types_count; - const GUID *const *input_types; - const UINT32 output_types_count; - const GUID *const *output_types; -} -mfts[] = -{ - { - &CLSID_WINEAudioConverter, - &MFT_CATEGORY_AUDIO_EFFECT, - audio_converterW, - MFT_ENUM_FLAG_SYNCMFT, - &MFMediaType_Audio, - ARRAY_SIZE(audio_converter_supported_types), - audio_converter_supported_types, - ARRAY_SIZE(audio_converter_supported_types), - audio_converter_supported_types, - }, - { - &CLSID_WMADecMediaObject, - &MFT_CATEGORY_AUDIO_DECODER, - wma_decoderW, - MFT_ENUM_FLAG_SYNCMFT, - &MFMediaType_Audio, - ARRAY_SIZE(wma_decoder_input_types), - wma_decoder_input_types, - ARRAY_SIZE(wma_decoder_output_types), - wma_decoder_output_types, - }, - { - &CLSID_MSH264DecoderMFT, - &MFT_CATEGORY_VIDEO_DECODER, - h264_decoderW, - MFT_ENUM_FLAG_SYNCMFT, - &MFMediaType_Video, - ARRAY_SIZE(h264_decoder_input_types), - h264_decoder_input_types, - ARRAY_SIZE(h264_decoder_output_types), - h264_decoder_output_types, - }, -}; - HRESULT mfplat_DllRegisterServer(void) { - unsigned int i, j; - HRESULT hr; - MFT_REGISTER_TYPE_INFO input_types[4], output_types[5]; - - for (i = 0; i < ARRAY_SIZE(mfts); i++) + MFT_REGISTER_TYPE_INFO audio_converter_supported_types[] = + { + {MFMediaType_Audio, MFAudioFormat_PCM}, + {MFMediaType_Audio, MFAudioFormat_Float}, + }; + + MFT_REGISTER_TYPE_INFO wma_decoder_input_types[] = + { + {MFMediaType_Audio, MEDIASUBTYPE_MSAUDIO1}, + {MFMediaType_Audio, MFAudioFormat_WMAudioV8}, + {MFMediaType_Audio, MFAudioFormat_WMAudioV9}, + {MFMediaType_Audio, MFAudioFormat_WMAudio_Lossless}, + }; + MFT_REGISTER_TYPE_INFO wma_decoder_output_types[] = + { + {MFMediaType_Audio, MFAudioFormat_PCM}, + {MFMediaType_Audio, MFAudioFormat_Float}, + }; + + MFT_REGISTER_TYPE_INFO h264_decoder_input_types[] = + { + {MFMediaType_Video, MFVideoFormat_H264}, + {MFMediaType_Video, MFVideoFormat_H264_ES}, + }; + MFT_REGISTER_TYPE_INFO h264_decoder_output_types[] = + { + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + }; + + struct mft + { + GUID clsid; + GUID category; + WCHAR name[MAX_PATH]; + UINT32 flags; + UINT32 input_types_count; + MFT_REGISTER_TYPE_INFO *input_types; + UINT32 output_types_count; + MFT_REGISTER_TYPE_INFO *output_types; + } + mfts[] = { - const struct mft *cur = &mfts[i]; - - for (j = 0; j < cur->input_types_count; j++) { - input_types[j].guidMajorType = *(cur->major_type); - input_types[j].guidSubtype = *(cur->input_types[j]); - } - for (j = 0; j < cur->output_types_count; j++) + CLSID_WINEAudioConverter, + MFT_CATEGORY_AUDIO_EFFECT, + L"Audio Converter", + MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(audio_converter_supported_types), + audio_converter_supported_types, + ARRAY_SIZE(audio_converter_supported_types), + audio_converter_supported_types, + }, { - output_types[j].guidMajorType = *(cur->major_type); - output_types[j].guidSubtype = *(cur->output_types[j]); - } + CLSID_WMADecMediaObject, + MFT_CATEGORY_AUDIO_DECODER, + L"WMAudio Decoder MFT", + MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(wma_decoder_input_types), + wma_decoder_input_types, + ARRAY_SIZE(wma_decoder_output_types), + wma_decoder_output_types, + }, + { + CLSID_MSH264DecoderMFT, + MFT_CATEGORY_VIDEO_DECODER, + L"Microsoft H264 Video Decoder MFT", + MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(h264_decoder_input_types), + h264_decoder_input_types, + ARRAY_SIZE(h264_decoder_output_types), + h264_decoder_output_types, + }, + };
- hr = MFTRegister(*(cur->clsid), *(cur->category), cur->name, cur->flags, cur->input_types_count, - input_types, cur->output_types_count, output_types, NULL); + unsigned int i; + HRESULT hr; + + for (i = 0; i < ARRAY_SIZE(mfts); i++) + { + hr = MFTRegister(mfts[i].clsid, mfts[i].category, mfts[i].name, mfts[i].flags, mfts[i].input_types_count, + mfts[i].input_types, mfts[i].output_types_count, mfts[i].output_types, NULL);
if (FAILED(hr)) { @@ -552,6 +531,7 @@ HRESULT mfplat_DllRegisterServer(void) return hr; } } + return S_OK; }
From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winegstreamer/mfplat.c | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index ef52fcf19d2..f278ff61ba6 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -472,6 +472,56 @@ HRESULT mfplat_DllRegisterServer(void) {MFMediaType_Video, MFVideoFormat_YUY2}, };
+ MFT_REGISTER_TYPE_INFO video_processor_input_types[] = + { + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_ARGB32}, + {MFMediaType_Video, MFVideoFormat_RGB32}, + {MFMediaType_Video, MFVideoFormat_NV11}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MEDIASUBTYPE_P208}, + {MFMediaType_Video, MFVideoFormat_RGB24}, + {MFMediaType_Video, MFVideoFormat_RGB555}, + {MFMediaType_Video, MFVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_RGB8}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_Y216}, + {MFMediaType_Video, MFVideoFormat_v410}, + {MFMediaType_Video, MFVideoFormat_Y41P}, + {MFMediaType_Video, MFVideoFormat_Y41T}, + {MFMediaType_Video, MFVideoFormat_Y42T}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + {MFMediaType_Video, MFVideoFormat_420O}, + }; + MFT_REGISTER_TYPE_INFO video_processor_output_types[] = + { + {MFMediaType_Video, MFVideoFormat_IYUV}, + {MFMediaType_Video, MFVideoFormat_YV12}, + {MFMediaType_Video, MFVideoFormat_NV12}, + {MFMediaType_Video, MFVideoFormat_YUY2}, + {MFMediaType_Video, MFVideoFormat_ARGB32}, + {MFMediaType_Video, MFVideoFormat_RGB32}, + {MFMediaType_Video, MFVideoFormat_NV11}, + {MFMediaType_Video, MFVideoFormat_AYUV}, + {MFMediaType_Video, MFVideoFormat_UYVY}, + {MFMediaType_Video, MEDIASUBTYPE_P208}, + {MFMediaType_Video, MFVideoFormat_RGB24}, + {MFMediaType_Video, MFVideoFormat_RGB555}, + {MFMediaType_Video, MFVideoFormat_RGB565}, + {MFMediaType_Video, MFVideoFormat_RGB8}, + {MFMediaType_Video, MFVideoFormat_I420}, + {MFMediaType_Video, MFVideoFormat_Y216}, + {MFMediaType_Video, MFVideoFormat_v410}, + {MFMediaType_Video, MFVideoFormat_Y41P}, + {MFMediaType_Video, MFVideoFormat_Y41T}, + {MFMediaType_Video, MFVideoFormat_Y42T}, + {MFMediaType_Video, MFVideoFormat_YVYU}, + }; + struct mft { GUID clsid; @@ -515,6 +565,16 @@ HRESULT mfplat_DllRegisterServer(void) ARRAY_SIZE(h264_decoder_output_types), h264_decoder_output_types, }, + { + CLSID_VideoProcessorMFT, + MFT_CATEGORY_VIDEO_PROCESSOR, + L"Microsoft Video Processor MFT", + MFT_ENUM_FLAG_SYNCMFT, + ARRAY_SIZE(video_processor_input_types), + video_processor_input_types, + ARRAY_SIZE(video_processor_output_types), + video_processor_output_types, + }, };
unsigned int i;
From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/mf/tests/mf.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index a9706aa7647..b10bf26bc44 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -65,6 +65,7 @@ DEFINE_GUID(DMOVideoFormat_RGB8, D3DFMT_P8, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x static HRESULT (WINAPI *pMFCreateSampleCopierMFT)(IMFTransform **copier); static HRESULT (WINAPI *pMFGetTopoNodeCurrentType)(IMFTopologyNode *node, DWORD stream, BOOL output, IMFMediaType **type);
+static BOOL has_video_processor; static BOOL is_vista(void) { return !pMFGetTopoNodeCurrentType; @@ -1885,6 +1886,7 @@ enum loader_test_flags LOADER_EXPECTED_DECODER = 0x1, LOADER_EXPECTED_CONVERTER = 0x2, LOADER_TODO = 0x4, + LOADER_NEEDS_VIDEO_PROCESSOR = 0x8, };
static void test_topology_loader(void) @@ -1972,7 +1974,7 @@ static void test_topology_loader(void)
MF_CONNECT_ALLOW_CONVERTER, S_OK, - LOADER_EXPECTED_CONVERTER | LOADER_TODO, + LOADER_NEEDS_VIDEO_PROCESSOR | LOADER_EXPECTED_CONVERTER | LOADER_TODO, },
{ @@ -2021,7 +2023,7 @@ static void test_topology_loader(void)
MF_CONNECT_ALLOW_CONVERTER, MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_MEDIATYPE_COMBINATION, - LOADER_TODO, + LOADER_NEEDS_VIDEO_PROCESSOR | LOADER_TODO, },
{ @@ -2185,9 +2187,14 @@ static void test_topology_loader(void) ok(!count, "Unexpected count %u.\n", count);
hr = IMFTopoLoader_Load(loader, topology, &full_topology, NULL); - todo_wine_if(test->flags & LOADER_TODO) - ok(hr == test->expected_result, "Unexpected hr %#lx on test %u.\n", hr, i); - ok(full_topology != topology, "Unexpected instance.\n"); + if (test->flags & LOADER_NEEDS_VIDEO_PROCESSOR && !has_video_processor) + ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#lx on test %u.\n", hr, i); + else + { + todo_wine_if(test->flags & LOADER_TODO) + ok(hr == test->expected_result, "Unexpected hr %#lx on test %u.\n", hr, i); + ok(full_topology != topology, "Unexpected instance.\n"); + }
if (test->expected_result == S_OK && hr == S_OK) { @@ -3629,6 +3636,7 @@ static void test_video_processor(void) transform_inputs, ARRAY_SIZE(transform_inputs), transform_outputs, ARRAY_SIZE(transform_outputs), &transform, &CLSID_VideoProcessorMFT, &class_id)) goto failed; + has_video_processor = TRUE;
todo_wine check_interface(transform, &IID_IMFVideoProcessorControl, TRUE); @@ -8191,6 +8199,7 @@ START_TEST(mf) return; }
+ test_video_processor(); test_topology(); test_topology_tee_node(); test_topology_loader(); @@ -8203,7 +8212,6 @@ START_TEST(mf) test_presentation_clock(); test_sample_grabber(); test_sample_grabber_is_mediatype_supported(); - test_video_processor(); test_quality_manager(); test_sar(); test_evr();
From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/mf/tests/mf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index b10bf26bc44..7af08a73ac6 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -4821,7 +4821,7 @@ todo_wine {
/* Same test for a substream. */ hr = IMFMediaSink_AddStreamSink(sink, 1, NULL, &stream_sink2); - ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == S_OK || broken(hr == E_INVALIDARG), "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr)) {
This merge request was approved by Nikolay Sivov.