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
399cec1b
Commit
399cec1b
authored
May 03, 2023
by
Giovanni Mascellani
Committed by
Alexandre Julliard
May 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/tests: Push image size and format as context.
parent
222d20a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
mfplat.c
dlls/mfplat/tests/mfplat.c
+16
-16
No files found.
dlls/mfplat/tests/mfplat.c
View file @
399cec1b
...
...
@@ -6124,26 +6124,25 @@ static void test_MFCreate2DMediaBuffer(void)
if
(
is_MEDIASUBTYPE_RGB
(
ptr
->
subtype
))
continue
;
winetest_push_context
(
"%u, %u x %u, format %s"
,
i
,
ptr
->
width
,
ptr
->
height
,
wine_dbgstr_guid
(
ptr
->
subtype
));
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
);
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
));
ok
(
length
==
ptr
->
max_length
,
"Unexpected maximum length %lu.
\n
"
,
length
);
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMF2DBuffer
,
(
void
**
)
&
_2dbuffer
);
ok
(
hr
==
S_OK
,
"Failed to get interface, hr %#lx.
\n
"
,
hr
);
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_guid
(
ptr
->
subtype
));
ok
(
length
==
ptr
->
contiguous_length
,
"Unexpected contiguous length %lu.
\n
"
,
length
);
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_guid
(
ptr
->
subtype
));
ok
(
length2
==
ptr
->
contiguous_length
,
"Unexpected linear buffer length %lu.
\n
"
,
length2
);
hr
=
pMFGetStrideForBitmapInfoHeader
(
ptr
->
subtype
->
Data1
,
ptr
->
width
,
&
stride
);
ok
(
hr
==
S_OK
,
"Failed to get stride, hr %#lx.
\n
"
,
hr
);
...
...
@@ -6203,8 +6202,8 @@ static void test_MFCreate2DMediaBuffer(void)
for
(
j
=
0
;
j
<
ptr
->
height
;
j
++
)
for
(
k
=
0
;
k
<
stride
;
k
++
)
ok
(
data
[
j
*
pitch
+
k
]
==
((
j
%
16
)
<<
4
)
+
(
k
%
16
),
"Unexpected byte %02x instead of %02x at
test %d
row %d column %d.
\n
"
,
data
[
j
*
pitch
+
k
],
((
j
%
16
)
<<
4
)
+
(
k
%
16
),
i
,
j
,
k
);
"Unexpected byte %02x instead of %02x at row %d column %d.
\n
"
,
data
[
j
*
pitch
+
k
],
((
j
%
16
)
<<
4
)
+
(
k
%
16
),
j
,
k
);
data
+=
ptr
->
height
*
pitch
;
...
...
@@ -6216,8 +6215,8 @@ static void test_MFCreate2DMediaBuffer(void)
for
(
j
=
0
;
j
<
ptr
->
height
;
j
++
)
for
(
k
=
0
;
k
<
stride
/
2
;
k
++
)
ok
(
data
[
j
*
pitch
+
k
]
==
(((
j
+
ptr
->
height
)
%
16
)
<<
4
)
+
(
k
%
16
),
"Unexpected byte %02x instead of %02x at
test %d
row %d column %d.
\n
"
,
data
[
j
*
pitch
+
k
],
(((
j
+
ptr
->
height
)
%
16
)
<<
4
)
+
(
k
%
16
),
i
,
j
+
ptr
->
height
,
k
);
"Unexpected byte %02x instead of %02x at row %d column %d.
\n
"
,
data
[
j
*
pitch
+
k
],
(((
j
+
ptr
->
height
)
%
16
)
<<
4
)
+
(
k
%
16
),
j
+
ptr
->
height
,
k
);
break
;
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
):
...
...
@@ -6225,16 +6224,16 @@ static void test_MFCreate2DMediaBuffer(void)
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
),
"Unexpected byte %02x instead of %02x at
test %d
row %d column %d.
\n
"
,
data
[
j
*
(
pitch
/
2
)
+
k
],
(((
j
+
ptr
->
height
)
%
16
)
<<
4
)
+
(
k
%
16
),
i
,
j
+
ptr
->
height
,
k
);
"Unexpected byte %02x instead of %02x at row %d column %d.
\n
"
,
data
[
j
*
(
pitch
/
2
)
+
k
],
(((
j
+
ptr
->
height
)
%
16
)
<<
4
)
+
(
k
%
16
),
j
+
ptr
->
height
,
k
);
break
;
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
):
for
(
j
=
0
;
j
<
ptr
->
height
/
2
;
j
++
)
for
(
k
=
0
;
k
<
stride
;
k
++
)
ok
(
data
[
j
*
pitch
+
k
]
==
(((
j
+
ptr
->
height
)
%
16
)
<<
4
)
+
(
k
%
16
),
"Unexpected byte %02x instead of %02x at
test %d
row %d column %d.
\n
"
,
data
[
j
*
pitch
+
k
],
(((
j
+
ptr
->
height
)
%
16
)
<<
4
)
+
(
k
%
16
),
i
,
j
+
ptr
->
height
,
k
);
"Unexpected byte %02x instead of %02x at row %d column %d.
\n
"
,
data
[
j
*
pitch
+
k
],
(((
j
+
ptr
->
height
)
%
16
)
<<
4
)
+
(
k
%
16
),
j
+
ptr
->
height
,
k
);
break
;
default:
...
...
@@ -6244,8 +6243,7 @@ static void test_MFCreate2DMediaBuffer(void)
hr
=
IMF2DBuffer_Unlock2D
(
_2dbuffer
);
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_guid
(
ptr
->
subtype
));
ok
(
pitch
==
ptr
->
pitch
,
"Unexpected pitch %ld, expected %d.
\n
"
,
pitch
,
ptr
->
pitch
);
ret
=
TRUE
;
hr
=
IMF2DBuffer_IsContiguousFormat
(
_2dbuffer
,
&
ret
);
...
...
@@ -6255,6 +6253,8 @@ static void test_MFCreate2DMediaBuffer(void)
IMF2DBuffer_Release
(
_2dbuffer
);
IMFMediaBuffer_Release
(
buffer
);
winetest_pop_context
();
}
/* Alignment tests */
...
...
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