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
ee8ddf37
Commit
ee8ddf37
authored
Feb 14, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/tests: Add a separate test function for MFGetPlaneSize().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
30d670a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
114 additions
and
92 deletions
+114
-92
mfplat.c
dlls/mfplat/tests/mfplat.c
+114
-92
No files found.
dlls/mfplat/tests/mfplat.c
View file @
ee8ddf37
...
...
@@ -4117,104 +4117,102 @@ static void test_stream_descriptor(void)
IMFStreamDescriptor_Release
(
stream_desc
);
}
static
void
test_MFCalculateImageSize
(
void
)
static
const
struct
image_size_test
{
static
const
struct
image_size_test
{
const
GUID
*
subtype
;
UINT32
width
;
UINT32
height
;
UINT32
size
;
UINT32
plane_size
;
/* Matches image size when 0. */
}
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
},
const
GUID
*
subtype
;
UINT32
width
;
UINT32
height
;
UINT32
size
;
UINT32
plane_size
;
/* Matches image size when 0. */
}
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
},
};
/* 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
},
};
static
void
test_MFCalculateImageSize
(
void
)
{
unsigned
int
i
;
UINT32
size
;
HRESULT
hr
;
if
(
!
pMFGetPlaneSize
)
win_skip
(
"MFGetPlaneSize() is not available.
\n
"
);
size
=
1
;
hr
=
MFCalculateImageSize
(
&
IID_IUnknown
,
1
,
1
,
&
size
);
ok
(
hr
==
E_INVALIDARG
||
broken
(
hr
==
S_OK
)
/* Vista */
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -4244,6 +4242,29 @@ static void test_MFCalculateImageSize(void)
}
}
static
void
test_MFGetPlaneSize
(
void
)
{
unsigned
int
i
;
UINT32
size
;
HRESULT
hr
;
if
(
!
pMFGetPlaneSize
)
{
win_skip
(
"MFGetPlaneSize() is not available.
\n
"
);
return
;
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
image_size_tests
);
++
i
)
{
const
struct
image_size_test
*
ptr
=
&
image_size_tests
[
i
];
unsigned
int
plane_size
=
ptr
->
plane_size
?
ptr
->
plane_size
:
ptr
->
size
;
hr
=
pMFGetPlaneSize
(
ptr
->
subtype
->
Data1
,
ptr
->
width
,
ptr
->
height
,
&
size
);
ok
(
hr
==
S_OK
,
"%u: failed to get plane size, hr %#x.
\n
"
,
i
,
hr
);
ok
(
size
==
plane_size
,
"%u: unexpected plane size %u, expected %u.
\n
"
,
i
,
size
,
plane_size
);
}
}
static
void
test_MFCompareFullToPartialMediaType
(
void
)
{
IMFMediaType
*
full_type
,
*
partial_type
;
...
...
@@ -7940,6 +7961,7 @@ START_TEST(mfplat)
test_MFInvokeCallback
();
test_stream_descriptor
();
test_MFCalculateImageSize
();
test_MFGetPlaneSize
();
test_MFCompareFullToPartialMediaType
();
test_attributes_serialization
();
test_wrapped_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