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
ae32fb46
Commit
ae32fb46
authored
Dec 21, 2022
by
Ziqing Hui
Committed by
Alexandre Julliard
Dec 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/tests: Add MEDIASUBTYPE_RGB* and NV11 image size tests.
parent
aa7f3b1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
mfplat.c
dlls/mfplat/tests/mfplat.c
+45
-0
No files found.
dlls/mfplat/tests/mfplat.c
View file @
ae32fb46
...
@@ -337,6 +337,15 @@ static WCHAR *load_resource(const WCHAR *name)
...
@@ -337,6 +337,15 @@ static WCHAR *load_resource(const WCHAR *name)
return
pathW
;
return
pathW
;
}
}
static
BOOL
is_MEDIASUBTYPE_RGB
(
const
GUID
*
subtype
)
{
return
IsEqualGUID
(
subtype
,
&
MEDIASUBTYPE_RGB8
)
||
IsEqualGUID
(
subtype
,
&
MEDIASUBTYPE_RGB555
)
||
IsEqualGUID
(
subtype
,
&
MEDIASUBTYPE_RGB565
)
||
IsEqualGUID
(
subtype
,
&
MEDIASUBTYPE_RGB24
)
||
IsEqualGUID
(
subtype
,
&
MEDIASUBTYPE_RGB32
);
}
struct
test_callback
struct
test_callback
{
{
IMFAsyncCallback
IMFAsyncCallback_iface
;
IMFAsyncCallback
IMFAsyncCallback_iface
;
...
@@ -4261,6 +4270,16 @@ image_size_tests[] =
...
@@ -4261,6 +4270,16 @@ image_size_tests[] =
{
&
MFVideoFormat_A2R10G10B10
,
1
,
1
,
4
,
0
,
64
,
4
,
64
},
{
&
MFVideoFormat_A2R10G10B10
,
1
,
1
,
4
,
0
,
64
,
4
,
64
},
{
&
MFVideoFormat_A16B16G16R16F
,
3
,
5
,
120
,
0
,
320
,
120
,
64
},
{
&
MFVideoFormat_A16B16G16R16F
,
3
,
5
,
120
,
0
,
320
,
120
,
64
},
{
&
MFVideoFormat_A16B16G16R16F
,
1
,
1
,
8
,
0
,
64
,
8
,
64
},
{
&
MFVideoFormat_A16B16G16R16F
,
1
,
1
,
8
,
0
,
64
,
8
,
64
},
{
&
MEDIASUBTYPE_RGB8
,
3
,
5
,
20
},
{
&
MEDIASUBTYPE_RGB8
,
1
,
1
,
4
},
{
&
MEDIASUBTYPE_RGB555
,
3
,
5
,
40
},
{
&
MEDIASUBTYPE_RGB555
,
1
,
1
,
4
},
{
&
MEDIASUBTYPE_RGB565
,
3
,
5
,
40
},
{
&
MEDIASUBTYPE_RGB565
,
1
,
1
,
4
},
{
&
MEDIASUBTYPE_RGB24
,
3
,
5
,
60
},
{
&
MEDIASUBTYPE_RGB24
,
1
,
1
,
4
},
{
&
MEDIASUBTYPE_RGB32
,
3
,
5
,
60
},
{
&
MEDIASUBTYPE_RGB32
,
1
,
1
,
4
},
/* YUV 4:4:4, 32 bpp, packed */
/* YUV 4:4:4, 32 bpp, packed */
{
&
MFVideoFormat_AYUV
,
1
,
1
,
4
,
0
,
64
,
4
,
64
},
{
&
MFVideoFormat_AYUV
,
1
,
1
,
4
,
0
,
64
,
4
,
64
},
...
@@ -4338,6 +4357,15 @@ image_size_tests[] =
...
@@ -4338,6 +4357,15 @@ image_size_tests[] =
{
&
MFVideoFormat_IMC4
,
4
,
2
,
12
,
0
,
384
,
12
,
128
},
{
&
MFVideoFormat_IMC4
,
4
,
2
,
12
,
0
,
384
,
12
,
128
},
{
&
MFVideoFormat_IMC4
,
4
,
3
,
18
,
0
,
576
,
18
,
128
},
{
&
MFVideoFormat_IMC4
,
4
,
3
,
18
,
0
,
576
,
18
,
128
},
{
&
MFVideoFormat_IMC4
,
320
,
240
,
115200
,
0
,
138240
,
115200
,
384
},
{
&
MFVideoFormat_IMC4
,
320
,
240
,
115200
,
0
,
138240
,
115200
,
384
},
/* YUV 4:1:1, 12 bpp, semi-planar */
{
&
MFVideoFormat_NV11
,
1
,
3
,
18
,
4
,
576
,
3
,
128
},
{
&
MFVideoFormat_NV11
,
1
,
2
,
12
,
3
,
384
,
2
,
128
},
{
&
MFVideoFormat_NV11
,
2
,
2
,
12
,
6
,
384
,
6
,
128
},
{
&
MFVideoFormat_NV11
,
2
,
4
,
24
,
12
,
768
,
12
,
128
},
{
&
MFVideoFormat_NV11
,
3
,
2
,
12
,
9
,
384
,
8
,
128
},
{
&
MFVideoFormat_NV11
,
4
,
2
,
12
,
0
,
384
,
12
,
128
},
{
&
MFVideoFormat_NV11
,
320
,
240
,
115200
,
0
,
138240
,
115200
,
384
},
};
};
static
void
test_MFCalculateImageSize
(
void
)
static
void
test_MFCalculateImageSize
(
void
)
...
@@ -4360,7 +4388,9 @@ static void test_MFCalculateImageSize(void)
...
@@ -4360,7 +4388,9 @@ static void test_MFCalculateImageSize(void)
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_A2R10G10B10
);
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_A2R10G10B10
);
hr
=
MFCalculateImageSize
(
ptr
->
subtype
,
ptr
->
width
,
ptr
->
height
,
&
size
);
hr
=
MFCalculateImageSize
(
ptr
->
subtype
,
ptr
->
width
,
ptr
->
height
,
&
size
);
todo_wine_if
(
is_MEDIASUBTYPE_RGB
(
ptr
->
subtype
)
||
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_NV11
))
ok
(
hr
==
S_OK
||
(
is_broken
&&
hr
==
E_INVALIDARG
),
"%u: failed to calculate image size, hr %#lx.
\n
"
,
i
,
hr
);
ok
(
hr
==
S_OK
||
(
is_broken
&&
hr
==
E_INVALIDARG
),
"%u: failed to calculate image size, hr %#lx.
\n
"
,
i
,
hr
);
todo_wine_if
(
is_MEDIASUBTYPE_RGB
(
ptr
->
subtype
)
||
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_NV11
))
ok
(
size
==
ptr
->
size
,
"%u: unexpected image size %u, expected %u. Size %u x %u, format %s.
\n
"
,
i
,
size
,
ptr
->
size
,
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
));
ptr
->
width
,
ptr
->
height
,
wine_dbgstr_an
((
char
*
)
&
ptr
->
subtype
->
Data1
,
4
));
}
}
...
@@ -4387,9 +4417,12 @@ static void test_MFGetPlaneSize(void)
...
@@ -4387,9 +4417,12 @@ static void test_MFGetPlaneSize(void)
{
{
const
struct
image_size_test
*
ptr
=
&
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
;
unsigned
int
plane_size
=
ptr
->
plane_size
?
ptr
->
plane_size
:
ptr
->
size
;
if
((
is_MEDIASUBTYPE_RGB
(
ptr
->
subtype
)))
plane_size
=
0
;
hr
=
pMFGetPlaneSize
(
ptr
->
subtype
->
Data1
,
ptr
->
width
,
ptr
->
height
,
&
size
);
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
(
hr
==
S_OK
,
"%u: failed to get plane size, hr %#lx.
\n
"
,
i
,
hr
);
todo_wine_if
(
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_NV11
))
ok
(
size
==
plane_size
,
"%u: unexpected plane size %lu, expected %u. Size %u x %u, format %s.
\n
"
,
i
,
size
,
plane_size
,
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
));
ptr
->
width
,
ptr
->
height
,
wine_dbgstr_an
((
char
*
)
&
ptr
->
subtype
->
Data1
,
4
));
}
}
...
@@ -5932,8 +5965,14 @@ static void test_MFCreate2DMediaBuffer(void)
...
@@ -5932,8 +5965,14 @@ static void test_MFCreate2DMediaBuffer(void)
{
{
const
struct
image_size_test
*
ptr
=
&
image_size_tests
[
i
];
const
struct
image_size_test
*
ptr
=
&
image_size_tests
[
i
];
if
(
is_MEDIASUBTYPE_RGB
(
ptr
->
subtype
))
continue
;
hr
=
pMFCreate2DMediaBuffer
(
ptr
->
width
,
ptr
->
height
,
ptr
->
subtype
->
Data1
,
FALSE
,
&
buffer
);
hr
=
pMFCreate2DMediaBuffer
(
ptr
->
width
,
ptr
->
height
,
ptr
->
subtype
->
Data1
,
FALSE
,
&
buffer
);
todo_wine_if
(
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_NV11
))
ok
(
hr
==
S_OK
,
"Failed to create a buffer, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create a buffer, hr %#lx.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
continue
;
hr
=
IMFMediaBuffer_GetMaxLength
(
buffer
,
&
length
);
hr
=
IMFMediaBuffer_GetMaxLength
(
buffer
,
&
length
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
...
@@ -6070,8 +6109,14 @@ static void test_MFCreate2DMediaBuffer(void)
...
@@ -6070,8 +6109,14 @@ static void test_MFCreate2DMediaBuffer(void)
{
{
const
struct
image_size_test
*
ptr
=
&
image_size_tests
[
i
];
const
struct
image_size_test
*
ptr
=
&
image_size_tests
[
i
];
if
(
is_MEDIASUBTYPE_RGB
(
ptr
->
subtype
))
continue
;
hr
=
pMFCreate2DMediaBuffer
(
ptr
->
width
,
ptr
->
height
,
ptr
->
subtype
->
Data1
,
FALSE
,
&
buffer
);
hr
=
pMFCreate2DMediaBuffer
(
ptr
->
width
,
ptr
->
height
,
ptr
->
subtype
->
Data1
,
FALSE
,
&
buffer
);
todo_wine_if
(
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_NV11
))
ok
(
hr
==
S_OK
,
"Failed to create a buffer, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to create a buffer, hr %#lx.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
continue
;
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMF2DBuffer
,
(
void
**
)
&
_2dbuffer
);
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMF2DBuffer
,
(
void
**
)
&
_2dbuffer
);
ok
(
hr
==
S_OK
,
"Failed to get interface, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get interface, hr %#lx.
\n
"
,
hr
);
...
...
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