Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 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
June 2022
- 68 participants
- 3274 messages
[PATCH 0/1] MR338: mmdevapi: Override product strings for DualSense controller audio devices
by Claire (@ClearlyClaire)
Some games expect the DualSense audio device (used for haptic feedback and controller speaker) to be called “Wireless Controller”.
This is the case of Final Fantasy XIV Online and Final Fantasy VII Remake Intergrade, and possibly other games as well. Together with !337, this is enough for all DualSense features to properly work with those games (provided the controller is plugged in before the game is started).
Note that this is not sufficient for many other games which have more elaborate logic for finding the DualSense audio output.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/338
June 29, 2022
Re: [PATCH v6 4/4] mfplat/tests: Merge and reorganize image format tests.
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them before resubmitting your patch.
If they are not new, fixing them anyway would help a lot. Otherwise
please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how
to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=117863
Your paranoid android.
=== w7u_el (32 bit report) ===
mfplat:
085c:mfplat: unhandled exception c0000005 at 71EF7D1C
=== debian11 (32 bit report) ===
Report validation errors:
mfplat:mfplat prints too much data (41310 bytes)
=== debian11 (32 bit WoW report) ===
Report validation errors:
mfplat:mfplat prints too much data (37054 bytes)
June 29, 2022
Re: [PATCH v6 2/4] mfplat/tests: Remove duplicated tests.
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them before resubmitting your patch.
If they are not new, fixing them anyway would help a lot. Otherwise
please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how
to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=117861
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors:
mfplat:mfplat prints too much data (41310 bytes)
=== debian11 (32 bit WoW report) ===
Report validation errors:
mfplat:mfplat prints too much data (36995 bytes)
June 29, 2022
Re: [PATCH v6 3/4] mfplat/buffer: Support YV12, I420 and IYUV image formats.
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them before resubmitting your patch.
If they are not new, fixing them anyway would help a lot. Otherwise
please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how
to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=117862
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors:
mfplat:mfplat prints too much data (41290 bytes)
=== debian11 (32 bit WoW report) ===
Report validation errors:
mfplat:mfplat prints too much data (41318 bytes)
June 29, 2022
Re: [PATCH v6 1/4] mfplat/buffer: Deduplicate common code between Lock2D() and Lock2DSize().
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them before resubmitting your patch.
If they are not new, fixing them anyway would help a lot. Otherwise
please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how
to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=117860
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors:
mfplat:mfplat prints too much data (41310 bytes)
=== debian11 (32 bit WoW report) ===
Report validation errors:
mfplat:mfplat prints too much data (38271 bytes)
June 29, 2022
[PATCH v6 4/4] mfplat/tests: Merge and reorganize image format tests.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
* Added
v4:
* Rebased on top of previous modifications
* Tweak the comments a little bit
---
dlls/mfplat/tests/mfplat.c | 290 ++++++++++++++++++-------------------
1 file changed, 141 insertions(+), 149 deletions(-)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index 0b02bd67172..dac9dad1004 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -4233,87 +4233,128 @@ static const struct image_size_test
UINT32 height;
UINT32 size;
UINT32 plane_size; /* Matches image size when 0. */
+ UINT32 max_length;
+ UINT32 contiguous_length;
+ UINT32 pitch;
}
image_size_tests[] =
{
- { &MFVideoFormat_RGB8, 3, 5, 20 },
- { &MFVideoFormat_RGB8, 1, 1, 4 },
- { &MFVideoFormat_RGB555, 3, 5, 40 },
- { &MFVideoFormat_RGB555, 1, 1, 4 },
- { &MFVideoFormat_RGB565, 3, 5, 40 },
- { &MFVideoFormat_RGB565, 1, 1, 4 },
- { &MFVideoFormat_RGB24, 3, 5, 60 },
- { &MFVideoFormat_RGB24, 1, 1, 4 },
- { &MFVideoFormat_RGB32, 3, 5, 60 },
- { &MFVideoFormat_RGB32, 1, 1, 4 },
- { &MFVideoFormat_ARGB32, 3, 5, 60 },
- { &MFVideoFormat_ARGB32, 1, 1, 4 },
- { &MFVideoFormat_A2R10G10B10, 3, 5, 60 },
- { &MFVideoFormat_A2R10G10B10, 1, 1, 4 },
- { &MFVideoFormat_A16B16G16R16F, 3, 5, 120 },
- { &MFVideoFormat_A16B16G16R16F, 1, 1, 8 },
-
- /* YUV */
- { &MFVideoFormat_NV12, 1, 3, 9, 4 },
- { &MFVideoFormat_NV12, 1, 2, 6, 3 },
- { &MFVideoFormat_NV12, 2, 2, 6, 6 },
- { &MFVideoFormat_NV12, 3, 2, 12, 9 },
- { &MFVideoFormat_NV12, 4, 2, 12 },
- { &MFVideoFormat_NV12, 320, 240, 115200 },
- { &MFVideoFormat_AYUV, 1, 1, 4 },
- { &MFVideoFormat_AYUV, 2, 1, 8 },
- { &MFVideoFormat_AYUV, 1, 2, 8 },
- { &MFVideoFormat_AYUV, 4, 3, 48 },
- { &MFVideoFormat_AYUV, 320, 240, 307200 },
- { &MFVideoFormat_IMC1, 1, 1, 4 },
- { &MFVideoFormat_IMC1, 2, 1, 4 },
- { &MFVideoFormat_IMC1, 1, 2, 8 },
- { &MFVideoFormat_IMC1, 4, 3, 24 },
- { &MFVideoFormat_IMC1, 320, 240, 153600 },
- { &MFVideoFormat_IMC3, 1, 1, 4 },
- { &MFVideoFormat_IMC3, 2, 1, 4 },
- { &MFVideoFormat_IMC3, 1, 2, 8 },
- { &MFVideoFormat_IMC3, 4, 3, 24 },
- { &MFVideoFormat_IMC3, 320, 240, 153600 },
- { &MFVideoFormat_IMC2, 1, 3, 9, 4 },
- { &MFVideoFormat_IMC2, 1, 2, 6, 3 },
- { &MFVideoFormat_IMC2, 2, 2, 6, 6 },
- { &MFVideoFormat_IMC2, 3, 2, 12, 9 },
- { &MFVideoFormat_IMC2, 4, 2, 12 },
- { &MFVideoFormat_IMC2, 320, 240, 115200 },
- { &MFVideoFormat_IMC4, 1, 3, 9, 4 },
- { &MFVideoFormat_IMC4, 1, 2, 6, 3 },
- { &MFVideoFormat_IMC4, 2, 2, 6, 6 },
- { &MFVideoFormat_IMC4, 3, 2, 12, 9 },
- { &MFVideoFormat_IMC4, 4, 2, 12 },
- { &MFVideoFormat_IMC4, 320, 240, 115200 },
- { &MFVideoFormat_YV12, 1, 1, 3, 1 },
- { &MFVideoFormat_YV12, 2, 1, 3 },
- { &MFVideoFormat_YV12, 1, 2, 6, 3 },
- { &MFVideoFormat_YV12, 4, 3, 18 },
- { &MFVideoFormat_YV12, 320, 240, 115200 },
-
- { &MFVideoFormat_I420, 1, 1, 3, 1 },
- { &MFVideoFormat_I420, 2, 1, 3 },
- { &MFVideoFormat_I420, 1, 2, 6, 3 },
- { &MFVideoFormat_I420, 4, 3, 18 },
- { &MFVideoFormat_I420, 320, 240, 115200 },
-
- { &MFVideoFormat_IYUV, 1, 1, 3, 1 },
- { &MFVideoFormat_IYUV, 2, 1, 3 },
- { &MFVideoFormat_IYUV, 1, 2, 6, 3 },
- { &MFVideoFormat_IYUV, 4, 3, 18 },
- { &MFVideoFormat_IYUV, 320, 240, 115200 },
-
- { &MFVideoFormat_YUY2, 2, 1, 4 },
- { &MFVideoFormat_YUY2, 4, 3, 24 },
- { &MFVideoFormat_YUY2, 128, 128, 32768 },
- { &MFVideoFormat_YUY2, 320, 240, 153600 },
-
- { &MFVideoFormat_UYVY, 2, 1, 4 },
- { &MFVideoFormat_UYVY, 4, 3, 24 },
- { &MFVideoFormat_UYVY, 128, 128, 32768 },
- { &MFVideoFormat_UYVY, 320, 240, 153600 },
+ /* RGB */
+ { &MFVideoFormat_RGB8, 3, 5, 20, 0, 320, 20, 64 },
+ { &MFVideoFormat_RGB8, 1, 1, 4, 0, 64, 4, 64 },
+ { &MFVideoFormat_RGB555, 3, 5, 40, 0, 320, 40, 64 },
+ { &MFVideoFormat_RGB555, 1, 1, 4, 0, 64, 4, 64 },
+ { &MFVideoFormat_RGB565, 3, 5, 40, 0, 320, 40, 64 },
+ { &MFVideoFormat_RGB565, 1, 1, 4, 0, 64, 4, 64 },
+ { &MFVideoFormat_RGB24, 3, 5, 60, 0, 320, 60, 64 },
+ { &MFVideoFormat_RGB24, 1, 1, 4, 0, 64, 4, 64 },
+ { &MFVideoFormat_RGB32, 3, 5, 60, 0, 320, 60, 64 },
+ { &MFVideoFormat_RGB32, 1, 1, 4, 0, 64, 4, 64 },
+ { &MFVideoFormat_ARGB32, 3, 5, 60, 0, 320, 60, 64 },
+ { &MFVideoFormat_ARGB32, 1, 1, 4, 0, 64, 4, 64 },
+ { &MFVideoFormat_A2R10G10B10, 3, 5, 60, 0, 320, 60, 64 },
+ { &MFVideoFormat_A2R10G10B10, 1, 1, 4, 0, 64, 4, 64 },
+ { &MFVideoFormat_A16B16G16R16F, 3, 5, 120, 0, 320, 120, 64 },
+ { &MFVideoFormat_A16B16G16R16F, 1, 1, 8, 0, 64, 8, 64 },
+
+ /* YUV 4:4:4, 32 bpp, packed */
+ { &MFVideoFormat_AYUV, 1, 1, 4, 0, 64, 4, 64 },
+ { &MFVideoFormat_AYUV, 2, 1, 8, 0, 64, 8, 64 },
+ { &MFVideoFormat_AYUV, 1, 2, 8, 0, 128, 8, 64 },
+ { &MFVideoFormat_AYUV, 4, 3, 48, 0, 192, 48, 64 },
+ { &MFVideoFormat_AYUV, 320, 240, 307200, 0, 307200, 307200, 1280 },
+
+ /* YUV 4:2:2, 16 bpp, packed */
+ { &MFVideoFormat_YUY2, 2, 1, 4, 0, 64, 4, 64 },
+ { &MFVideoFormat_YUY2, 4, 3, 24, 0, 192, 24, 64 },
+ { &MFVideoFormat_YUY2, 128, 128, 32768, 0, 32768, 32768, 256 },
+ { &MFVideoFormat_YUY2, 320, 240, 153600, 0, 153600, 153600, 640 },
+
+ { &MFVideoFormat_UYVY, 2, 1, 4, 0, 64, 4, 64 },
+ { &MFVideoFormat_UYVY, 4, 3, 24, 0, 192, 24, 64 },
+ { &MFVideoFormat_UYVY, 128, 128, 32768, 0, 32768, 32768, 256 },
+ { &MFVideoFormat_UYVY, 320, 240, 153600, 0, 153600, 153600, 640 },
+
+ /* YUV 4:2:0, 16 bpp, planar (the secondary plane has the same
+ * height, half the width and the same stride as the primary
+ * one) */
+ { &MFVideoFormat_IMC1, 1, 1, 4, 0, 256, 8, 128 },
+ { &MFVideoFormat_IMC1, 2, 1, 4, 0, 256, 8, 128 },
+ { &MFVideoFormat_IMC1, 1, 2, 8, 0, 512, 16, 128 },
+ { &MFVideoFormat_IMC1, 2, 2, 8, 0, 512, 16, 128 },
+ { &MFVideoFormat_IMC1, 2, 4, 16, 0, 1024, 32, 128 },
+ { &MFVideoFormat_IMC1, 4, 2, 16, 0, 512, 32, 128 },
+ { &MFVideoFormat_IMC1, 4, 3, 24, 0, 768, 48, 128 },
+ { &MFVideoFormat_IMC1, 320, 240, 153600, 0, 307200, 307200, 640 },
+
+ { &MFVideoFormat_IMC3, 1, 1, 4, 0, 256, 8, 128 },
+ { &MFVideoFormat_IMC3, 2, 1, 4, 0, 256, 8, 128 },
+ { &MFVideoFormat_IMC3, 1, 2, 8, 0, 512, 16, 128 },
+ { &MFVideoFormat_IMC3, 2, 2, 8, 0, 512, 16, 128 },
+ { &MFVideoFormat_IMC3, 2, 4, 16, 0, 1024, 32, 128 },
+ { &MFVideoFormat_IMC3, 4, 2, 16, 0, 512, 32, 128 },
+ { &MFVideoFormat_IMC3, 4, 3, 24, 0, 768, 48, 128 },
+ { &MFVideoFormat_IMC3, 320, 240, 153600, 0, 307200, 307200, 640 },
+
+ /* YUV 4:2:0, 12 bpp, planar, full stride (the secondary plane has
+ * half the height, the same width and the same stride as the
+ * primary one) */
+ { &MFVideoFormat_NV12, 1, 3, 9, 4, 288, 4, 64 },
+ { &MFVideoFormat_NV12, 1, 2, 6, 3, 192, 3, 64 },
+ { &MFVideoFormat_NV12, 2, 2, 6, 6, 192, 6, 64 },
+ { &MFVideoFormat_NV12, 2, 4, 12, 0, 384, 12, 64 },
+ { &MFVideoFormat_NV12, 3, 2, 12, 9, 192, 9, 64 },
+ { &MFVideoFormat_NV12, 4, 2, 12, 0, 192, 12, 64 },
+ { &MFVideoFormat_NV12, 320, 240, 115200, 0, 115200, 115200, 320 },
+
+ /* YUV 4:2:0, 12 bpp, planar, half stride (the secondary plane has
+ * the same height, half the width and half the stride of the
+ * primary one) */
+ { &MFVideoFormat_IMC2, 1, 3, 9, 4, 576, 3, 128 },
+ { &MFVideoFormat_IMC2, 3, 5, 30, 22, 960, 20, 128 },
+ { &MFVideoFormat_IMC2, 1, 2, 6, 3, 384, 2, 128 },
+ { &MFVideoFormat_IMC2, 2, 2, 6, 6, 384, 6, 128 },
+ { &MFVideoFormat_IMC2, 2, 4, 12, 0, 768, 12, 128 },
+ { &MFVideoFormat_IMC2, 3, 2, 12, 9, 384, 8, 128 },
+ { &MFVideoFormat_IMC2, 4, 2, 12, 0, 384, 12, 128 },
+ { &MFVideoFormat_IMC2, 320, 240, 115200, 0, 138240, 115200, 384 },
+
+ { &MFVideoFormat_IMC4, 1, 3, 9, 4, 576, 3, 128 },
+ { &MFVideoFormat_IMC4, 3, 5, 30, 22, 960, 20, 128 },
+ { &MFVideoFormat_IMC4, 1, 2, 6, 3, 384, 2, 128 },
+ { &MFVideoFormat_IMC4, 2, 2, 6, 6, 384, 6, 128 },
+ { &MFVideoFormat_IMC4, 2, 4, 12, 0, 768, 12, 128 },
+ { &MFVideoFormat_IMC4, 3, 2, 12, 9, 384, 8, 128 },
+ { &MFVideoFormat_IMC4, 4, 2, 12, 0, 384, 12, 128 },
+ { &MFVideoFormat_IMC4, 320, 240, 115200, 0, 138240, 115200, 384 },
+
+ { &MFVideoFormat_YV12, 1, 1, 3, 1, 192, 1, 128 },
+ { &MFVideoFormat_YV12, 2, 1, 3, 0, 192, 3, 128 },
+ { &MFVideoFormat_YV12, 1, 2, 6, 3, 384, 2, 128 },
+ { &MFVideoFormat_YV12, 2, 2, 6, 0, 384, 6, 128 },
+ { &MFVideoFormat_YV12, 2, 4, 12, 0, 768, 12, 128 },
+ { &MFVideoFormat_YV12, 4, 2, 12, 0, 384, 12, 128 },
+ { &MFVideoFormat_YV12, 4, 3, 18, 0, 576, 18, 128 },
+ { &MFVideoFormat_YV12, 320, 240, 115200, 0, 138240, 115200, 384 },
+
+ { &MFVideoFormat_I420, 1, 1, 3, 1, 192, 1, 128 },
+ { &MFVideoFormat_I420, 2, 1, 3, 0, 192, 3, 128 },
+ { &MFVideoFormat_I420, 1, 2, 6, 3, 384, 2, 128 },
+ { &MFVideoFormat_I420, 2, 2, 6, 0, 384, 6, 128 },
+ { &MFVideoFormat_I420, 2, 4, 12, 0, 768, 12, 128 },
+ { &MFVideoFormat_I420, 4, 2, 12, 0, 384, 12, 128 },
+ { &MFVideoFormat_I420, 4, 3, 18, 0, 576, 18, 128 },
+ { &MFVideoFormat_I420, 320, 240, 115200, 0, 138240, 115200, 384 },
+
+ { &MFVideoFormat_IYUV, 1, 1, 3, 1, 192, 1, 128 },
+ { &MFVideoFormat_IYUV, 2, 1, 3, 0, 192, 3, 128 },
+ { &MFVideoFormat_IYUV, 1, 2, 6, 3, 384, 2, 128 },
+ { &MFVideoFormat_IYUV, 2, 2, 6, 0, 384, 6, 128 },
+ { &MFVideoFormat_IYUV, 2, 4, 12, 0, 768, 12, 128 },
+ { &MFVideoFormat_IYUV, 4, 2, 12, 0, 384, 12, 128 },
+ { &MFVideoFormat_IYUV, 4, 3, 18, 0, 576, 18, 128 },
+ { &MFVideoFormat_IYUV, 320, 240, 115200, 0, 138240, 115200, 384 },
+
};
static void test_MFCalculateImageSize(void)
@@ -4366,7 +4407,8 @@ 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);
- ok(size == plane_size, "%u: unexpected plane size %lu, expected %u.\n", i, size, plane_size);
+ 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));
}
}
@@ -5706,61 +5748,6 @@ static void test_MFGetStrideForBitmapInfoHeader(void)
static void test_MFCreate2DMediaBuffer(void)
{
- static const struct _2d_buffer_test
- {
- unsigned int width;
- unsigned int height;
- unsigned int fourcc;
- unsigned int contiguous_length;
- int pitch;
- unsigned int max_length;
- } _2d_buffer_tests[] =
- {
- { 2, 2, MAKEFOURCC('N','V','1','2'), 6, 64, 192 },
- { 4, 2, MAKEFOURCC('N','V','1','2'), 12, 64 },
- { 2, 4, MAKEFOURCC('N','V','1','2'), 12, 64 },
- { 1, 3, MAKEFOURCC('N','V','1','2'), 4, 64 },
- { 4, 16, MAKEFOURCC('N','V','1','2'), 96, 64, 1536 },
-
- { 2, 2, MAKEFOURCC('I','M','C','2'), 6, 128, 384 },
- { 4, 2, MAKEFOURCC('I','M','C','2'), 12, 128 },
- { 2, 4, MAKEFOURCC('I','M','C','2'), 12, 128 },
- { 3, 5, MAKEFOURCC('I','M','C','2'), 20, 128 },
- { 2, 2, MAKEFOURCC('I','M','C','4'), 6, 128 },
- { 4, 2, MAKEFOURCC('I','M','C','4'), 12, 128 },
- { 2, 4, MAKEFOURCC('I','M','C','4'), 12, 128 },
- { 3, 5, MAKEFOURCC('I','M','C','4'), 20, 128 },
-
- { 4, 2, MAKEFOURCC('I','M','C','1'), 32, 128 },
- { 4, 4, MAKEFOURCC('I','M','C','1'), 64, 128 },
- { 4, 16, MAKEFOURCC('I','M','C','1'), 256, 128, 4096 },
- { 4, 20, MAKEFOURCC('I','M','C','1'), 320, 128 },
-
- { 4, 2, MAKEFOURCC('I','M','C','3'), 32, 128 },
- { 4, 4, MAKEFOURCC('I','M','C','3'), 64, 128 },
- { 4, 16, MAKEFOURCC('I','M','C','3'), 256, 128, 4096 },
- { 4, 20, MAKEFOURCC('I','M','C','3'), 320, 128 },
-
- { 4, 2, MAKEFOURCC('Y','V','1','2'), 12, 128 },
- { 4, 4, MAKEFOURCC('Y','V','1','2'), 24, 128 },
- { 4, 16, MAKEFOURCC('Y','V','1','2'), 96, 128, 3072 },
-
- { 4, 2, MAKEFOURCC('A','Y','U','V'), 32, 64 },
- { 4, 4, MAKEFOURCC('A','Y','U','V'), 64, 64 },
- { 4, 16, MAKEFOURCC('A','Y','U','V'), 256, 64, 1024 },
-
- { 4, 2, MAKEFOURCC('Y','U','Y','2'), 16, 64 },
- { 4, 4, MAKEFOURCC('Y','U','Y','2'), 32, 64 },
- { 4, 16, MAKEFOURCC('Y','U','Y','2'), 128, 64, 1024 },
-
- { 4, 2, MAKEFOURCC('U','Y','V','Y'), 16, 64 },
- { 4, 4, MAKEFOURCC('U','Y','V','Y'), 32, 64 },
- { 4, 16, MAKEFOURCC('U','Y','V','Y'), 128, 64, 1024 },
-
- { 2, 4, D3DFMT_A8R8G8B8, 32, 64 },
- { 1, 4, D3DFMT_A8R8G8B8, 16, 64 },
- { 4, 1, D3DFMT_A8R8G8B8, 16, 64 },
- };
static const char two_aas[] = { 0xaa, 0xaa };
static const char eight_bbs[] = { 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb };
DWORD max_length, length, length2;
@@ -5958,18 +5945,17 @@ static void test_MFCreate2DMediaBuffer(void)
IMFMediaBuffer_Release(buffer);
- for (i = 0; i < ARRAY_SIZE(_2d_buffer_tests); ++i)
+ for (i = 0; i < ARRAY_SIZE(image_size_tests); ++i)
{
- const struct _2d_buffer_test *ptr = &_2d_buffer_tests[i];
+ const struct image_size_test *ptr = &image_size_tests[i];
- hr = pMFCreate2DMediaBuffer(ptr->width, ptr->height, ptr->fourcc, FALSE, &buffer);
+ hr = pMFCreate2DMediaBuffer(ptr->width, ptr->height, ptr->subtype->Data1, FALSE, &buffer);
ok(hr == S_OK, "Failed to create a buffer, hr %#lx.\n", hr);
hr = IMFMediaBuffer_GetMaxLength(buffer, &length);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
- if (ptr->max_length)
- ok(length == ptr->max_length, "%u: unexpected maximum length %lu for %u x %u, format %s.\n",
- i, length, ptr->width, ptr->height, wine_dbgstr_an((char *)&ptr->fourcc, 4));
+ ok(length == ptr->max_length, "%u: unexpected maximum length %lu for %u x %u, format %s.\n",
+ i, length, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype));
hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&_2dbuffer);
ok(hr == S_OK, "Failed to get interface, hr %#lx.\n", hr);
@@ -5977,14 +5963,14 @@ static void test_MFCreate2DMediaBuffer(void)
hr = IMF2DBuffer_GetContiguousLength(_2dbuffer, &length);
ok(hr == S_OK, "Failed to get length, hr %#lx.\n", hr);
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_an((char *)&ptr->fourcc, 4));
+ 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);
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_an((char *)&ptr->fourcc, 4));
+ i, length2, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype));
- hr = pMFGetStrideForBitmapInfoHeader(ptr->fourcc, ptr->width, &stride);
+ hr = pMFGetStrideForBitmapInfoHeader(ptr->subtype->Data1, ptr->width, &stride);
ok(hr == S_OK, "Failed to get stride, hr %#lx.\n", hr);
stride = abs(stride);
@@ -5998,7 +5984,7 @@ static void test_MFCreate2DMediaBuffer(void)
data += ptr->height * stride;
/* secondary planes */
- switch (ptr->fourcc)
+ switch (ptr->subtype->Data1)
{
case MAKEFOURCC('I','M','C','1'):
case MAKEFOURCC('I','M','C','3'):
@@ -6011,6 +5997,9 @@ static void test_MFCreate2DMediaBuffer(void)
case MAKEFOURCC('I','M','C','2'):
case MAKEFOURCC('I','M','C','4'):
+ case MAKEFOURCC('Y','V','1','2'):
+ case MAKEFOURCC('I','4','2','0'):
+ case MAKEFOURCC('I','Y','U','V'):
ok(stride * 3 / 2 * ptr->height <= length2, "Insufficient buffer space: expected at least %lu bytes, got only %lu\n",
stride * 3 / 2 * ptr->height, length2);
for (j = 0; j < ptr->height; j++)
@@ -6048,7 +6037,7 @@ static void test_MFCreate2DMediaBuffer(void)
data += ptr->height * pitch;
/* secondary planes */
- switch (ptr->fourcc)
+ switch (ptr->subtype->Data1)
{
case MAKEFOURCC('I','M','C','1'):
case MAKEFOURCC('I','M','C','3'):
@@ -6061,6 +6050,9 @@ static void test_MFCreate2DMediaBuffer(void)
case MAKEFOURCC('I','M','C','2'):
case MAKEFOURCC('I','M','C','4'):
+ case MAKEFOURCC('Y','V','1','2'):
+ case MAKEFOURCC('I','4','2','0'):
+ case MAKEFOURCC('I','Y','U','V'):
for (j = 0; j < ptr->height; j++)
for (k = 0; k < stride / 2; k++)
ok(data[j * (pitch / 2) + k] == (((j + ptr->height) % 16) << 4) + (k % 16),
@@ -6084,7 +6076,7 @@ static void test_MFCreate2DMediaBuffer(void)
ok(hr == S_OK, "Failed to unlock buffer, hr %#lx.\n", hr);
ok(pitch == ptr->pitch, "%d: unexpected pitch %ld, expected %d, %u x %u, format %s.\n", i, pitch, ptr->pitch,
- ptr->width, ptr->height, wine_dbgstr_an((char *)&ptr->fourcc, 4));
+ ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype));
ret = TRUE;
hr = IMF2DBuffer_IsContiguousFormat(_2dbuffer, &ret);
@@ -6097,11 +6089,11 @@ static void test_MFCreate2DMediaBuffer(void)
}
/* Alignment tests */
- for (i = 0; i < ARRAY_SIZE(_2d_buffer_tests); ++i)
+ for (i = 0; i < ARRAY_SIZE(image_size_tests); ++i)
{
- const struct _2d_buffer_test *ptr = &_2d_buffer_tests[i];
+ const struct image_size_test *ptr = &image_size_tests[i];
- hr = pMFCreate2DMediaBuffer(ptr->width, ptr->height, ptr->fourcc, FALSE, &buffer);
+ hr = pMFCreate2DMediaBuffer(ptr->width, ptr->height, ptr->subtype->Data1, FALSE, &buffer);
ok(hr == S_OK, "Failed to create a buffer, hr %#lx.\n", hr);
hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&_2dbuffer);
--
2.36.1
June 29, 2022
[PATCH v6 3/4] mfplat/buffer: Support YV12, I420 and IYUV image formats.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
* Added
v4:
* Fix typo in subject
---
dlls/mfplat/buffer.c | 36 ++++++++++++++++++++++++++----------
1 file changed, 26 insertions(+), 10 deletions(-)
diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c
index e3d38438b88..6f06eb25992 100644
--- a/dlls/mfplat/buffer.c
+++ b/dlls/mfplat/buffer.c
@@ -1315,13 +1315,25 @@ static HRESULT create_1d_buffer(DWORD max_length, DWORD alignment, IMFMediaBuffe
static p_copy_image_func get_2d_buffer_copy_func(DWORD fourcc)
{
- if (fourcc == MAKEFOURCC('N','V','1','2'))
- return copy_image_nv12;
- if (fourcc == MAKEFOURCC('I','M','C','1') || fourcc == MAKEFOURCC('I','M','C','3'))
- return copy_image_imc1;
- if (fourcc == MAKEFOURCC('I','M','C','2') || fourcc == MAKEFOURCC('I','M','C','4'))
- return copy_image_imc2;
- return NULL;
+ switch (fourcc)
+ {
+ case MAKEFOURCC('N','V','1','2'):
+ return copy_image_nv12;
+
+ case MAKEFOURCC('I','M','C','1'):
+ case MAKEFOURCC('I','M','C','3'):
+ return copy_image_imc1;
+
+ case MAKEFOURCC('I','M','C','2'):
+ case MAKEFOURCC('I','M','C','4'):
+ case MAKEFOURCC('Y','V','1','2'):
+ case MAKEFOURCC('I','4','2','0'):
+ case MAKEFOURCC('I','Y','U','V'):
+ return copy_image_imc2;
+
+ default:
+ return NULL;
+ }
}
static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bottom_up, IMFMediaBuffer **buffer)
@@ -1357,12 +1369,12 @@ 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'):
- plane_size = stride * 3 / 2 * height;
- break;
- case MAKEFOURCC('N','V','1','2'):
case MAKEFOURCC('Y','V','1','2'):
case MAKEFOURCC('I','4','2','0'):
case MAKEFOURCC('I','Y','U','V'):
+ plane_size = stride * 3 / 2 * height;
+ break;
+ case MAKEFOURCC('N','V','1','2'):
plane_size = stride * height * 3 / 2;
break;
default:
@@ -1379,6 +1391,8 @@ 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('I','4','2','0'):
+ case MAKEFOURCC('I','Y','U','V'):
row_alignment = MF_128_BYTE_ALIGNMENT;
break;
default:
@@ -1397,6 +1411,8 @@ 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('I','4','2','0'):
+ case MAKEFOURCC('I','Y','U','V'):
max_length = pitch * height * 3 / 2;
break;
default:
--
2.36.1
June 29, 2022
[PATCH v6 2/4] mfplat/tests: Remove duplicated tests.
by Giovanni Mascellani
The same tests are already performed in test_MFGetPlaneSize().
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
* Added
---
dlls/mfplat/tests/mfplat.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index 48f7a444add..0b02bd67172 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -4318,7 +4318,6 @@ image_size_tests[] =
static void test_MFCalculateImageSize(void)
{
- DWORD plane_size;
unsigned int i;
UINT32 size;
HRESULT hr;
@@ -4340,15 +4339,6 @@ static void test_MFCalculateImageSize(void)
ok(hr == S_OK || (is_broken && hr == E_INVALIDARG), "%u: failed to calculate image size, hr %#lx.\n", i, hr);
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));
-
- if (pMFGetPlaneSize)
- {
- unsigned int expected = ptr->plane_size ? ptr->plane_size : ptr->size;
-
- hr = pMFGetPlaneSize(ptr->subtype->Data1, ptr->width, ptr->height, &plane_size);
- ok(hr == S_OK, "%u: failed to get plane size, hr %#lx.\n", i, hr);
- ok(plane_size == expected, "%u: unexpected plane size %lu, expected %u.\n", i, plane_size, expected);
- }
}
}
--
2.36.1
June 29, 2022
[PATCH v6 1/4] mfplat/buffer: Deduplicate common code between Lock2D() and Lock2DSize().
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
* Remove the trace in memory_2d_buffer_Lock2D()
v3:
* Redirect all invocations to helper functions.
v4:
* Rework helper functions.
v6: (sorry for these silly mistakes...)
* Remove a LeaveCriticalSection() too much.
* Consistently use _lock suffix
---
dlls/mfplat/buffer.c | 101 +++++++++++++++++++++----------------------
1 file changed, 50 insertions(+), 51 deletions(-)
diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c
index a7ba306223d..e3d38438b88 100644
--- a/dlls/mfplat/buffer.c
+++ b/dlls/mfplat/buffer.c
@@ -655,18 +655,11 @@ static const IMF2DBuffer2Vtbl memory_2d_buffer_vtbl =
memory_2d_buffer_Copy2DTo,
};
-static HRESULT WINAPI d3d9_surface_buffer_Lock2D(IMF2DBuffer2 *iface, BYTE **scanline0, LONG *pitch)
+static HRESULT d3d9_surface_buffer_lock(struct buffer *buffer, MF2DBuffer_LockFlags flags, BYTE **scanline0,
+ LONG *pitch, BYTE **buffer_start, DWORD *buffer_length)
{
- struct buffer *buffer = impl_from_IMF2DBuffer2(iface);
HRESULT hr = S_OK;
- TRACE("%p, %p, %p.\n", iface, scanline0, pitch);
-
- if (!scanline0 || !pitch)
- return E_POINTER;
-
- EnterCriticalSection(&buffer->cs);
-
if (buffer->_2d.linear_buffer)
hr = MF_E_UNEXPECTED;
else if (!buffer->_2d.locks)
@@ -679,8 +672,29 @@ static HRESULT WINAPI d3d9_surface_buffer_Lock2D(IMF2DBuffer2 *iface, BYTE **sca
buffer->_2d.locks++;
*scanline0 = buffer->d3d9_surface.rect.pBits;
*pitch = buffer->d3d9_surface.rect.Pitch;
+ if (buffer_start)
+ *buffer_start = *scanline0;
+ if (buffer_length)
+ *buffer_length = buffer->d3d9_surface.rect.Pitch * buffer->_2d.height;
}
+ return hr;
+}
+
+static HRESULT WINAPI d3d9_surface_buffer_Lock2D(IMF2DBuffer2 *iface, BYTE **scanline0, LONG *pitch)
+{
+ struct buffer *buffer = impl_from_IMF2DBuffer2(iface);
+ HRESULT hr;
+
+ TRACE("%p, %p, %p.\n", iface, scanline0, pitch);
+
+ if (!scanline0 || !pitch)
+ return E_POINTER;
+
+ EnterCriticalSection(&buffer->cs);
+
+ hr = d3d9_surface_buffer_lock(buffer, MF2DBuffer_LockFlags_ReadWrite, scanline0, pitch, NULL, NULL);
+
LeaveCriticalSection(&buffer->cs);
return hr;
@@ -744,7 +758,7 @@ static HRESULT WINAPI d3d9_surface_buffer_Lock2DSize(IMF2DBuffer2 *iface, MF2DBu
LONG *pitch, BYTE **buffer_start, DWORD *buffer_length)
{
struct buffer *buffer = impl_from_IMF2DBuffer2(iface);
- HRESULT hr = S_OK;
+ HRESULT hr;
TRACE("%p, %#x, %p, %p, %p, %p.\n", iface, flags, scanline0, pitch, buffer_start, buffer_length);
@@ -753,23 +767,7 @@ static HRESULT WINAPI d3d9_surface_buffer_Lock2DSize(IMF2DBuffer2 *iface, MF2DBu
EnterCriticalSection(&buffer->cs);
- if (buffer->_2d.linear_buffer)
- hr = MF_E_UNEXPECTED;
- else if (!buffer->_2d.locks)
- {
- hr = IDirect3DSurface9_LockRect(buffer->d3d9_surface.surface, &buffer->d3d9_surface.rect, NULL, 0);
- }
-
- if (SUCCEEDED(hr))
- {
- buffer->_2d.locks++;
- *scanline0 = buffer->d3d9_surface.rect.pBits;
- *pitch = buffer->d3d9_surface.rect.Pitch;
- if (buffer_start)
- *buffer_start = *scanline0;
- if (buffer_length)
- *buffer_length = buffer->d3d9_surface.rect.Pitch * buffer->_2d.height;
- }
+ hr = d3d9_surface_buffer_lock(buffer, flags, scanline0, pitch, buffer_start, buffer_length);
LeaveCriticalSection(&buffer->cs);
@@ -1030,18 +1028,11 @@ static HRESULT WINAPI dxgi_surface_buffer_SetCurrentLength(IMFMediaBuffer *iface
return S_OK;
}
-static HRESULT WINAPI dxgi_surface_buffer_Lock2D(IMF2DBuffer2 *iface, BYTE **scanline0, LONG *pitch)
+static HRESULT dxgi_surface_buffer_lock(struct buffer *buffer, MF2DBuffer_LockFlags flags,
+ BYTE **scanline0, LONG *pitch, BYTE **buffer_start, DWORD *buffer_length)
{
- struct buffer *buffer = impl_from_IMF2DBuffer2(iface);
HRESULT hr = S_OK;
- TRACE("%p, %p, %p.\n", iface, scanline0, pitch);
-
- if (!scanline0 || !pitch)
- return E_POINTER;
-
- EnterCriticalSection(&buffer->cs);
-
if (buffer->_2d.linear_buffer)
hr = MF_E_UNEXPECTED;
else if (!buffer->_2d.locks++)
@@ -1051,8 +1042,29 @@ static HRESULT WINAPI dxgi_surface_buffer_Lock2D(IMF2DBuffer2 *iface, BYTE **sca
{
*scanline0 = buffer->dxgi_surface.map_desc.pData;
*pitch = buffer->dxgi_surface.map_desc.RowPitch;
+ if (buffer_start)
+ *buffer_start = *scanline0;
+ if (buffer_length)
+ *buffer_length = buffer->dxgi_surface.map_desc.RowPitch * buffer->_2d.height;
}
+ return hr;
+}
+
+static HRESULT WINAPI dxgi_surface_buffer_Lock2D(IMF2DBuffer2 *iface, BYTE **scanline0, LONG *pitch)
+{
+ struct buffer *buffer = impl_from_IMF2DBuffer2(iface);
+ HRESULT hr;
+
+ TRACE("%p, %p, %p.\n", iface, scanline0, pitch);
+
+ if (!scanline0 || !pitch)
+ return E_POINTER;
+
+ EnterCriticalSection(&buffer->cs);
+
+ hr = dxgi_surface_buffer_lock(buffer, MF2DBuffer_LockFlags_ReadWrite, scanline0, pitch, NULL, NULL);
+
LeaveCriticalSection(&buffer->cs);
return hr;
@@ -1113,7 +1125,7 @@ static HRESULT WINAPI dxgi_surface_buffer_Lock2DSize(IMF2DBuffer2 *iface, MF2DBu
BYTE **scanline0, LONG *pitch, BYTE **buffer_start, DWORD *buffer_length)
{
struct buffer *buffer = impl_from_IMF2DBuffer2(iface);
- HRESULT hr = S_OK;
+ HRESULT hr;
TRACE("%p, %#x, %p, %p, %p, %p.\n", iface, flags, scanline0, pitch, buffer_start, buffer_length);
@@ -1122,20 +1134,7 @@ static HRESULT WINAPI dxgi_surface_buffer_Lock2DSize(IMF2DBuffer2 *iface, MF2DBu
EnterCriticalSection(&buffer->cs);
- if (buffer->_2d.linear_buffer)
- hr = MF_E_UNEXPECTED;
- else if (!buffer->_2d.locks++)
- hr = dxgi_surface_buffer_map(buffer);
-
- if (SUCCEEDED(hr))
- {
- *scanline0 = buffer->dxgi_surface.map_desc.pData;
- *pitch = buffer->dxgi_surface.map_desc.RowPitch;
- if (buffer_start)
- *buffer_start = *scanline0;
- if (buffer_length)
- *buffer_length = buffer->dxgi_surface.map_desc.RowPitch * buffer->_2d.height;
- }
+ hr = dxgi_surface_buffer_lock(buffer, flags, scanline0, pitch, buffer_start, buffer_length);
LeaveCriticalSection(&buffer->cs);
--
2.36.1
June 29, 2022
[PATCH 1/1] winepulse: Return device-specific values for GetMixFormat and GetDevicePeriod
by Claire Girka
From: Claire Girka <claire(a)sitedethib.com>
When GetMixFormat or GetDevicePeriod are used, return values specific to the
selected device instead of those of the default one. This is especially useful
when the audio devices features less channels than one specifically selected
by the application.
---
dlls/winepulse.drv/mmdevdrv.c | 32 ++++++++++++++-
dlls/winepulse.drv/pulse.c | 74 ++++++++++++++++++++++++++++++-----
dlls/winepulse.drv/unixlib.h | 19 +++++++++
3 files changed, 114 insertions(+), 11 deletions(-)
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c
index 3cbbc1d8115..1bc32c6a343 100644
--- a/dlls/winepulse.drv/mmdevdrv.c
+++ b/dlls/winepulse.drv/mmdevdrv.c
@@ -1142,7 +1142,20 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient3 *iface,
if (!pwfx)
return E_POINTER;
- *pwfx = clone_format(&pulse_config.modes[This->dataflow == eCapture].format.Format);
+ if (This->pulse_name[0]) {
+ struct get_device_mix_format_params params;
+ params.render = This->dataflow == eRender;
+ params.pulse_name = This->pulse_name;
+ pulse_call(get_device_mix_format, ¶ms);
+
+ if (FAILED(params.result))
+ return params.result;
+
+ *pwfx = clone_format(¶ms.fmt.Format);
+ } else {
+ *pwfx = clone_format(&pulse_config.modes[This->dataflow == eCapture].format.Format);
+ }
+
if (!*pwfx)
return E_OUTOFMEMORY;
dump_fmt(*pwfx);
@@ -1159,6 +1172,23 @@ static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient3 *iface,
if (!defperiod && !minperiod)
return E_POINTER;
+ if (This->pulse_name[0]) {
+ struct get_device_period_params params;
+ params.render = This->dataflow == eRender;
+ params.pulse_name = This->pulse_name;
+ pulse_call(get_device_period, ¶ms);
+
+ if (FAILED(params.result))
+ return params.result;
+
+ if (defperiod)
+ *defperiod = params.def_period;
+ if (minperiod)
+ *minperiod = params.min_period;
+
+ return S_OK;
+ }
+
if (defperiod)
*defperiod = pulse_config.modes[This->dataflow == eCapture].def_period;
if (minperiod)
diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c
index 42d73db45f9..f113d1b2a62 100644
--- a/dlls/winepulse.drv/pulse.c
+++ b/dlls/winepulse.drv/pulse.c
@@ -89,6 +89,8 @@ typedef struct _PhysDevice {
EndpointFormFactor form;
UINT channel_mask;
UINT index;
+ REFERENCE_TIME min_period, def_period;
+ WAVEFORMATEXTENSIBLE fmt;
char pulse_name[0];
} PhysDevice;
@@ -539,6 +541,7 @@ static void pulse_add_device(struct list *list, pa_proplist *proplist, int index
free(dev);
return;
}
+
dev->form = form;
dev->index = index;
dev->channel_mask = channel_mask;
@@ -659,7 +662,7 @@ static void convert_channel_map(const pa_channel_map *pa_map, WAVEFORMATEXTENSIB
fmt->dwChannelMask = pa_mask;
}
-static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) {
+static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt, REFERENCE_TIME *def_period, REFERENCE_TIME *min_period, CHAR *pulse_name) {
WAVEFORMATEX *wfx = &fmt->Format;
pa_stream *stream;
pa_channel_map map;
@@ -684,10 +687,10 @@ static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) {
if (!stream)
ret = -1;
else if (render)
- ret = pa_stream_connect_playback(stream, NULL, &attr,
+ ret = pa_stream_connect_playback(stream, pulse_name, &attr,
PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS, NULL, NULL);
else
- ret = pa_stream_connect_record(stream, NULL, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS);
+ ret = pa_stream_connect_record(stream, pulse_name, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS);
if (ret >= 0) {
while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 &&
pa_stream_get_state(stream) == PA_STREAM_CREATING)
@@ -710,13 +713,13 @@ static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) {
pa_stream_unref(stream);
if (length)
- pulse_def_period[!render] = pulse_min_period[!render] = pa_bytes_to_usec(10 * length, &ss);
+ *def_period = *min_period = pa_bytes_to_usec(10 * length, &ss);
- if (pulse_min_period[!render] < MinimumPeriod)
- pulse_min_period[!render] = MinimumPeriod;
+ if (*min_period < MinimumPeriod)
+ *min_period = MinimumPeriod;
- if (pulse_def_period[!render] < DefaultPeriod)
- pulse_def_period[!render] = DefaultPeriod;
+ if (*def_period < DefaultPeriod)
+ *def_period = DefaultPeriod;
wfx->wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wfx->cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
@@ -737,6 +740,46 @@ static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) {
fmt->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
}
+static NTSTATUS pulse_get_device_mix_format(void *args)
+{
+ struct get_device_mix_format_params *params = args;
+ struct list *list = params->render ? &g_phys_speakers : &g_phys_sources;
+ PhysDevice *dev;
+
+ LIST_FOR_EACH_ENTRY(dev, list, PhysDevice, entry) {
+ if (strcmp(params->pulse_name, dev->pulse_name))
+ continue;
+
+ params->fmt = dev->fmt;
+ params->result = S_OK;
+
+ return STATUS_SUCCESS;
+ }
+
+ params->result = E_FAIL;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_get_device_period(void *args) {
+ struct get_device_period_params *params = args;
+ struct list *list = params->render ? &g_phys_speakers : &g_phys_sources;
+ PhysDevice *dev;
+
+ LIST_FOR_EACH_ENTRY(dev, list, PhysDevice, entry) {
+ if (strcmp(params->pulse_name, dev->pulse_name))
+ continue;
+
+ params->def_period = dev->def_period;
+ params->min_period = dev->min_period;
+ params->result = S_OK;
+
+ return STATUS_SUCCESS;
+ }
+
+ params->result = E_FAIL;
+ return STATUS_SUCCESS;
+}
+
/* some poorly-behaved applications call audio functions during DllMain, so we
* have to do as much as possible without creating a new thread. this function
* sets up a synchronous connection to verify the server is running and query
@@ -745,6 +788,7 @@ static NTSTATUS pulse_test_connect(void *args)
{
struct test_connect_params *params = args;
struct pulse_config *config = params->config;
+ PhysDevice *dev;
pa_operation *o;
int ret;
@@ -787,8 +831,8 @@ static NTSTATUS pulse_test_connect(void *args)
pa_context_get_server(pulse_ctx),
pa_context_get_server_protocol_version(pulse_ctx));
- pulse_probe_settings(1, &pulse_fmt[0]);
- pulse_probe_settings(0, &pulse_fmt[1]);
+ pulse_probe_settings(1, &pulse_fmt[0], &pulse_def_period[0], &pulse_min_period[0], NULL);
+ pulse_probe_settings(0, &pulse_fmt[1], &pulse_def_period[1], &pulse_min_period[1], NULL);
free_phys_device_lists();
list_init(&g_phys_speakers);
@@ -813,6 +857,14 @@ static NTSTATUS pulse_test_connect(void *args)
pa_operation_unref(o);
}
+ LIST_FOR_EACH_ENTRY(dev, &g_phys_speakers, PhysDevice, entry) {
+ pulse_probe_settings(1, &dev->fmt, &dev->def_period, &dev->min_period, dev->pulse_name);
+ }
+
+ LIST_FOR_EACH_ENTRY(dev, &g_phys_sources, PhysDevice, entry) {
+ pulse_probe_settings(0, &dev->fmt, &dev->def_period, &dev->min_period, dev->pulse_name);
+ }
+
pa_context_unref(pulse_ctx);
pulse_ctx = NULL;
pa_mainloop_free(pulse_ml);
@@ -2305,6 +2357,8 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
pulse_test_connect,
pulse_is_started,
pulse_get_prop_value,
+ pulse_get_device_mix_format,
+ pulse_get_device_period,
};
#ifdef _WIN64
diff --git a/dlls/winepulse.drv/unixlib.h b/dlls/winepulse.drv/unixlib.h
index f224f26c909..68137c5a59a 100644
--- a/dlls/winepulse.drv/unixlib.h
+++ b/dlls/winepulse.drv/unixlib.h
@@ -159,6 +159,23 @@ struct get_current_padding_params
UINT32 *padding;
};
+struct get_device_mix_format_params
+{
+ const char *pulse_name;
+ HRESULT result;
+ BOOL render;
+ WAVEFORMATEXTENSIBLE fmt;
+};
+
+struct get_device_period_params
+{
+ const char *pulse_name;
+ HRESULT result;
+ BOOL render;
+ REFERENCE_TIME def_period;
+ REFERENCE_TIME min_period;
+};
+
struct get_next_packet_size_params
{
stream_handle stream;
@@ -252,4 +269,6 @@ enum unix_funcs
test_connect,
is_started,
get_prop_value,
+ get_device_mix_format,
+ get_device_period,
};
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/337
June 29, 2022