winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
599 discussions
Start a n
N
ew thread
Ziqing Hui : winegstreamer: Implement GetOutputSizeInfo for WMV decoder.
by Alexandre Julliard
07 Feb '23
07 Feb '23
Module: wine Branch: master Commit: efb819c78142e48c870ba2a2065a13acebdbf5a9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/efb819c78142e48c870ba2a2065a13…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Mon Jan 9 18:02:22 2023 +0800 winegstreamer: Implement GetOutputSizeInfo for WMV decoder. --- dlls/mf/tests/transform.c | 4 ---- dlls/winegstreamer/wmv_decoder.c | 25 +++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 4049e9afbd0..370b58def2b 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -5090,7 +5090,6 @@ static void test_wmv_decoder_media_object(void) hr = IMediaObject_SetOutputType(media_object, 0, NULL, DMO_SET_TYPEF_CLEAR); ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); hr = IMediaObject_GetOutputSizeInfo(media_object, 0, &size, &alignment); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputSizeInfo returned %#lx.\n", hr); for (i = 0; i < ARRAY_SIZE(expected_output_types); ++i) @@ -5120,12 +5119,9 @@ static void test_wmv_decoder_media_object(void) ok(hr == S_OK, "MFCalculateImageSize returned %#lx.\n", hr); hr = IMediaObject_GetOutputSizeInfo(media_object, 0, &size, &alignment); - todo_wine - { ok(hr == S_OK, "GetOutputSizeInfo returned %#lx.\n", hr); ok(size == expected_size, "Got unexpected size %lu, expected %lu.\n", size, expected_size); ok(alignment == 1, "Got unexpected alignment %lu.\n", alignment); - } } winetest_pop_context(); } diff --git a/dlls/winegstreamer/wmv_decoder.c b/dlls/winegstreamer/wmv_decoder.c index 4be36d803ba..473fabab867 100644 --- a/dlls/winegstreamer/wmv_decoder.c +++ b/dlls/winegstreamer/wmv_decoder.c @@ -82,6 +82,7 @@ struct wmv_decoder struct wg_format input_format; struct wg_format output_format; + GUID output_subtype; }; static bool wg_format_is_set(struct wg_format *format) @@ -549,7 +550,10 @@ static HRESULT WINAPI media_object_SetOutputType(IMediaObject *iface, DWORD inde return DMO_E_TYPE_NOT_ACCEPTED; if (!(flags & DMO_SET_TYPEF_TEST_ONLY)) + { + decoder->output_subtype = type->subtype; decoder->output_format = wg_format; + } return S_OK; } @@ -576,8 +580,25 @@ static HRESULT WINAPI media_object_GetInputSizeInfo(IMediaObject *iface, DWORD i static HRESULT WINAPI media_object_GetOutputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *alignment) { - FIXME("iface %p, index %lu, size %p, alignment %p stub!\n", iface, index, size, alignment); - return E_NOTIMPL; + struct wmv_decoder *decoder = impl_from_IMediaObject(iface); + HRESULT hr; + + TRACE("iface %p, index %lu, size %p, alignment %p.\n", iface, index, size, alignment); + + if (index > 0) + return DMO_E_INVALIDSTREAMINDEX; + if (!wg_format_is_set(&decoder->output_format)) + return DMO_E_TYPE_NOT_SET; + + if (FAILED(hr = MFCalculateImageSize(&decoder->output_subtype, + decoder->output_format.u.video.width, decoder->output_format.u.video.height, (UINT32 *)size))) + { + FIXME("Failed to get image size of subtype %s.\n", debugstr_guid(&decoder->output_subtype)); + return hr; + } + *alignment = 1; + + return S_OK; } static HRESULT WINAPI media_object_GetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME *latency)
1
0
0
0
Ziqing Hui : mf/tests: Test GetOutputSizeInfo for WMV decoder.
by Alexandre Julliard
07 Feb '23
07 Feb '23
Module: wine Branch: master Commit: 53b455c9c00a4a0cfd061759d0caca82725bd9e0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/53b455c9c00a4a0cfd061759d0caca…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Mon Jan 9 17:31:47 2023 +0800 mf/tests: Test GetOutputSizeInfo for WMV decoder. --- dlls/mf/tests/transform.c | 61 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 79da3d2fd1d..4049e9afbd0 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -4999,11 +4999,12 @@ static void test_wmv_decoder_media_object(void) {MFMediaType_Video, MEDIASUBTYPE_RGB555, TRUE, FALSE, 512, FORMAT_VideoInfo, NULL, 88, (BYTE *)&expected_output_info[11]}, {MFMediaType_Video, MEDIASUBTYPE_RGB8, TRUE, FALSE, 256, FORMAT_VideoInfo, NULL, 1112, (BYTE *)&expected_output_info[12]}, }; - DMO_MEDIA_TYPE media_type, *input_type; + const POINT test_size[] = {{16, 16}, {96, 96}, {320, 240}}; + DWORD in_count, out_count, size, expected_size, alignment; + DMO_MEDIA_TYPE media_type, *type; IMediaObject *media_object; - DWORD in_count, out_count; char buffer[1024]; - ULONG ret, i; + ULONG ret, i, j; HRESULT hr; winetest_push_context("wmvdec"); @@ -5015,7 +5016,7 @@ static void test_wmv_decoder_media_object(void) return; } - input_type = (DMO_MEDIA_TYPE *)buffer; + type = (DMO_MEDIA_TYPE *)buffer; hr = CoInitialize(NULL); ok(hr == S_OK, "CoInitialize failed, hr %#lx.\n", hr); @@ -5068,8 +5069,8 @@ static void test_wmv_decoder_media_object(void) ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputType returned %#lx.\n", hr); /* Test GetOutputType after setting input type. */ - init_dmo_media_type_video(input_type, &expected_input_types[0].subtype, 16, 16); - hr = IMediaObject_SetInputType(media_object, 0, input_type, 0); + init_dmo_media_type_video(type, &expected_input_types[0].subtype, 16, 16); + hr = IMediaObject_SetInputType(media_object, 0, type, 0); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); check_dmo_get_output_type(media_object, expected_output_types, ARRAY_SIZE(expected_output_types)); @@ -5080,11 +5081,55 @@ static void test_wmv_decoder_media_object(void) ok(hr == DMO_E_TYPE_NOT_SET, "SetOutputType returned %#lx.\n", hr); /* Test SetOutputType after setting input type. */ - init_dmo_media_type_video(input_type, &expected_input_types[0].subtype, 16, 16); - hr = IMediaObject_SetInputType(media_object, 0, input_type, 0); + init_dmo_media_type_video(type, &expected_input_types[0].subtype, 16, 16); + hr = IMediaObject_SetInputType(media_object, 0, type, 0); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); check_dmo_set_output_type(media_object, &MEDIASUBTYPE_RGB24); + /* Test GetOutputSizeInfo. */ + hr = IMediaObject_SetOutputType(media_object, 0, NULL, DMO_SET_TYPEF_CLEAR); + ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); + hr = IMediaObject_GetOutputSizeInfo(media_object, 0, &size, &alignment); + todo_wine + ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputSizeInfo returned %#lx.\n", hr); + + for (i = 0; i < ARRAY_SIZE(expected_output_types); ++i) + { + const GUID *subtype = &expected_output_types[i].subtype; + if (IsEqualGUID(subtype, &MEDIASUBTYPE_RGB565) + || IsEqualGUID(subtype, &MEDIASUBTYPE_RGB8)) + { + skip("Skipping GetOutputSizeInfo tests for video subtype %s.\n", debugstr_guid(subtype)); + continue; + } + + winetest_push_context("out %lu", i); + for (j = 0; j < ARRAY_SIZE(test_size); ++j) + { + init_dmo_media_type_video(type, &expected_output_types[i].subtype, test_size[j].x, test_size[j].y); + hr = IMediaObject_SetOutputType(media_object, 0, type, 0); + todo_wine_if(IsEqualGUID(subtype, &MEDIASUBTYPE_NV11) + || IsEqualGUID(subtype, &MEDIASUBTYPE_IYUV)) + ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); + if (hr != S_OK) + continue; + + size = 0xdeadbeef; + alignment = 0xdeadbeef; + hr = MFCalculateImageSize(subtype, test_size[j].x, test_size[j].y, (UINT32 *)&expected_size); + ok(hr == S_OK, "MFCalculateImageSize returned %#lx.\n", hr); + + hr = IMediaObject_GetOutputSizeInfo(media_object, 0, &size, &alignment); + todo_wine + { + ok(hr == S_OK, "GetOutputSizeInfo returned %#lx.\n", hr); + ok(size == expected_size, "Got unexpected size %lu, expected %lu.\n", size, expected_size); + ok(alignment == 1, "Got unexpected alignment %lu.\n", alignment); + } + } + winetest_pop_context(); + } + ret = IMediaObject_Release(media_object); ok(ret == 0, "Release returned %lu\n", ret); CoUninitialize();
1
0
0
0
Ziqing Hui : winegstreamer: Implement SetOutputType for WMV decoder.
by Alexandre Julliard
07 Feb '23
07 Feb '23
Module: wine Branch: master Commit: b95a05da7326130d44038a00aad7f99b18d10b15 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b95a05da7326130d44038a00aad7f9…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Mon Dec 19 15:49:33 2022 +0800 winegstreamer: Implement SetOutputType for WMV decoder. --- dlls/mf/tests/transform.c | 2 -- dlls/winegstreamer/wmv_decoder.c | 41 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 71ab00c2944..79da3d2fd1d 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -5077,14 +5077,12 @@ static void test_wmv_decoder_media_object(void) hr = IMediaObject_SetInputType(media_object, 0, NULL, DMO_SET_TYPEF_CLEAR); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMediaObject_SetOutputType(media_object, 0, &media_type, 0); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "SetOutputType returned %#lx.\n", hr); /* Test SetOutputType after setting input type. */ init_dmo_media_type_video(input_type, &expected_input_types[0].subtype, 16, 16); hr = IMediaObject_SetInputType(media_object, 0, input_type, 0); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); - todo_wine check_dmo_set_output_type(media_object, &MEDIASUBTYPE_RGB24); ret = IMediaObject_Release(media_object); diff --git a/dlls/winegstreamer/wmv_decoder.c b/dlls/winegstreamer/wmv_decoder.c index 3aacede1345..4be36d803ba 100644 --- a/dlls/winegstreamer/wmv_decoder.c +++ b/dlls/winegstreamer/wmv_decoder.c @@ -81,6 +81,7 @@ struct wmv_decoder LONG refcount; struct wg_format input_format; + struct wg_format output_format; }; static bool wg_format_is_set(struct wg_format *format) @@ -513,8 +514,44 @@ static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index static HRESULT WINAPI media_object_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *type, DWORD flags) { - FIXME("iface %p, index %lu, type %p, flags %#lx stub!\n", iface, index, type, flags); - return E_NOTIMPL; + struct wmv_decoder *decoder = impl_from_IMediaObject(iface); + struct wg_format wg_format; + unsigned int i; + + TRACE("iface %p, index %lu, type %p, flags %#lx,\n", iface, index, type, flags); + + if (index > 0) + return DMO_E_INVALIDSTREAMINDEX; + + if (!type) + { + if (flags & DMO_SET_TYPEF_CLEAR) + { + memset(&decoder->output_format, 0, sizeof(decoder->output_format)); + return S_OK; + } + return E_POINTER; + } + + if (!wg_format_is_set(&decoder->input_format)) + return DMO_E_TYPE_NOT_SET; + + if (!IsEqualGUID(&type->majortype, &MEDIATYPE_Video)) + return DMO_E_TYPE_NOT_ACCEPTED; + + for (i = 0; i < ARRAY_SIZE(wmv_decoder_output_types); ++i) + if (IsEqualGUID(&type->subtype, wmv_decoder_output_types[i].subtype)) + break; + if (i == ARRAY_SIZE(wmv_decoder_output_types)) + return DMO_E_TYPE_NOT_ACCEPTED; + + if (!amt_to_wg_format((const AM_MEDIA_TYPE *)type, &wg_format)) + return DMO_E_TYPE_NOT_ACCEPTED; + + if (!(flags & DMO_SET_TYPEF_TEST_ONLY)) + decoder->output_format = wg_format; + + return S_OK; } static HRESULT WINAPI media_object_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type)
1
0
0
0
Ziqing Hui : winegstreamer: Implement GetOutputType for WMV decoder.
by Alexandre Julliard
07 Feb '23
07 Feb '23
Module: wine Branch: master Commit: fcf09bf1d7892917e42105e57853d215aa5bf4e9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fcf09bf1d7892917e42105e57853d2…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Tue Dec 6 21:28:48 2022 +0800 winegstreamer: Implement GetOutputType for WMV decoder. --- dlls/mf/tests/transform.c | 5 +- dlls/winegstreamer/wmv_decoder.c | 99 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 92 insertions(+), 12 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 12a4e5c6ac9..71ab00c2944 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -1178,9 +1178,11 @@ static void check_video_info_header_(int line, VIDEOINFOHEADER *info, const VIDE ok_(__FILE__, line)(info->bmiHeader.biYPelsPerMeter == expected->bmiHeader.biYPelsPerMeter, "Got unexpected bmiHeader.xxxxxx %ld, expected %ld.\n", info->bmiHeader.biYPelsPerMeter, expected->bmiHeader.biYPelsPerMeter); + todo_wine_if(expected->bmiHeader.biClrUsed != 0) ok_(__FILE__, line)(info->bmiHeader.biClrUsed == expected->bmiHeader.biClrUsed, "Got unexpected bmiHeader.biClrUsed %lu, expected %lu.\n", info->bmiHeader.biClrUsed, expected->bmiHeader.biClrUsed); + todo_wine_if(expected->bmiHeader.biClrImportant != 0) ok_(__FILE__, line)(info->bmiHeader.biClrImportant == expected->bmiHeader.biClrImportant, "Got unexpected bmiHeader.biClrImportant %lu, expected %lu.\n", info->bmiHeader.biClrImportant, expected->bmiHeader.biClrImportant); @@ -1208,6 +1210,7 @@ static void check_dmo_media_type_(int line, DMO_MEDIA_TYPE *media_type, const DM "Got unexpected formattype %s.\n", debugstr_guid(&media_type->formattype)); ok_(__FILE__, line)(media_type->pUnk == NULL, "Got unexpected pUnk %p.\n", media_type->pUnk); + todo_wine_if(expected->cbFormat && expected->cbFormat != sizeof(VIDEOINFOHEADER)) ok_(__FILE__, line)(media_type->cbFormat == expected->cbFormat, "Got unexpected cbFormat %lu, expected %lu.\n", media_type->cbFormat, expected->cbFormat); @@ -5062,14 +5065,12 @@ static void test_wmv_decoder_media_object(void) hr = IMediaObject_SetInputType(media_object, 0, NULL, DMO_SET_TYPEF_CLEAR); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); hr = IMediaObject_GetOutputType(media_object, 0, 0, &media_type); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "GetOutputType returned %#lx.\n", hr); /* Test GetOutputType after setting input type. */ init_dmo_media_type_video(input_type, &expected_input_types[0].subtype, 16, 16); hr = IMediaObject_SetInputType(media_object, 0, input_type, 0); ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); - todo_wine check_dmo_get_output_type(media_object, expected_output_types, ARRAY_SIZE(expected_output_types)); /* Test SetOutputType without setting input type. */ diff --git a/dlls/winegstreamer/wmv_decoder.c b/dlls/winegstreamer/wmv_decoder.c index 1b03d9aa639..3aacede1345 100644 --- a/dlls/winegstreamer/wmv_decoder.c +++ b/dlls/winegstreamer/wmv_decoder.c @@ -29,21 +29,45 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat); -extern const GUID MFVideoFormat_VC1S; +extern const GUID MEDIASUBTYPE_VC1S; -DEFINE_GUID(MFVideoFormat_WMV_Unknown, 0x7ce12ca9,0xbfbf,0x43d9,0x9d,0x00,0x82,0xb8,0xed,0x54,0x31,0x6b); +DEFINE_GUID(MEDIASUBTYPE_WMV_Unknown, 0x7ce12ca9,0xbfbf,0x43d9,0x9d,0x00,0x82,0xb8,0xed,0x54,0x31,0x6b); + +struct decoder_type +{ + const GUID *subtype; + WORD bpp; + DWORD compression; +}; static const GUID *const wmv_decoder_input_types[] = { - &MFVideoFormat_WMV1, - &MFVideoFormat_WMV2, + &MEDIASUBTYPE_WMV1, + &MEDIASUBTYPE_WMV2, &MEDIASUBTYPE_WMVA, &MEDIASUBTYPE_WMVP, &MEDIASUBTYPE_WVP2, - &MFVideoFormat_WMV_Unknown, - &MFVideoFormat_WVC1, - &MFVideoFormat_WMV3, - &MFVideoFormat_VC1S, + &MEDIASUBTYPE_WMV_Unknown, + &MEDIASUBTYPE_WVC1, + &MEDIASUBTYPE_WMV3, + &MEDIASUBTYPE_VC1S, +}; + +static const struct decoder_type wmv_decoder_output_types[] = +{ + { &MEDIASUBTYPE_NV12, 12, MAKEFOURCC('N', 'V', '1', '2') }, + { &MEDIASUBTYPE_YV12, 12, MAKEFOURCC('Y', 'V', '1', '2') }, + { &MEDIASUBTYPE_IYUV, 12, MAKEFOURCC('I', 'Y', 'U', 'V') }, + { &MEDIASUBTYPE_I420, 12, MAKEFOURCC('I', '4', '2', '0') }, + { &MEDIASUBTYPE_YUY2, 16, MAKEFOURCC('Y', 'U', 'Y', '2') }, + { &MEDIASUBTYPE_UYVY, 16, MAKEFOURCC('U', 'Y', 'V', 'Y') }, + { &MEDIASUBTYPE_YVYU, 16, MAKEFOURCC('Y', 'V', 'Y', 'U') }, + { &MEDIASUBTYPE_NV11, 12, MAKEFOURCC('N', 'V', '1', '1') }, + { &MEDIASUBTYPE_RGB32, 32, BI_RGB }, + { &MEDIASUBTYPE_RGB24, 24, BI_RGB }, + { &MEDIASUBTYPE_RGB565, 16, BI_BITFIELDS }, + { &MEDIASUBTYPE_RGB555, 16, BI_RGB }, + { &MEDIASUBTYPE_RGB8, 8, BI_RGB }, }; struct wmv_decoder @@ -59,6 +83,11 @@ struct wmv_decoder struct wg_format input_format; }; +static bool wg_format_is_set(struct wg_format *format) +{ + return format->major_type != WG_MAJOR_TYPE_UNKNOWN; +} + static inline struct wmv_decoder *impl_from_IUnknown(IUnknown *iface) { return CONTAINING_RECORD(iface, struct wmv_decoder, IUnknown_inner); @@ -387,8 +416,58 @@ static HRESULT WINAPI media_object_GetInputType(IMediaObject *iface, DWORD index static HRESULT WINAPI media_object_GetOutputType(IMediaObject *iface, DWORD index, DWORD type_index, DMO_MEDIA_TYPE *type) { - FIXME("iface %p, index %lu, type_index %lu, type %p stub!\n", iface, index, type_index, type); - return E_NOTIMPL; + struct wmv_decoder *decoder = impl_from_IMediaObject(iface); + VIDEOINFOHEADER *info; + const GUID *subtype; + LONG width, height; + UINT32 image_size; + HRESULT hr; + + TRACE("iface %p, index %lu, type_index %lu, type %p.\n", iface, index, type_index, type); + + if (index > 0) + return DMO_E_INVALIDSTREAMINDEX; + if (type_index >= ARRAY_SIZE(wmv_decoder_output_types)) + return DMO_E_NO_MORE_ITEMS; + if (!type) + return S_OK; + if (!wg_format_is_set(&decoder->input_format)) + return DMO_E_TYPE_NOT_SET; + + width = decoder->input_format.u.video_wmv.width; + height = decoder->input_format.u.video_wmv.height; + subtype = wmv_decoder_output_types[type_index].subtype; + if (FAILED(hr = MFCalculateImageSize(subtype, width, height, &image_size))) + { + FIXME("Failed to get image size of subtype %s.\n", debugstr_guid(subtype)); + return hr; + } + + memset(type, 0, sizeof(*type)); + type->majortype = MFMediaType_Video; + type->subtype = *subtype; + type->bFixedSizeSamples = TRUE; + type->bTemporalCompression = FALSE; + type->lSampleSize = image_size; + type->formattype = FORMAT_VideoInfo; + type->cbFormat = sizeof(VIDEOINFOHEADER); + type->pbFormat = CoTaskMemAlloc(type->cbFormat); + memset(type->pbFormat, 0, type->cbFormat); + + info = (VIDEOINFOHEADER *)type->pbFormat; + info->rcSource.right = width; + info->rcSource.bottom = height; + info->rcTarget.right = width; + info->rcTarget.bottom = height; + info->bmiHeader.biSize = sizeof(info->bmiHeader); + info->bmiHeader.biWidth = width; + info->bmiHeader.biHeight = height; + info->bmiHeader.biPlanes = 1; + info->bmiHeader.biBitCount = wmv_decoder_output_types[type_index].bpp; + info->bmiHeader.biCompression = wmv_decoder_output_types[type_index].compression; + info->bmiHeader.biSizeImage = image_size; + + return S_OK; } static HRESULT WINAPI media_object_SetInputType(IMediaObject *iface, DWORD index,
1
0
0
0
Ziqing Hui : mfplat: Support YVYU, NV11, MEDIASUBTYPE_RGB* media types.
by Alexandre Julliard
07 Feb '23
07 Feb '23
Module: wine Branch: master Commit: df26eae97dce7907cff087bde36775504fcb5c3e URL:
https://gitlab.winehq.org/wine/wine/-/commit/df26eae97dce7907cff087bde36775…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Wed Dec 21 16:57:36 2022 +0800 mfplat: Support YVYU, NV11, MEDIASUBTYPE_RGB* media types. --- dlls/mf/tests/transform.c | 4 ++-- dlls/mfplat/buffer.c | 3 +++ dlls/mfplat/mediatype.c | 11 +++++++++++ dlls/mfplat/tests/mfplat.c | 12 ------------ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 3c068aae743..12a4e5c6ac9 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -5752,8 +5752,8 @@ static void test_video_processor(void) && !IsEqualGUID(&guid, &MEDIASUBTYPE_Y42T)) { hr = MFCalculateImageSize(&guid, 16, 16, (UINT32 *)&input_info.cbSize); - todo_wine_if(IsEqualGUID(&guid, &MFVideoFormat_NV11) || IsEqualGUID(&guid, &MFVideoFormat_YVYU) - || IsEqualGUID(&guid, &MFVideoFormat_Y216) || IsEqualGUID(&guid, &MFVideoFormat_v410) + todo_wine_if(IsEqualGUID(&guid, &MFVideoFormat_Y216) + || IsEqualGUID(&guid, &MFVideoFormat_v410) || IsEqualGUID(&guid, &MFVideoFormat_Y41P)) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); } diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index e3d38438b88..a221c6d55b8 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -1357,6 +1357,7 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo break; case MAKEFOURCC('I','M','C','2'): case MAKEFOURCC('I','M','C','4'): + case MAKEFOURCC('N','V','1','1'): plane_size = stride * 3 / 2 * height; break; case MAKEFOURCC('N','V','1','2'): @@ -1379,6 +1380,7 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo case MAKEFOURCC('I','M','C','3'): case MAKEFOURCC('I','M','C','4'): case MAKEFOURCC('Y','V','1','2'): + case MAKEFOURCC('N','V','1','1'): row_alignment = MF_128_BYTE_ALIGNMENT; break; default: @@ -1397,6 +1399,7 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo case MAKEFOURCC('Y','V','1','2'): case MAKEFOURCC('I','M','C','2'): case MAKEFOURCC('I','M','C','4'): + case MAKEFOURCC('N','V','1','1'): max_length = pitch * height * 3 / 2; break; default: diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index fe884d34aad..245922ba068 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -2646,13 +2646,20 @@ static const struct uncompressed_video_format video_formats[] = { &MFVideoFormat_IMC3, 2, 3, 0, 1 }, { &MFVideoFormat_IMC4, 1, 0, 0, 1 }, { &MFVideoFormat_IYUV, 1, 0, 0, 1 }, + { &MFVideoFormat_NV11, 1, 0, 0, 1 }, { &MFVideoFormat_NV12, 1, 0, 0, 1 }, { &MFVideoFormat_D16, 2, 3, 0, 0 }, { &MFVideoFormat_L16, 2, 3, 0, 0 }, { &MFVideoFormat_UYVY, 2, 0, 0, 1 }, { &MFVideoFormat_YUY2, 2, 0, 0, 1 }, { &MFVideoFormat_YV12, 1, 0, 0, 1 }, + { &MFVideoFormat_YVYU, 2, 0, 0, 1 }, { &MFVideoFormat_A16B16G16R16F, 8, 3, 1, 0 }, + { &MEDIASUBTYPE_RGB8, 1, 3, 1, 0 }, + { &MEDIASUBTYPE_RGB565, 2, 3, 1, 0 }, + { &MEDIASUBTYPE_RGB555, 2, 3, 1, 0 }, + { &MEDIASUBTYPE_RGB24, 3, 3, 1, 0 }, + { &MEDIASUBTYPE_RGB32, 4, 3, 1, 0 }, }; static struct uncompressed_video_format *mf_get_video_format(const GUID *subtype) @@ -2732,6 +2739,9 @@ HRESULT WINAPI MFCalculateImageSize(REFGUID subtype, UINT32 width, UINT32 height /* 2 x 2 block, interleaving UV for half the height */ *size = ((width + 1) & ~1) * height * 3 / 2; break; + case MAKEFOURCC('N','V','1','1'): + *size = ((width + 3) & ~3) * height * 3 / 2; + break; case D3DFMT_L8: case D3DFMT_L16: case D3DFMT_D16: @@ -2772,6 +2782,7 @@ HRESULT WINAPI MFGetPlaneSize(DWORD fourcc, DWORD width, DWORD height, DWORD *si case MAKEFOURCC('Y','V','1','2'): case MAKEFOURCC('I','4','2','0'): case MAKEFOURCC('I','Y','U','V'): + case MAKEFOURCC('N','V','1','1'): *size = stride * height * 3 / 2; break; default: diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 962a9fd2251..33b17b8df41 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -4390,10 +4390,7 @@ static void test_MFCalculateImageSize(void) IsEqualGUID(ptr->subtype, &MFVideoFormat_A2R10G10B10); hr = MFCalculateImageSize(ptr->subtype, ptr->width, ptr->height, &size); - todo_wine_if(is_MEDIASUBTYPE_RGB(ptr->subtype) || IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) ok(hr == S_OK || (is_broken && hr == E_INVALIDARG), "%u: failed to calculate image size, hr %#lx.\n", i, hr); - todo_wine_if(is_MEDIASUBTYPE_RGB(ptr->subtype) - || IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) ok(size == ptr->size, "%u: unexpected image size %u, expected %u. Size %u x %u, format %s.\n", i, size, ptr->size, ptr->width, ptr->height, wine_dbgstr_an((char *)&ptr->subtype->Data1, 4)); } @@ -4425,7 +4422,6 @@ static void test_MFGetPlaneSize(void) hr = pMFGetPlaneSize(ptr->subtype->Data1, ptr->width, ptr->height, &size); ok(hr == S_OK, "%u: failed to get plane size, hr %#lx.\n", i, hr); - todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) ok(size == plane_size, "%u: unexpected plane size %lu, expected %u. Size %u x %u, format %s.\n", i, size, plane_size, ptr->width, ptr->height, wine_dbgstr_an((char*)&ptr->subtype->Data1, 4)); } @@ -5762,9 +5758,7 @@ static void test_MFGetStrideForBitmapInfoHeader(void) for (i = 0; i < ARRAY_SIZE(stride_tests); ++i) { hr = pMFGetStrideForBitmapInfoHeader(stride_tests[i].subtype->Data1, stride_tests[i].width, &stride); - todo_wine_if(IsEqualGUID(stride_tests[i].subtype, &MFVideoFormat_NV11)) ok(hr == S_OK, "%u: failed to get stride, hr %#lx.\n", i, hr); - todo_wine_if(IsEqualGUID(stride_tests[i].subtype, &MFVideoFormat_NV11)) ok(stride == stride_tests[i].stride, "%u: format %s, unexpected stride %ld, expected %ld.\n", i, wine_dbgstr_an((char *)&stride_tests[i].subtype->Data1, 4), stride, stride_tests[i].stride); } @@ -5977,10 +5971,7 @@ static void test_MFCreate2DMediaBuffer(void) continue; hr = pMFCreate2DMediaBuffer(ptr->width, ptr->height, ptr->subtype->Data1, FALSE, &buffer); - todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) ok(hr == S_OK, "Failed to create a buffer, hr %#lx.\n", hr); - if (hr != S_OK) - continue; hr = IMFMediaBuffer_GetMaxLength(buffer, &length); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); @@ -6121,10 +6112,7 @@ static void test_MFCreate2DMediaBuffer(void) continue; hr = pMFCreate2DMediaBuffer(ptr->width, ptr->height, ptr->subtype->Data1, FALSE, &buffer); - todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) ok(hr == S_OK, "Failed to create a buffer, hr %#lx.\n", hr); - if (hr != S_OK) - continue; hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&_2dbuffer); ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr);
1
0
0
0
Ziqing Hui : mfplat: Fix stride calculation for RGB24.
by Alexandre Julliard
07 Feb '23
07 Feb '23
Module: wine Branch: master Commit: 67be089aa207ea800e9f329c92960ad80ef55095 URL:
https://gitlab.winehq.org/wine/wine/-/commit/67be089aa207ea800e9f329c92960a…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Wed Jan 4 11:31:21 2023 +0800 mfplat: Fix stride calculation for RGB24. --- dlls/mfplat/mediatype.c | 2 +- dlls/mfplat/tests/mfplat.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index c1c8d0048c3..fe884d34aad 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -2631,7 +2631,7 @@ static int __cdecl uncompressed_video_format_compare(const void *a, const void * static const struct uncompressed_video_format video_formats[] = { - { &MFVideoFormat_RGB24, 4, 3, 1, 0 }, + { &MFVideoFormat_RGB24, 3, 3, 1, 0 }, { &MFVideoFormat_ARGB32, 4, 3, 1, 0 }, { &MFVideoFormat_RGB32, 4, 3, 1, 0 }, { &MFVideoFormat_RGB565, 2, 3, 1, 0 }, diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index f1f61e25d00..962a9fd2251 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -4393,8 +4393,7 @@ static void test_MFCalculateImageSize(void) todo_wine_if(is_MEDIASUBTYPE_RGB(ptr->subtype) || IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) ok(hr == S_OK || (is_broken && hr == E_INVALIDARG), "%u: failed to calculate image size, hr %#lx.\n", i, hr); todo_wine_if(is_MEDIASUBTYPE_RGB(ptr->subtype) - || IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11) - || (IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0)) + || IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) ok(size == ptr->size, "%u: unexpected image size %u, expected %u. Size %u x %u, format %s.\n", i, size, ptr->size, ptr->width, ptr->height, wine_dbgstr_an((char *)&ptr->subtype->Data1, 4)); } @@ -4426,8 +4425,7 @@ static void test_MFGetPlaneSize(void) hr = pMFGetPlaneSize(ptr->subtype->Data1, ptr->width, ptr->height, &size); ok(hr == S_OK, "%u: failed to get plane size, hr %#lx.\n", i, hr); - todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11) - || (IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0)) + todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)) ok(size == plane_size, "%u: unexpected plane size %lu, expected %u. Size %u x %u, format %s.\n", i, size, plane_size, ptr->width, ptr->height, wine_dbgstr_an((char*)&ptr->subtype->Data1, 4)); } @@ -5994,13 +5992,11 @@ static void test_MFCreate2DMediaBuffer(void) hr = IMF2DBuffer_GetContiguousLength(_2dbuffer, &length); ok(hr == S_OK, "Failed to get length, hr %#lx.\n", hr); - todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0) ok(length == ptr->contiguous_length, "%d: unexpected contiguous length %lu for %u x %u, format %s.\n", i, length, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype)); hr = IMFMediaBuffer_Lock(buffer, &data, &length2, NULL); ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr); - todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0) ok(length2 == ptr->contiguous_length, "%d: unexpected linear buffer length %lu for %u x %u, format %s.\n", i, length2, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype));
1
0
0
0
Shaun Ren : ir50_32: Implement open and close.
by Alexandre Julliard
07 Feb '23
07 Feb '23
Module: wine Branch: master Commit: 3dd09ed8f9ecf99439a372b6d0be076cef8aaef3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3dd09ed8f9ecf99439a372b6d0be07…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Fri Feb 3 02:16:34 2023 -0500 ir50_32: Implement open and close. --- dlls/ir50_32/Makefile.in | 3 ++- dlls/ir50_32/ir50.c | 19 ++++++++++++++++--- dlls/ir50_32/ir50_private.h | 2 ++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dlls/ir50_32/Makefile.in b/dlls/ir50_32/Makefile.in index 7bac0ccc9ca..2db9c8076c9 100644 --- a/dlls/ir50_32/Makefile.in +++ b/dlls/ir50_32/Makefile.in @@ -1,5 +1,6 @@ MODULE = ir50_32.dll -IMPORTS = user32 +IMPORTS = user32 mfplat mfuuid +DELAYIMPORTS = winegstreamer C_SRCS = \ ir50.c diff --git a/dlls/ir50_32/ir50.c b/dlls/ir50_32/ir50.c index 7e494d50761..428108f09ba 100644 --- a/dlls/ir50_32/ir50.c +++ b/dlls/ir50_32/ir50.c @@ -35,13 +35,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(ir50_32); static HINSTANCE IR50_32_hModule; #define IV50_MAGIC mmioFOURCC('I','V','5','0') +#define compare_fourcc(fcc1, fcc2) (((fcc1)^(fcc2))&~0x20202020) static LRESULT IV50_Open( const ICINFO *icinfo ) { - FIXME("DRV_OPEN %p\n", icinfo); - return 0; + IMFTransform *decoder = NULL; + + TRACE("DRV_OPEN %p\n", icinfo); + + if ( icinfo && compare_fourcc( icinfo->fccType, ICTYPE_VIDEO ) ) + return 0; + + if ( FAILED(winegstreamer_create_video_decoder( &decoder )) ) + return 0; + + return (LRESULT)decoder; } static LRESULT @@ -177,7 +187,10 @@ LRESULT WINAPI IV50_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg, break; case DRV_CLOSE: - FIXME("DRV_CLOSE\n"); + TRACE("DRV_CLOSE\n"); + if ( decoder ) + IMFTransform_Release( decoder ); + r = 1; break; case DRV_ENABLE: diff --git a/dlls/ir50_32/ir50_private.h b/dlls/ir50_32/ir50_private.h index c022a8196d2..c0b96bc17e4 100644 --- a/dlls/ir50_32/ir50_private.h +++ b/dlls/ir50_32/ir50_private.h @@ -31,4 +31,6 @@ #define IDS_NAME 100 #define IDS_DESCRIPTION 101 +HRESULT WINAPI winegstreamer_create_video_decoder(IMFTransform **out); + #endif /* __IR50_PRIVATE_H */
1
0
0
0
Shaun Ren : winegstreamer: Add video_decoder stub.
by Alexandre Julliard
07 Feb '23
07 Feb '23
Module: wine Branch: master Commit: 70e93833679342c485b9720af61c92efcdcbd191 URL:
https://gitlab.winehq.org/wine/wine/-/commit/70e93833679342c485b9720af61c92…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Wed Feb 1 21:53:57 2023 -0500 winegstreamer: Add video_decoder stub. --- MAINTAINERS | 1 + dlls/winegstreamer/Makefile.in | 1 + dlls/winegstreamer/video_decoder.c | 278 ++++++++++++++++++++++++++++++++++ dlls/winegstreamer/winegstreamer.spec | 1 + 4 files changed, 281 insertions(+)
1
0
0
0
Shaun Ren : ir50_32: Implement IV50_DecompressGetFormat.
by Alexandre Julliard
07 Feb '23
07 Feb '23
Module: wine Branch: master Commit: e8cfcbb2f4d4cd04e3ea77979214c4fccf503c92 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e8cfcbb2f4d4cd04e3ea77979214c4…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Wed Feb 1 01:42:13 2023 -0500 ir50_32: Implement IV50_DecompressGetFormat. --- dlls/ir50_32/ir50.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/dlls/ir50_32/ir50.c b/dlls/ir50_32/ir50.c index 92e4c8a49be..7e494d50761 100644 --- a/dlls/ir50_32/ir50.c +++ b/dlls/ir50_32/ir50.c @@ -97,8 +97,28 @@ IV50_DecompressQuery( LPBITMAPINFO in, LPBITMAPINFO out ) static LRESULT IV50_DecompressGetFormat( LPBITMAPINFO in, LPBITMAPINFO out ) { - FIXME("ICM_DECOMPRESS_GETFORMAT %p %p\n", in, out); - return ICERR_UNSUPPORTED; + DWORD size; + + TRACE("ICM_DECOMPRESS_GETFORMAT %p %p\n", in, out); + + if ( !in ) + return ICERR_BADPARAM; + + if ( in->bmiHeader.biCompression != IV50_MAGIC ) + return ICERR_BADFORMAT; + + size = in->bmiHeader.biSize; + if ( out ) + { + memcpy( out, in, size ); + out->bmiHeader.biHeight = abs(in->bmiHeader.biHeight); + out->bmiHeader.biCompression = BI_RGB; + out->bmiHeader.biBitCount = 32; + out->bmiHeader.biSizeImage = out->bmiHeader.biWidth * out->bmiHeader.biHeight * 4; + return ICERR_OK; + } + + return size; } static LRESULT IV50_DecompressBegin( IMFTransform *decoder, LPBITMAPINFO in, LPBITMAPINFO out )
1
0
0
0
Shaun Ren : ir50_32: Implement IV50_DecompressQuery.
by Alexandre Julliard
07 Feb '23
07 Feb '23
Module: wine Branch: master Commit: b979f3b8aa9cc395a6dfc314fc4f48af4ef215c4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b979f3b8aa9cc395a6dfc314fc4f48…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Wed Feb 1 01:38:30 2023 -0500 ir50_32: Implement IV50_DecompressQuery. --- dlls/ir50_32/ir50.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/dlls/ir50_32/ir50.c b/dlls/ir50_32/ir50.c index 0e1c9b4d2e4..92e4c8a49be 100644 --- a/dlls/ir50_32/ir50.c +++ b/dlls/ir50_32/ir50.c @@ -47,8 +47,51 @@ IV50_Open( const ICINFO *icinfo ) static LRESULT IV50_DecompressQuery( LPBITMAPINFO in, LPBITMAPINFO out ) { - FIXME("ICM_DECOMPRESS_QUERY %p %p\n", in, out); - return ICERR_UNSUPPORTED; + TRACE("ICM_DECOMPRESS_QUERY %p %p\n", in, out); + + TRACE("in->planes = %d\n", in->bmiHeader.biPlanes); + TRACE("in->bpp = %d\n", in->bmiHeader.biBitCount); + TRACE("in->height = %ld\n", in->bmiHeader.biHeight); + TRACE("in->width = %ld\n", in->bmiHeader.biWidth); + TRACE("in->compr = %#lx\n", in->bmiHeader.biCompression); + + if ( in->bmiHeader.biCompression != IV50_MAGIC ) + { + TRACE("can't do %#lx compression\n", in->bmiHeader.biCompression); + return ICERR_BADFORMAT; + } + + /* output must be same dimensions as input */ + if ( out ) + { + TRACE("out->planes = %d\n", out->bmiHeader.biPlanes); + TRACE("out->bpp = %d\n", out->bmiHeader.biBitCount); + TRACE("out->height = %ld\n", out->bmiHeader.biHeight); + TRACE("out->width = %ld\n", out->bmiHeader.biWidth); + TRACE("out->compr = %#lx\n", out->bmiHeader.biCompression); + + if ( out->bmiHeader.biCompression != BI_RGB ) + { + TRACE("incompatible compression requested\n"); + return ICERR_BADFORMAT; + } + + if ( out->bmiHeader.biBitCount != 32 && out->bmiHeader.biBitCount != 16 ) + { + TRACE("incompatible depth requested\n"); + return ICERR_BADFORMAT; + } + + if ( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes || + in->bmiHeader.biHeight != abs(out->bmiHeader.biHeight) || + in->bmiHeader.biWidth != out->bmiHeader.biWidth ) + { + TRACE("incompatible output dimensions requested\n"); + return ICERR_BADFORMAT; + } + } + + return ICERR_OK; } static LRESULT
1
0
0
0
← Newer
1
...
50
51
52
53
54
55
56
...
60
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Results per page:
10
25
50
100
200