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
November 2021
- 83 participants
- 2620 messages
Re: [PATCH] ucrtbase: Later printf width specifiers should override earlier ones
by Andrew Eikum
Thanks, David. I've resent the patches squashed together and with the
added ucrtbase tests.
Andrew
On Mon, Nov 08, 2021 at 07:06:26PM +0800, David Gow wrote:
> In ucrtbase (but not in msvcrt), when a printf format specifier has two
> width specifiers (both a '*' and an explicit number), only the latter
> should take effect. (In msvcrt, the width of one is combined with the
> other).
>
> This patch builds on the prior patch which implements the msvcrt
> behaviour, and needs to be applied on top of it:
> msvcrt: The '*' character should be interpreted as the beginning of the width specification[1,2]
>
> It also supercedes the previous (incorrect) patch which used the
> ucrtbase behaviour on msvcrt as well:
> msvcrt: printf: Later width specifiers should override earlier ones[3]
>
> For further details, see [4], [5], and [6].
>
> [1]: https://source.winehq.org/patches/data/218904
> [2]: https://www.winehq.org/pipermail/wine-devel/2021-November/200009.html
> [3]: https://www.winehq.org/pipermail/wine-devel/2021-November/200040.html
> [4]: https://www.winehq.org/pipermail/wine-devel/2021-November/200039.html
> [5]: https://github.com/ValveSoftware/Proton/issues/5258#issuecomment-962423092
> [6]: https://www.winehq.org/pipermail/wine-devel/2021-November/200063.html
>
> Signed-off-by: David Gow <david(a)davidgow.net>
Nov. 8, 2021
[PATCH] msvcrt: Better handle multiple width specifiers
by Andrew Eikum
Includes feedback from David Gow <david(a)davidgow.net> and Piotr Caban.
Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com>
---
dlls/msvcrt/printf.h | 9 ++++++++-
dlls/msvcrt/tests/printf.c | 12 ++++++++++++
dlls/ucrtbase/tests/printf.c | 19 +++++++++++++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/printf.h b/dlls/msvcrt/printf.h
index aeb1290f48f..c34479c5688 100644
--- a/dlls/msvcrt/printf.h
+++ b/dlls/msvcrt/printf.h
@@ -1050,7 +1050,14 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const API
flags.LeftAlign = TRUE;
flags.FieldLength = -flags.FieldLength;
}
- } else while (*p >= '0' && *p <= '9') {
+ }
+
+#if _MSVCR_VER >= 140
+ if (*p >= '0' && *p <= '9')
+ flags.FieldLength = 0;
+#endif
+
+ while (*p >= '0' && *p <= '9') {
flags.FieldLength *= 10;
flags.FieldLength += *p++ - '0';
}
diff --git a/dlls/msvcrt/tests/printf.c b/dlls/msvcrt/tests/printf.c
index 06acf4c8450..010cad0ab8f 100644
--- a/dlls/msvcrt/tests/printf.c
+++ b/dlls/msvcrt/tests/printf.c
@@ -396,6 +396,18 @@ static void test_sprintf( void )
ok(!strcmp(buffer, "string to copy"), "failed: \"%s\"\n", buffer);
setlocale(LC_ALL, "C");
+
+ r = p_sprintf(buffer, "%*1d", 1, 3);
+ ok(r==11, "r = %d\n", r);
+ ok(!strcmp(buffer, " 3"), "failed: \"%s\"\n", buffer);
+
+ r = p_sprintf(buffer, "%0*0d", 1, 2);
+ ok(r==10, "r = %d\n", r);
+ ok(!strcmp(buffer, "0000000002"), "failed: \"%s\"\n", buffer);
+
+ r = p_sprintf(buffer, "% *2d", 0, 7);
+ ok(r==2, "r = %d\n", r);
+ ok(!strcmp(buffer, " 7"), "failed: \"%s\"\n", buffer);
}
static void test_swprintf( void )
diff --git a/dlls/ucrtbase/tests/printf.c b/dlls/ucrtbase/tests/printf.c
index 4f20ccff9a4..51a54426bc4 100644
--- a/dlls/ucrtbase/tests/printf.c
+++ b/dlls/ucrtbase/tests/printf.c
@@ -845,6 +845,24 @@ static void test_printf_fp(void)
}
}
+static void test_printf_width_specification(void)
+{
+ int r;
+ char buffer[20];
+
+ r = vsprintf_wrapper(0, buffer, sizeof(buffer), "%0*2d", 1, 3);
+ ok(r == 2, "r = %d\n", r);
+ ok(!strcmp(buffer, "03"), "buffer wrong, got=%s\n", buffer);
+
+ r = vsprintf_wrapper(0, buffer, sizeof(buffer), "%*0d", 1, 2);
+ ok(r == 1, "r = %d\n", r);
+ ok(!strcmp(buffer, "2"), "buffer wrong, got=%s\n", buffer);
+
+ r = vsprintf_wrapper(0, buffer, sizeof(buffer), "% *2d", 0, 7);
+ ok(r == 2, "r = %d\n", r);
+ ok(!strcmp(buffer, " 7"), "buffer wrong, got=%s\n", buffer);
+}
+
START_TEST(printf)
{
ok(_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL,
@@ -862,4 +880,5 @@ START_TEST(printf)
test_printf_c99();
test_printf_natural_string();
test_printf_fp();
+ test_printf_width_specification();
}
--
2.33.1
Nov. 8, 2021
[PATCH 2/2] ntdll: Make syscall dispatcher properly restore X16 and X17 in ARM64.
by Jinoh Kang
Today, __wine_syscall_dispatcher clobbers X16 and X17 registers even if
`syscall_frame->restore_flags` has CONTEXT_INTEGER set.
This is because they are used as scratch registers for restoring SP and
PC, which cannot be loaded directly from memory or other architectural
state.
signal_set_full_context bypasses this clobbering behaviour by relying on
kernel instead to fully restore the context. Specifically, it raises
SIGUSR2, of which handler moves everything to the sigcontext and returns
implicitly via the sigreturn() Unix system call.
However, this approach is not generic and also error-prone: the
signal_set_full_context implementation now differs from other
architectures by abruptly switching to the specified context instead of
taking the proper path of returning via the syscall dispatcher.
Fix this by splitting the ARM64 syscall dispatcher's returning behaviour
into a fast path and a slow path.
- If CONTEXT_INTEGER is not set, the dispatcher takes the fast path:
the X16 and X17 registers are clobbered as usual.
- If X16 == PC and X17 == SP, the dispatcher also takes the fast path:
it can safely use X16 and X17 without corrupting the thread state,
since those two registers already have the desired values.
- Otherwise, the dispatcher takes the slow path: it raises SIGUSR2 and
does full context restore in the signal handler.
Also, modify ARM64 signal_set_full_context to match that of other
architectures. The function will let the dispatcher choose either path
as appropriate.
Performance impact is expected to be negligible (if any) when
CONTEXT_INTEGER is unset (the usual case), since the number of
instructions executed is left unchanged for this case.
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
---
dlls/ntdll/unix/signal_arm64.c | 57 ++++++++++++++++++++++++----------
1 file changed, 40 insertions(+), 17 deletions(-)
diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c
index da5739b6f1c..c5db2e7de64 100644
--- a/dlls/ntdll/unix/signal_arm64.c
+++ b/dlls/ntdll/unix/signal_arm64.c
@@ -327,6 +327,10 @@ NTSTATUS CDECL unwind_builtin_dll( ULONG type, DISPATCHER_CONTEXT *dispatch, CON
/***********************************************************************
* syscall_frame_fixup_for_fastpath
*
+ * Fixes up the given syscall frame such that the syscall dispatcher
+ * can return via the fast path if CONTEXT_INTEGER is set in
+ * restore_flags.
+ *
* Clobbers the frame's X16 and X17 register values.
*/
static void syscall_frame_fixup_for_fastpath( struct syscall_frame *frame )
@@ -426,7 +430,8 @@ NTSTATUS signal_set_full_context( CONTEXT *context )
{
NTSTATUS status = NtSetContextThread( GetCurrentThread(), context );
- if (!status && (context->ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER) raise( SIGUSR2 );
+ if (!status && (context->ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER)
+ arm64_thread_data()->syscall_frame->restore_flags |= CONTEXT_INTEGER;
return status;
}
@@ -1172,6 +1177,17 @@ void signal_init_process(void)
}
+/***********************************************************************
+ * syscall_dispatcher_return_slowpath
+ */
+void DECLSPEC_HIDDEN syscall_dispatcher_return_slowpath( void )
+{
+ raise( SIGUSR2 );
+
+ /* should not be reached */
+ abort_thread( 0 );
+}
+
/***********************************************************************
* call_init_thunk
*/
@@ -1312,13 +1328,28 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"ldr x16, [x16, x20, lsl 3]\n\t"
"blr x16\n\t"
"mov sp, x22\n"
- "3:\tldp x18, x19, [sp, #0x90]\n\t"
+ "3:\tldr w16, [sp, #0x10c]\n\t" /* frame->restore_flags */
+ "tbz x16, #1, 1f\n\t" /* CONTEXT_INTEGER */
+ "ldp x6, x7, [sp, #0x80]\n\t" /* frame->x[16..17] */
+ "ldp x8, x9, [sp, #0xf8]\n\t" /* frame->sp, frame->pc */
+ "eor x6, x6, x9\n\t" /* frame->x16 == frame->pc? */
+ "eor x7, x7, x8\n\t" /* frame->x17 == frame->sp? */
+ "orr x6, x6, x7\n\t"
+ "cbnz x6, 5f\n\t" /* take slowpath if unequal */
+ "ldp x0, x1, [sp, #0x00]\n\t"
+ "ldp x2, x3, [sp, #0x10]\n\t"
+ "ldp x4, x5, [sp, #0x20]\n\t"
+ "ldp x6, x7, [sp, #0x30]\n\t"
+ "ldp x8, x9, [sp, #0x40]\n\t"
+ "ldp x10, x11, [sp, #0x50]\n\t"
+ "ldp x12, x13, [sp, #0x60]\n\t"
+ "ldp x14, x15, [sp, #0x70]\n"
+ "1:\tldp x18, x19, [sp, #0x90]\n\t"
"ldp x20, x21, [sp, #0xa0]\n\t"
"ldp x22, x23, [sp, #0xb0]\n\t"
"ldp x24, x25, [sp, #0xc0]\n\t"
"ldp x26, x27, [sp, #0xd0]\n\t"
"ldp x28, x29, [sp, #0xe0]\n\t"
- "ldr w16, [sp, #0x10c]\n\t" /* frame->restore_flags */
"tbz x16, #2, 1f\n\t" /* CONTEXT_FLOATING_POINT */
"ldp q0, q1, [sp, #0x130]\n\t"
"ldp q2, q3, [sp, #0x150]\n\t"
@@ -1336,19 +1367,10 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"ldp q26, q27, [sp, #0x2d0]\n\t"
"ldp q28, q29, [sp, #0x2f0]\n\t"
"ldp q30, q31, [sp, #0x310]\n\t"
- "ldr w9, [sp, #0x128]\n\t"
- "msr FPCR, x9\n\t"
- "ldr w9, [sp, #0x12c]\n\t"
- "msr FPSR, x9\n"
- "1:\ttbz x16, #1, 1f\n\t" /* CONTEXT_INTEGER */
- "ldp x0, x1, [sp, #0x00]\n\t"
- "ldp x2, x3, [sp, #0x10]\n\t"
- "ldp x4, x5, [sp, #0x20]\n\t"
- "ldp x6, x7, [sp, #0x30]\n\t"
- "ldp x8, x9, [sp, #0x40]\n\t"
- "ldp x10, x11, [sp, #0x50]\n\t"
- "ldp x12, x13, [sp, #0x60]\n\t"
- "ldp x14, x15, [sp, #0x70]\n"
+ "ldr w17, [sp, #0x128]\n\t"
+ "msr FPCR, x17\n\t"
+ "ldr w17, [sp, #0x12c]\n\t"
+ "msr FPSR, x17\n"
"1:\tldp x16, x17, [sp, #0x100]\n\t"
"msr NZCV, x17\n\t"
"ldp x30, x17, [sp, #0xf0]\n\t"
@@ -1360,7 +1382,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
__ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t"
"mov sp, x0\n\t"
"mov x0, x1\n\t"
- "b 3b" )
+ "b 3b\n"
+ "5:\tbl " __ASM_NAME("syscall_dispatcher_return_slowpath") )
/***********************************************************************
--
2.33.1
Nov. 8, 2021
[PATCH 1/2] ntdll: Explicitly clobber X16/X17 registers on ARM64 syscall return.
by Jinoh Kang
Synchronize syscall_frame to match the actual state on syscall return.
This is required for a follow-up patch that addresses incorrect
behaviour of __wine_syscall_dispatcher, specifically unconditional
clobbering of X16 and X17 registers, while minimizing the performance
impact. (Hence the "fastpath")
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
---
dlls/ntdll/unix/signal_arm64.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c
index fa402a7a83e..da5739b6f1c 100644
--- a/dlls/ntdll/unix/signal_arm64.c
+++ b/dlls/ntdll/unix/signal_arm64.c
@@ -324,6 +324,17 @@ NTSTATUS CDECL unwind_builtin_dll( ULONG type, DISPATCHER_CONTEXT *dispatch, CON
}
+/***********************************************************************
+ * syscall_frame_fixup_for_fastpath
+ *
+ * Clobbers the frame's X16 and X17 register values.
+ */
+static void syscall_frame_fixup_for_fastpath( struct syscall_frame *frame )
+{
+ frame->x[16] = frame->pc;
+ frame->x[17] = frame->sp;
+}
+
/***********************************************************************
* save_context
*
@@ -686,6 +697,7 @@ NTSTATUS call_user_apc_dispatcher( CONTEXT *context, ULONG_PTR arg1, ULONG_PTR a
frame->x[3] = arg3;
frame->x[4] = (ULONG64)func;
frame->restore_flags |= CONTEXT_CONTROL | CONTEXT_INTEGER;
+ syscall_frame_fixup_for_fastpath( frame );
return status;
}
@@ -718,6 +730,7 @@ NTSTATUS call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context
frame->lr = lr;
frame->sp = sp;
frame->restore_flags |= CONTEXT_INTEGER | CONTEXT_CONTROL;
+ syscall_frame_fixup_for_fastpath( frame );
return status;
}
@@ -757,6 +770,7 @@ NTSTATUS WINAPI KeUserModeCallback( ULONG id, const void *args, ULONG len, void
callback_frame.frame.restore_flags = CONTEXT_INTEGER;
callback_frame.frame.syscall_table = frame->syscall_table;
callback_frame.frame.prev_frame = frame;
+ syscall_frame_fixup_for_fastpath( &callback_frame.frame );
arm64_thread_data()->syscall_frame = &callback_frame.frame;
__wine_syscall_dispatcher_return( &callback_frame.frame, 0 );
@@ -1187,6 +1201,7 @@ void DECLSPEC_HIDDEN call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, B
frame->prev_frame = NULL;
frame->restore_flags |= CONTEXT_INTEGER;
frame->syscall_table = KeServiceDescriptorTable;
+ syscall_frame_fixup_for_fastpath( frame );
pthread_sigmask( SIG_UNBLOCK, &server_block_set, NULL );
__wine_syscall_dispatcher_return( frame, 0 );
--
2.33.1
Nov. 8, 2021
[PATCH] riched20: Check font_cache in select_style() too.
by Serge Gautherie
Signed-off-by: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr>
---
Like the other release_font_cache() calls.
Addendum to wine-4.14-26-g6f1cc1f.
ReactOS-Bug: https://jira.reactos.org/browse/CORE-17843
---
dlls/riched20/style.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c
index 917a5bd..266bb93 100644
--- a/dlls/riched20/style.c
+++ b/dlls/riched20/style.c
@@ -429,7 +429,7 @@ void select_style( ME_Context *c, ME_Style *s )
c->orig_font = NULL;
}
- if (c->current_style)
+ if (c->current_style && c->current_style->font_cache)
{
release_font_cache( c->current_style->font_cache );
c->current_style->font_cache = NULL;
--
2.10.0.windows.1
Nov. 8, 2021
[PATCH] riched20: Check font_cache in select_style() too. --- Like the other release_font_cache() calls.
by Serge Gautherie
Addendum to wine-4.14-26-g6f1cc1f.
ReactOS-Bug: https://jira.reactos.org/browse/CORE-17843
---
dlls/riched20/style.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c
index 917a5bd..266bb93 100644
--- a/dlls/riched20/style.c
+++ b/dlls/riched20/style.c
@@ -429,7 +429,7 @@ void select_style( ME_Context *c, ME_Style *s )
c->orig_font = NULL;
}
- if (c->current_style)
+ if (c->current_style && c->current_style->font_cache)
{
release_font_cache( c->current_style->font_cache );
c->current_style->font_cache = NULL;
--
2.10.0.windows.1
Nov. 8, 2021
Re: [PATCH 2/4] ddraw/tests: Port test_filling_convention to ddraw.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=101435
Your paranoid android.
=== w864 (32 bit report) ===
ddraw:
ddraw1.c:8279: Test failed: Got unexpected color 0x00000000.
ddraw1.c:8283: Test failed: Got unexpected color 0x00000000.
ddraw1.c:8346: Test failed: Got unexpected color 0x00000000.
ddraw1.c:8348: Test failed: Got unexpected color 0x00000000.
=== w1064 (32 bit report) ===
ddraw:
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x5, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x5, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x1, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x1, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x1, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 4x1, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 4x2, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 4x3, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 4x4, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x1, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x1, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x1, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x1, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x5, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x5, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x5, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x5, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x1, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x1, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 7.
=== w1064_tsign (32 bit report) ===
ddraw:
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x5, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x5, case 0.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x1, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x1, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 1.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x1, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 4x1, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 4x2, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 4x3, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 4x4, case 2.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x1, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x1, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 3.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x1, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x1, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 4.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x5, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x5, case 5.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x5, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x5, case 6.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x1, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x1, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x2, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x2, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x3, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x3, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 2x4, case 7.
ddraw1.c:14874: Test failed: Got unexpected colour 000000ff, 3x4, case 7.
=== w864 (32 bit report) ===
ddraw:
ddraw7.c:18676: Test failed: Got unexpected color 0x00000040.
=== debiant2 (32 bit Chinese:China report) ===
Report validation errors:
ddraw2: Timeout
=== debiant2 (build log) ===
WineRunWineTest.pl:error: The task timed out
Nov. 8, 2021
Re: [PATCH 5/5] win32u: Don't use free_region in alloc_region.
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
Nov. 8, 2021
[PATCH 6/6] mfreadwrite/tests: Add a native I420 video media type attributes test.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/mfreadwrite/tests/mfplat.c | 36 ++++++++++++++++++++-
dlls/mfreadwrite/tests/resource.rc | 3 ++
dlls/mfreadwrite/tests/test-40x36-i420.avi | Bin 0 -> 66320 bytes
3 files changed, 38 insertions(+), 1 deletion(-)
create mode 100644 dlls/mfreadwrite/tests/test-40x36-i420.avi
diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c
index 9d2e17de4f1..a219eecce36 100644
--- a/dlls/mfreadwrite/tests/mfplat.c
+++ b/dlls/mfreadwrite/tests/mfplat.c
@@ -1651,6 +1651,27 @@ static void test_media_types(void)
},
};
+ static const GUID unknown_attribute = {0xc496f370,0x2f8b,0x4f51,{0xae,0x46,0x9c,0xfc,0x1b,0xc8,0x2a,0x47}};
+ static const struct media_type_desc video_40x36_i420_desc =
+ {
+ .items =
+ {
+ {.key = &MF_MT_MAJOR_TYPE, .value = {.vt = VT_CLSID, .puuid = (GUID *)&MFMediaType_Video}},
+ {.key = &MF_MT_SUBTYPE, .value = {.vt = VT_CLSID, .puuid = (GUID *)&MFVideoFormat_I420}},
+ {.key = &MF_MT_ALL_SAMPLES_INDEPENDENT, .value = {.vt = VT_UI4, .ulVal = 1}},
+ {.key = &MF_MT_FIXED_SIZE_SAMPLES, .value = {.vt = VT_UI4, .ulVal = 1}, .todo_missing = TRUE},
+ {.key = &MF_MT_SAMPLE_SIZE, .value = {.vt = VT_UI4, .ulVal = 40 * 36}, .todo_missing = TRUE},
+ {.key = &MF_MT_DEFAULT_STRIDE, .value = {.vt = VT_UI4, .ulVal = 40}, .todo_missing = TRUE},
+ {.key = &MF_MT_FRAME_RATE, .value = {.vt = VT_UI8, .uhVal = {.QuadPart = (30ull << 32) | 1ull}}},
+ {.key = &MF_MT_FRAME_SIZE, .value = {.vt = VT_UI8, .uhVal = {.QuadPart = (40ull << 32) | 36ull}}},
+ {.key = &MF_MT_INTERLACE_MODE, .value = {.vt = VT_UI4, .ulVal = MFVideoInterlace_MixedInterlaceOrProgressive}, .optional = TRUE /* > win7 */, .todo_missing = TRUE},
+ {.key = &MF_MT_INTERLACE_MODE, .value = {.vt = VT_UI4, .ulVal = MFVideoInterlace_Progressive}, .optional = TRUE /* <= win7 */, .todo_missing = TRUE},
+ {.key = &MF_MT_PIXEL_ASPECT_RATIO, .value = {.vt = VT_UI8, .uhVal = {.QuadPart = (1ull << 32) | 1ull}}, .todo_missing = TRUE},
+ {.key = &MF_MT_TIMESTAMP_CAN_BE_DTS, .value = {.vt = VT_UI4, .ulVal = 1}, .optional = TRUE /* <= win7 */},
+ {.key = &unknown_attribute, .value = {.vt = VT_UI4, .ulVal = 12}},
+ },
+ };
+
struct test_audio_format
{
GUID subtype;
@@ -1689,6 +1710,11 @@ static void test_media_types(void)
{.subtype = MFVideoFormat_NV12, .current = &video_40x36_h264_nv12_desc, .actual = &video_48x48_h264_nv12_desc},
{.subtype = MFVideoFormat_I420, .current = &video_40x36_h264_i420_desc, .actual = &video_48x48_h264_i420_desc},
};
+ struct test_video_format test_i420_formats[] =
+ {
+ {.subtype = MFVideoFormat_NV12},
+ {.subtype = MFVideoFormat_I420, .current = &video_40x36_i420_desc, .actual = &video_40x36_i420_desc},
+ };
struct test_media_type tests[] =
{
@@ -1710,6 +1736,12 @@ static void test_media_types(void)
.video_formats = test_h264_formats,
.video_format_count = ARRAY_SIZE(test_h264_formats),
},
+ {
+ .resource = "test-40x36-i420.avi",
+ .native = &video_40x36_i420_desc,
+ .video_formats = test_i420_formats,
+ .video_format_count = ARRAY_SIZE(test_i420_formats),
+ },
};
struct test_audio_format audio_format;
@@ -1839,8 +1871,10 @@ static void test_media_types(void)
hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &video_format.subtype);
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
hr = IMFSourceReader_SetCurrentMediaType(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, NULL, media_type);
- ok(hr == S_OK, "Failed setting current media type %u, hr %#x.\n", j, hr);
+ if (video_format.current) ok(hr == S_OK, "Failed setting current media type %u, hr %#x.\n", j, hr);
+ else ok(hr == MF_E_TOPO_CODEC_NOT_FOUND, "Succeeded setting current media type %u, hr %#x.\n", j, hr);
IMFMediaType_Release(media_type);
+ if (hr != S_OK) continue;
hr = IMFSourceReader_GetCurrentMediaType(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, &media_type);
ok(hr == S_OK, "Failed to get current mediatype, hr %#x.\n", hr);
diff --git a/dlls/mfreadwrite/tests/resource.rc b/dlls/mfreadwrite/tests/resource.rc
index 5ae9636d671..3f32c2abc30 100644
--- a/dlls/mfreadwrite/tests/resource.rc
+++ b/dlls/mfreadwrite/tests/resource.rc
@@ -26,3 +26,6 @@ test-48000.wav RCDATA test-48000.wav
/* @makedep: test-40x36-h264.mp4 */
test-40x36-h264.mp4 RCDATA test-40x36-h264.mp4
+
+/* @makedep: test-40x36-i420.avi */
+test-40x36-i420.avi RCDATA test-40x36-i420.avi
diff --git a/dlls/mfreadwrite/tests/test-40x36-i420.avi b/dlls/mfreadwrite/tests/test-40x36-i420.avi
new file mode 100644
index 0000000000000000000000000000000000000000..fde02cb07c7fffe8c4fadcd69addbb066a67e86f
GIT binary patch
literal 66320
zcmeI5c~Dc?m&eodo2lxmnLi>3iXvfG76oLHZZIH53}G>#fDOnJBZe)q35XyMltp9_
z0tl!qvZ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P%8a3`Z-_e(cOdRS+<~|QamU*09kY!TmrMJrCD(A)<;wER
z++h;rqgISl7jZV~Rcn9!ped*a&evP=j##8z5x>wYhjm4USa+Y07Jj`1*0osg_vBl3
zhK1C?x`0!|P5koSfI=L8YI~Y@{H~pAV4Vbx*G*my+mgyZr<JKJH><J_aR=fK#2tt`
z5O*N%SUYz-l46!_XKw6f;9PgO5bHLfIdv*%)E3UeYDdi$nwzd2$zZ`cQrzK0LE6%x
z;+L>4$+jbx?U>pvFo$&&lFefB{Kwh%IQ5AxN8f`xmMD7n65)9BVy}gtYUfA{oaen5
zg(Xmuh-au~Xq|Kn!=|SnVHoG}^iUVZ;c#RQS?llbmwoM$y*XFRl`ntCr|enrs_bL4
zlQFDaB5B9uQ;k;7p^M8w46A%H{-6P)QmLyx4Gj(1M#Ji<U3Fo9$7gBDWW(a)eRAjn?0
zZ(a)P|*j;}=4<k>$m5^*5n!2dlCzV<n8>#c+HtNI=?Wxr<3iH(a)_d&cmPLsg>LxlKC5~
zvlpg|gX`4avv8iLcBH;D;_|S!C^-|3NB8rfyfTw!U!%b~(IkUPDW*R<xf|BSJ9P`p
zsyVDh5v)7Ccf=+sC+<A;6Razi^0K2Cxd$k&s$APp);Cn|Q0;n01T)2I{s#g<&L3*B
z8@)FFgFujT$e;G*|5UVp+^A?{+KTq?hKhFVPDOjkR?!Y6E84GI6>a(<MSIX+(RL11
zw0l^Jwq=~6ed~;(t(&E2SLQ3)M2(a)1JcU93QG%DIDt%~;NPDPv5r)bYVSG13gD%v8k
WqD`Gsv>z`j+V-CnZQk#z_Wu9`QWzTm
literal 0
HcmV?d00001
--
2.33.1
Nov. 8, 2021
[PATCH 5/6] mfreadwrite/tests: Check media type attributes after reading a sample.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/mfreadwrite/tests/mfplat.c | 157 +++++++++++++++++++++++++++++++-
1 file changed, 155 insertions(+), 2 deletions(-)
diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c
index 051c7206e96..9d2e17de4f1 100644
--- a/dlls/mfreadwrite/tests/mfplat.c
+++ b/dlls/mfreadwrite/tests/mfplat.c
@@ -1523,6 +1523,134 @@ static void test_media_types(void)
},
};
+ static const UINT32 actual_40x36_aperture[] = {0, 0, 40, 36};
+ static const struct media_type_desc video_48x48_h264_nv12_desc =
+ {
+ .items =
+ {
+ {.key = &MF_MT_MAJOR_TYPE, .value = {.vt = VT_CLSID, .puuid = (GUID *)&MFMediaType_Video}},
+ {.key = &MF_MT_SUBTYPE, .value = {.vt = VT_CLSID, .puuid = (GUID *)&MFVideoFormat_NV12}},
+ {.key = &MF_MT_ALL_SAMPLES_INDEPENDENT, .value = {.vt = VT_UI4, .ulVal = 1}},
+ {.key = &MF_MT_COMPRESSED, .value = {.vt = VT_UI4, .ulVal = 0}},
+ {.key = &MF_MT_FIXED_SIZE_SAMPLES, .value = {.vt = VT_UI4, .ulVal = 1}, .todo_missing = TRUE},
+ {.key = &MF_MT_SAMPLE_SIZE, .value = {.vt = VT_UI4, .ulVal = 48 * 48 * 3 / 2}, .todo_missing = TRUE},
+ {.key = &MF_MT_AVG_BIT_ERROR_RATE, .value = {.vt = VT_UI4, .ulVal = 0}, .todo_missing = TRUE},
+ {.key = &MF_MT_AVG_BITRATE, .value = {.vt = VT_UI4, .ulVal = 78904}, .todo_missing = TRUE},
+ {.key = &MF_MT_DEFAULT_STRIDE, .value = {.vt = VT_UI4, .ulVal = 48}, .todo_missing = TRUE},
+ {.key = &MF_MT_FRAME_RATE, .value = {.vt = VT_UI8, .uhVal = {.QuadPart = (30ull << 32) | 1ull}}},
+ {.key = &MF_MT_FRAME_SIZE, .value = {.vt = VT_UI8, .uhVal = {.QuadPart = (48ull << 32) | 48ull}}, .todo_value = TRUE},
+ {.key = &MF_MT_INTERLACE_MODE, .value = {.vt = VT_UI4, .ulVal = MFVideoInterlace_MixedInterlaceOrProgressive}, .todo_missing = TRUE},
+ {.key = &MF_MT_PIXEL_ASPECT_RATIO, .value = {.vt = VT_UI8, .uhVal = {.QuadPart = (1ull << 32) | 1ull}}, .todo_missing = TRUE},
+ {.key = &MF_MT_VIDEO_ROTATION, .value = {.vt = VT_UI4, .ulVal = 0}, .optional = TRUE /* <= win7 */},
+ {.key = &MF_MT_YUV_MATRIX, .value = {.vt = VT_UI4, .ulVal = MFVideoTransferMatrix_BT601}, .todo_missing = TRUE},
+ {.key = &MF_MT_TRANSFER_FUNCTION, .value = {.vt = VT_UI4, .ulVal = MFVideoTransFunc_709}, .todo_missing = TRUE},
+ {.key = &MF_MT_VIDEO_NOMINAL_RANGE, .value = {.vt = VT_UI4, .ulVal = MFNominalRange_Wide}, .todo_missing = TRUE},
+ {.key = &MF_MT_VIDEO_PRIMARIES, .value = {.vt = VT_UI4, .ulVal = MFVideoPrimaries_SMPTE170M}, .todo_missing = TRUE},
+ {
+ .key = &MF_MT_GEOMETRIC_APERTURE,
+ .value =
+ {
+ .vt = VT_VECTOR|VT_UI1,
+ .caub =
+ {
+ .pElems = (BYTE *)actual_40x36_aperture,
+ .cElems = sizeof(actual_40x36_aperture),
+ }
+ },
+ .todo_missing = TRUE,
+ },
+ {
+ .key = &MF_MT_PAN_SCAN_APERTURE,
+ .value =
+ {
+ .vt = VT_VECTOR|VT_UI1,
+ .caub =
+ {
+ .pElems = (BYTE *)actual_40x36_aperture,
+ .cElems = sizeof(actual_40x36_aperture),
+ }
+ },
+ .todo_missing = TRUE,
+ },
+ {
+ .key = &MF_MT_MINIMUM_DISPLAY_APERTURE,
+ .value =
+ {
+ .vt = VT_VECTOR|VT_UI1,
+ .caub =
+ {
+ .pElems = (BYTE *)actual_40x36_aperture,
+ .cElems = sizeof(actual_40x36_aperture),
+ }
+ },
+ .todo_missing = TRUE,
+ },
+ },
+ };
+ static const struct media_type_desc video_48x48_h264_i420_desc =
+ {
+ .items =
+ {
+ {.key = &MF_MT_MAJOR_TYPE, .value = {.vt = VT_CLSID, .puuid = (GUID *)&MFMediaType_Video}},
+ {.key = &MF_MT_SUBTYPE, .value = {.vt = VT_CLSID, .puuid = (GUID *)&MFVideoFormat_I420}},
+ {.key = &MF_MT_ALL_SAMPLES_INDEPENDENT, .value = {.vt = VT_UI4, .ulVal = 1}},
+ {.key = &MF_MT_COMPRESSED, .value = {.vt = VT_UI4, .ulVal = 0}},
+ {.key = &MF_MT_FIXED_SIZE_SAMPLES, .value = {.vt = VT_UI4, .ulVal = 1}, .todo_missing = TRUE},
+ {.key = &MF_MT_SAMPLE_SIZE, .value = {.vt = VT_UI4, .ulVal = 48 * 48 * 3 / 2}, .todo_missing = TRUE},
+ {.key = &MF_MT_AVG_BIT_ERROR_RATE, .value = {.vt = VT_UI4, .ulVal = 0}, .todo_missing = TRUE},
+ {.key = &MF_MT_AVG_BITRATE, .value = {.vt = VT_UI4, .ulVal = 78904}, .todo_missing = TRUE},
+ {.key = &MF_MT_DEFAULT_STRIDE, .value = {.vt = VT_UI4, .ulVal = 48}, .todo_missing = TRUE},
+ {.key = &MF_MT_FRAME_RATE, .value = {.vt = VT_UI8, .uhVal = {.QuadPart = (30ull << 32) | 1ull}}},
+ {.key = &MF_MT_FRAME_SIZE, .value = {.vt = VT_UI8, .uhVal = {.QuadPart = (48ull << 32) | 48ull}}, .todo_value = TRUE},
+ {.key = &MF_MT_INTERLACE_MODE, .value = {.vt = VT_UI4, .ulVal = MFVideoInterlace_MixedInterlaceOrProgressive}, .todo_missing = TRUE},
+ {.key = &MF_MT_PIXEL_ASPECT_RATIO, .value = {.vt = VT_UI8, .uhVal = {.QuadPart = (1ull << 32) | 1ull}}, .todo_missing = TRUE},
+ {.key = &MF_MT_VIDEO_ROTATION, .value = {.vt = VT_UI4, .ulVal = 0}, .optional = TRUE /* <= win7 */},
+ {.key = &MF_MT_YUV_MATRIX, .value = {.vt = VT_UI4, .ulVal = MFVideoTransferMatrix_BT601}, .todo_missing = TRUE},
+ {.key = &MF_MT_TRANSFER_FUNCTION, .value = {.vt = VT_UI4, .ulVal = MFVideoTransFunc_709}, .todo_missing = TRUE},
+ {.key = &MF_MT_VIDEO_NOMINAL_RANGE, .value = {.vt = VT_UI4, .ulVal = MFNominalRange_Wide}, .todo_missing = TRUE},
+ {.key = &MF_MT_VIDEO_PRIMARIES, .value = {.vt = VT_UI4, .ulVal = MFVideoPrimaries_SMPTE170M}, .todo_missing = TRUE},
+ {
+ .key = &MF_MT_GEOMETRIC_APERTURE,
+ .value =
+ {
+ .vt = VT_VECTOR|VT_UI1,
+ .caub =
+ {
+ .pElems = (BYTE *)actual_40x36_aperture,
+ .cElems = sizeof(actual_40x36_aperture),
+ }
+ },
+ .todo_missing = TRUE,
+ },
+ {
+ .key = &MF_MT_PAN_SCAN_APERTURE,
+ .value =
+ {
+ .vt = VT_VECTOR|VT_UI1,
+ .caub =
+ {
+ .pElems = (BYTE *)actual_40x36_aperture,
+ .cElems = sizeof(actual_40x36_aperture),
+ }
+ },
+ .todo_missing = TRUE,
+ },
+ {
+ .key = &MF_MT_MINIMUM_DISPLAY_APERTURE,
+ .value =
+ {
+ .vt = VT_VECTOR|VT_UI1,
+ .caub =
+ {
+ .pElems = (BYTE *)actual_40x36_aperture,
+ .cElems = sizeof(actual_40x36_aperture),
+ }
+ },
+ .todo_missing = TRUE,
+ },
+ },
+ };
+
struct test_audio_format
{
GUID subtype;
@@ -1535,6 +1663,7 @@ static void test_media_types(void)
{
GUID subtype;
const struct media_type_desc *current;
+ const struct media_type_desc *actual;
};
struct test_media_type
@@ -1557,8 +1686,8 @@ static void test_media_types(void)
struct test_video_format test_h264_formats[] =
{
- {.subtype = MFVideoFormat_NV12, .current = &video_40x36_h264_nv12_desc},
- {.subtype = MFVideoFormat_I420, .current = &video_40x36_h264_i420_desc},
+ {.subtype = MFVideoFormat_NV12, .current = &video_40x36_h264_nv12_desc, .actual = &video_48x48_h264_nv12_desc},
+ {.subtype = MFVideoFormat_I420, .current = &video_40x36_h264_i420_desc, .actual = &video_48x48_h264_i420_desc},
};
struct test_media_type tests[] =
@@ -1588,6 +1717,8 @@ static void test_media_types(void)
IMFMediaType *media_type;
IMFSourceReader *reader;
IMFByteStream *stream;
+ IMFSample *sample;
+ DWORD flags;
HRESULT hr;
int i, j;
@@ -1658,6 +1789,17 @@ static void test_media_types(void)
winetest_pop_context();
IMFMediaType_Release(media_type);
+ hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, NULL, &flags, NULL, &sample);
+ ok(hr == S_OK, "Failed to read sample, hr %#x\n", hr);
+ IMFSample_Release(sample);
+
+ hr = IMFSourceReader_GetCurrentMediaType(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, &media_type);
+ ok(hr == S_OK, "Failed to get current mediatype, hr %#x.\n", hr);
+ winetest_push_context("actual audio %u", j);
+ check_media_type_items(media_type, audio_format.current);
+ winetest_pop_context();
+ IMFMediaType_Release(media_type);
+
IMFSourceReader_Release(reader);
IMFByteStream_Release(stream);
}
@@ -1707,6 +1849,17 @@ static void test_media_types(void)
winetest_pop_context();
IMFMediaType_Release(media_type);
+ hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, NULL, &flags, NULL, &sample);
+ ok(hr == S_OK, "Failed to read sample, hr %#x\n", hr);
+ IMFSample_Release(sample);
+
+ hr = IMFSourceReader_GetCurrentMediaType(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, &media_type);
+ ok(hr == S_OK, "Failed to get current mediatype, hr %#x.\n", hr);
+ winetest_push_context("actual video %u", j);
+ check_media_type_items(media_type, video_format.actual);
+ winetest_pop_context();
+ IMFMediaType_Release(media_type);
+
IMFSourceReader_Release(reader);
IMFByteStream_Release(stream);
}
--
2.33.1
Nov. 8, 2021