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
cd719c7c
Commit
cd719c7c
authored
Jul 11, 2022
by
Giovanni Mascellani
Committed by
Alexandre Julliard
May 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/tests: Test IMF2DBuffer::ContiguousCopyFrom().
parent
73dbdf30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
mfplat.c
dlls/mfplat/tests/mfplat.c
+69
-0
No files found.
dlls/mfplat/tests/mfplat.c
View file @
cd719c7c
...
@@ -6181,14 +6181,82 @@ static void test_MFCreate2DMediaBuffer(void)
...
@@ -6181,14 +6181,82 @@ static void test_MFCreate2DMediaBuffer(void)
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
);
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMF2DBuffer2
,
(
void
**
)
&
_2dbuffer2
);
ok
(
hr
==
S_OK
,
"Failed to get interface, hr %#lx.
\n
"
,
hr
);
hr
=
IMF2DBuffer_GetContiguousLength
(
_2dbuffer
,
&
length
);
hr
=
IMF2DBuffer_GetContiguousLength
(
_2dbuffer
,
&
length
);
ok
(
hr
==
S_OK
,
"Failed to get length, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get length, hr %#lx.
\n
"
,
hr
);
ok
(
length
==
ptr
->
contiguous_length
,
"Unexpected contiguous length %lu.
\n
"
,
length
);
ok
(
length
==
ptr
->
contiguous_length
,
"Unexpected contiguous length %lu.
\n
"
,
length
);
data2
=
malloc
(
ptr
->
contiguous_length
+
16
);
ok
(
!!
data2
,
"Failed to allocate buffer.
\n
"
);
for
(
j
=
0
;
j
<
ptr
->
contiguous_length
+
16
;
j
++
)
data2
[
j
]
=
j
&
0x7f
;
hr
=
IMF2DBuffer2_ContiguousCopyFrom
(
_2dbuffer2
,
data2
,
ptr
->
contiguous_length
-
1
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
&
length2
,
NULL
);
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
&
length2
,
NULL
);
ok
(
hr
==
S_OK
,
"Failed to lock buffer, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to lock buffer, hr %#lx.
\n
"
,
hr
);
ok
(
length2
==
ptr
->
contiguous_length
,
"Unexpected linear buffer length %lu.
\n
"
,
length2
);
ok
(
length2
==
ptr
->
contiguous_length
,
"Unexpected linear buffer length %lu.
\n
"
,
length2
);
memset
(
data
,
0xff
,
length2
);
hr
=
IMFMediaBuffer_Unlock
(
buffer
);
ok
(
hr
==
S_OK
,
"Failed to unlock buffer, hr %#lx.
\n
"
,
hr
);
hr
=
IMF2DBuffer2_ContiguousCopyFrom
(
_2dbuffer2
,
data2
,
ptr
->
contiguous_length
+
16
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to copy from contiguous buffer, hr %#lx.
\n
"
,
hr
);
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
));
for
(
j
=
0
;
j
<
ptr
->
contiguous_length
;
j
++
)
{
if
(
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_IMC1
)
||
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_IMC3
))
{
if
(
j
<
ptr
->
height
*
ptr
->
pitch
&&
j
%
ptr
->
pitch
>=
ptr
->
width
)
continue
;
if
(
j
>=
ptr
->
height
*
ptr
->
pitch
&&
j
%
ptr
->
pitch
>=
ptr
->
width
/
2
)
continue
;
}
if
(
data
[
j
]
!=
(
j
&
0x7f
))
break
;
}
todo_wine
ok
(
j
==
ptr
->
contiguous_length
,
"Unexpected byte %02x instead of %02x at position %u.
\n
"
,
data
[
j
],
j
&
0x7f
,
j
);
memset
(
data
,
0xff
,
length2
);
hr
=
IMFMediaBuffer_Unlock
(
buffer
);
ok
(
hr
==
S_OK
,
"Failed to unlock buffer, hr %#lx.
\n
"
,
hr
);
hr
=
IMF2DBuffer2_ContiguousCopyFrom
(
_2dbuffer2
,
data2
,
ptr
->
contiguous_length
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to copy from contiguous buffer, hr %#lx.
\n
"
,
hr
);
free
(
data2
);
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
));
for
(
j
=
0
;
j
<
ptr
->
contiguous_length
;
j
++
)
{
if
(
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_IMC1
)
||
IsEqualGUID
(
ptr
->
subtype
,
&
MFVideoFormat_IMC3
))
{
if
(
j
<
ptr
->
height
*
ptr
->
pitch
&&
j
%
ptr
->
pitch
>=
ptr
->
width
)
continue
;
if
(
j
>=
ptr
->
height
*
ptr
->
pitch
&&
j
%
ptr
->
pitch
>=
ptr
->
width
/
2
)
continue
;
}
if
(
data
[
j
]
!=
(
j
&
0x7f
))
break
;
}
todo_wine
ok
(
j
==
ptr
->
contiguous_length
,
"Unexpected byte %02x instead of %02x at position %u.
\n
"
,
data
[
j
],
j
&
0x7f
,
j
);
hr
=
pMFGetStrideForBitmapInfoHeader
(
ptr
->
subtype
->
Data1
,
ptr
->
width
,
&
stride
);
hr
=
pMFGetStrideForBitmapInfoHeader
(
ptr
->
subtype
->
Data1
,
ptr
->
width
,
&
stride
);
ok
(
hr
==
S_OK
,
"Failed to get stride, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get stride, hr %#lx.
\n
"
,
hr
);
stride
=
abs
(
stride
);
stride
=
abs
(
stride
);
...
@@ -6304,6 +6372,7 @@ static void test_MFCreate2DMediaBuffer(void)
...
@@ -6304,6 +6372,7 @@ static void test_MFCreate2DMediaBuffer(void)
ok
(
!
ret
,
"%d: unexpected format flag %d.
\n
"
,
i
,
ret
);
ok
(
!
ret
,
"%d: unexpected format flag %d.
\n
"
,
i
,
ret
);
IMF2DBuffer_Release
(
_2dbuffer
);
IMF2DBuffer_Release
(
_2dbuffer
);
IMF2DBuffer2_Release
(
_2dbuffer2
);
IMFMediaBuffer_Release
(
buffer
);
IMFMediaBuffer_Release
(
buffer
);
...
...
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