Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2692cd8b
Commit
2692cd8b
authored
Feb 17, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/tests: Test each VIDEOINFOHEADER field conversion separately.
parent
498b6328
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
147 additions
and
39 deletions
+147
-39
mfplat.c
dlls/mfplat/tests/mfplat.c
+147
-39
No files found.
dlls/mfplat/tests/mfplat.c
View file @
2692cd8b
...
...
@@ -9860,15 +9860,8 @@ static void test_MFInitMediaTypeFromVideoInfoHeader(void)
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
vih
.
bmiHeader
.
biSize
=
sizeof
(
vih
.
bmiHeader
);
vih
.
bmiHeader
.
biPlanes
=
1
;
vih
.
bmiHeader
.
biWidth
=
16
;
vih
.
bmiHeader
.
biHeight
=
32
;
vih
.
bmiHeader
.
biBitCount
=
32
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
&
GUID_NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetGUID
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
guid
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guid
,
&
MFMediaType_Video
),
"Unexpected guid %s.
\n
"
,
debugstr_guid
(
&
guid
));
...
...
@@ -9876,6 +9869,35 @@ static void test_MFInitMediaTypeFromVideoInfoHeader(void)
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guid
,
&
GUID_NULL
),
"Unexpected guid %s.
\n
"
,
debugstr_guid
(
&
guid
));
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
&
value64
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
vih
.
bmiHeader
.
biWidth
=
16
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
&
GUID_NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
&
value64
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_PIXEL_ASPECT_RATIO
,
&
value64
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_INTERLACE_MODE
,
&
value32
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
vih
.
bmiHeader
.
biHeight
=
-
32
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
&
GUID_NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
&
value64
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value64
==
((
UINT64
)
16
<<
32
|
32
),
"Unexpected value %#I64x.
\n
"
,
value64
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_DEFAULT_STRIDE
,
&
value32
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
vih
.
bmiHeader
.
biHeight
=
32
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
&
GUID_NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
&
value64
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value64
==
((
UINT64
)
16
<<
32
|
32
),
"Unexpected value %#I64x.
\n
"
,
value64
);
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_PIXEL_ASPECT_RATIO
,
&
value64
);
...
...
@@ -9884,70 +9906,156 @@ static void test_MFInitMediaTypeFromVideoInfoHeader(void)
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_INTERLACE_MODE
,
&
value32
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value32
==
MFVideoInterlace_Progressive
,
"Unexpected value %#x.
\n
"
,
value32
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_DEFAULT_STRIDE
,
&
value32
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_FIXED_SIZE_SAMPLES
,
&
value32
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_SAMPLE_SIZE
,
&
value32
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_ALL_SAMPLES_INDEPENDENT
,
&
value32
);
value32
=
0xdeadbeef
;
vih
.
bmiHeader
.
biSizeImage
=
12345
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
&
GUID_NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_SAMPLE_SIZE
,
&
value32
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
value32
==
12345
,
"Unexpected value %#x.
\n
"
,
value32
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_AVG_BITRATE
,
&
value32
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
vih
.
bmiHeader
.
biHeight
=
-
32
;
value32
=
0xdeadbeef
;
vih
.
dwBitRate
=
678910
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
&
GUID_NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
&
value64
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_AVG_BITRATE
,
&
value32
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value64
==
((
UINT64
)
16
<<
32
|
32
),
"Unexpected value %#I64x.
\n
"
,
value64
);
todo_wine
ok
(
value32
==
678910
,
"Unexpected value %#x.
\n
"
,
value32
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_AVG_BIT_ERROR_RATE
,
&
value32
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
vih
.
bmiHeader
.
biHeight
=
32
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
NULL
);
value32
=
0xdeadbeef
;
vih
.
dwBitErrorRate
=
11121314
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
&
GUID_NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_AVG_BIT_ERROR_RATE
,
&
value32
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
failed
;
todo_wine
ok
(
value32
==
11121314
,
"Unexpected value %#x.
\n
"
,
value32
);
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_FRAME_RATE
,
&
value64
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetGUID
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
guid
);
value64
=
0xdeadbeef
;
vih
.
AvgTimePerFrame
=
1151617
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
&
GUID_NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guid
,
&
MFMediaType_Video
),
"Unexpected guid %s.
\n
"
,
debugstr_guid
(
&
guid
)
);
hr
=
IMFMediaType_GetGUID
(
media_type
,
&
MF_MT_SUBTYPE
,
&
guid
);
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_FRAME_RATE
,
&
value64
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
IsEqualGUID
(
&
guid
,
&
MFVideoFormat_RGB32
),
"Unexpected guid %s.
\n
"
,
debugstr_guid
(
&
guid
));
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
&
value64
);
ok
(
value64
==
((
UINT64
)
10000000
<<
32
|
1151617
),
"Unexpected value %#I64x.
\n
"
,
value64
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_FIXED_SIZE_SAMPLES
,
&
value32
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_ALL_SAMPLES_INDEPENDENT
,
&
value32
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
&
MFVideoFormat_NV12
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value64
==
((
UINT64
)
16
<<
32
|
32
),
"Unexpected value %#I64x.
\n
"
,
value64
);
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_PIXEL_ASPECT_RATIO
,
&
value64
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_FIXED_SIZE_SAMPLES
,
&
value32
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value
64
==
((
UINT64
)
1
<<
32
|
1
),
"Unexpected value %#I64x.
\n
"
,
value64
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_
INTERLACE_MODE
,
&
value32
);
ok
(
value
32
==
1
,
"Unexpected value %#x.
\n
"
,
value32
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_
ALL_SAMPLES_INDEPENDENT
,
&
value32
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value32
==
MFVideoInterlace_Progressive
,
"Unexpected value %#x.
\n
"
,
value32
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_SAMPLE_SIZE
,
&
value32
);
ok
(
value32
==
1
,
"Unexpected value %#x.
\n
"
,
value32
);
/* biBitCount is used for implicit RGB format if GUID is NULL */
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
for
(
vih
.
bmiHeader
.
biBitCount
=
1
;
vih
.
bmiHeader
.
biBitCount
<=
32
;
vih
.
bmiHeader
.
biBitCount
++
)
{
winetest_push_context
(
"%u"
,
vih
.
bmiHeader
.
biBitCount
);
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
NULL
);
if
(
vih
.
bmiHeader
.
biBitCount
!=
1
&&
vih
.
bmiHeader
.
biBitCount
!=
4
&&
vih
.
bmiHeader
.
biBitCount
!=
8
&&
vih
.
bmiHeader
.
biBitCount
!=
16
&&
vih
.
bmiHeader
.
biBitCount
!=
24
&&
vih
.
bmiHeader
.
biBitCount
!=
32
)
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
else
{
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value32
==
2048
,
"Unexpected value %u.
\n
"
,
value32
);
memset
(
&
guid
,
0xcd
,
sizeof
(
guid
));
hr
=
IMFMediaType_GetGUID
(
media_type
,
&
MF_MT_SUBTYPE
,
&
guid
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
vih
.
bmiHeader
.
biBitCount
==
32
)
todo_wine
ok
(
IsEqualGUID
(
&
guid
,
&
MFVideoFormat_RGB32
),
"Unexpected guid %s.
\n
"
,
debugstr_guid
(
&
guid
));
else
if
(
vih
.
bmiHeader
.
biBitCount
==
24
)
todo_wine
ok
(
IsEqualGUID
(
&
guid
,
&
MFVideoFormat_RGB24
),
"Unexpected guid %s.
\n
"
,
debugstr_guid
(
&
guid
));
else
if
(
vih
.
bmiHeader
.
biBitCount
==
16
)
todo_wine
ok
(
IsEqualGUID
(
&
guid
,
&
MFVideoFormat_RGB555
),
"Unexpected guid %s.
\n
"
,
debugstr_guid
(
&
guid
));
else
if
(
vih
.
bmiHeader
.
biBitCount
==
8
)
todo_wine
ok
(
IsEqualGUID
(
&
guid
,
&
MFVideoFormat_RGB8
),
"Unexpected guid %s.
\n
"
,
debugstr_guid
(
&
guid
));
else
if
(
vih
.
bmiHeader
.
biBitCount
==
4
)
todo_wine
ok
(
IsEqualGUID
(
&
guid
,
&
MFVideoFormat_RGB4
),
"Unexpected guid %s.
\n
"
,
debugstr_guid
(
&
guid
));
else
if
(
vih
.
bmiHeader
.
biBitCount
==
1
)
todo_wine
ok
(
IsEqualGUID
(
&
guid
,
&
MFVideoFormat_RGB1
),
"Unexpected guid %s.
\n
"
,
debugstr_guid
(
&
guid
));
value32
=
0xdeadbeef
;
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_DEFAULT_STRIDE
,
&
value32
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value32
==
-
64
,
"Unexpected value %d.
\n
"
,
value32
);
if
(
vih
.
bmiHeader
.
biBitCount
>
1
)
todo_wine
ok
(
value32
==
16
*
vih
.
bmiHeader
.
biBitCount
/
8
,
"Unexpected value %#x.
\n
"
,
value32
);
else
todo_wine
ok
(
value32
==
-
4
,
"Unexpected value %#x.
\n
"
,
value32
);
hr
=
IMFMediaType_GetItem
(
media_type
,
&
MF_MT_PALETTE
,
NULL
);
if
(
vih
.
bmiHeader
.
biBitCount
>
1
)
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
else
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
value32
=
0xdeadbeef
;
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_FIXED_SIZE_SAMPLES
,
&
value32
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!!
value32
,
"Unexpected value %#x.
\n
"
,
value32
);
todo_wine
ok
(
value32
==
1
,
"Unexpected value %#x.
\n
"
,
value32
);
value32
=
0xdeadbeef
;
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_ALL_SAMPLES_INDEPENDENT
,
&
value32
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!!
value32
,
"Unexpected value %#x.
\n
"
,
value32
);
todo_wine
ok
(
value32
==
1
,
"Unexpected value %#x.
\n
"
,
value32
);
/* Negative height. */
vih
.
bmiHeader
.
biHeight
=
-
32
;
value32
=
0xdeadbeef
;
vih
.
bmiHeader
.
biHeight
=
32
;
hr
=
MFInitMediaTypeFromVideoInfoHeader
(
media_type
,
&
vih
,
sizeof
(
vih
),
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetUINT32
(
media_type
,
&
MF_MT_DEFAULT_STRIDE
,
&
value32
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value32
==
64
,
"Unexpected value %d.
\n
"
,
value32
);
hr
=
IMFMediaType_GetUINT64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
&
value64
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
value64
==
((
UINT64
)
16
<<
32
|
32
),
"Unexpected value %#I64x.
\n
"
,
value64
);
if
(
vih
.
bmiHeader
.
biBitCount
>
1
)
todo_wine
ok
(
value32
==
-
16
*
vih
.
bmiHeader
.
biBitCount
/
8
,
"Unexpected value %#x.
\n
"
,
value32
);
else
todo_wine
ok
(
value32
==
-
4
,
"Unexpected value %#x.
\n
"
,
value32
);
vih
.
bmiHeader
.
biHeight
=
-
32
;
}
winetest_pop_context
();
}
failed:
IMFMediaType_Release
(
media_type
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment