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
885d8dfa
Commit
885d8dfa
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/buffer: Implement IMF2DBuffer::ContiguousCopyTo().
parent
8c0a1dfb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
buffer.c
dlls/mfplat/buffer.c
+21
-2
mfplat.c
dlls/mfplat/tests/mfplat.c
+5
-5
No files found.
dlls/mfplat/buffer.c
View file @
885d8dfa
...
@@ -601,9 +601,28 @@ static HRESULT WINAPI memory_2d_buffer_GetContiguousLength(IMF2DBuffer2 *iface,
...
@@ -601,9 +601,28 @@ static HRESULT WINAPI memory_2d_buffer_GetContiguousLength(IMF2DBuffer2 *iface,
static
HRESULT
WINAPI
memory_2d_buffer_ContiguousCopyTo
(
IMF2DBuffer2
*
iface
,
BYTE
*
dest_buffer
,
DWORD
dest_length
)
static
HRESULT
WINAPI
memory_2d_buffer_ContiguousCopyTo
(
IMF2DBuffer2
*
iface
,
BYTE
*
dest_buffer
,
DWORD
dest_length
)
{
{
FIXME
(
"%p, %p, %lu.
\n
"
,
iface
,
dest_buffer
,
dest_length
);
struct
buffer
*
buffer
=
impl_from_IMF2DBuffer2
(
iface
);
BYTE
*
src_scanline0
,
*
src_buffer_start
;
DWORD
src_length
;
LONG
src_pitch
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %lu.
\n
"
,
iface
,
dest_buffer
,
dest_length
);
if
(
dest_length
<
buffer
->
_2d
.
plane_size
)
return
E_INVALIDARG
;
hr
=
IMF2DBuffer2_Lock2DSize
(
iface
,
MF2DBuffer_LockFlags_Read
,
&
src_scanline0
,
&
src_pitch
,
&
src_buffer_start
,
&
src_length
);
if
(
SUCCEEDED
(
hr
))
{
copy_image
(
buffer
,
dest_buffer
,
buffer
->
_2d
.
width
,
src_scanline0
,
src_pitch
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
height
);
if
(
FAILED
(
IMF2DBuffer2_Unlock2D
(
iface
)))
WARN
(
"Couldn't unlock source buffer %p, hr %#lx.
\n
"
,
iface
,
hr
);
}
return
S_OK
;
}
}
static
HRESULT
WINAPI
memory_2d_buffer_ContiguousCopyFrom
(
IMF2DBuffer2
*
iface
,
const
BYTE
*
src_buffer
,
DWORD
src_length
)
static
HRESULT
WINAPI
memory_2d_buffer_ContiguousCopyFrom
(
IMF2DBuffer2
*
iface
,
const
BYTE
*
src_buffer
,
DWORD
src_length
)
...
...
dlls/mfplat/tests/mfplat.c
View file @
885d8dfa
...
@@ -6259,12 +6259,12 @@ static void test_MFCreate2DMediaBuffer(void)
...
@@ -6259,12 +6259,12 @@ static void test_MFCreate2DMediaBuffer(void)
ok
(
hr
==
S_OK
,
"Failed to unlock buffer, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to unlock buffer, hr %#lx.
\n
"
,
hr
);
hr
=
IMF2DBuffer2_ContiguousCopyTo
(
_2dbuffer2
,
data2
,
ptr
->
contiguous_length
-
1
);
hr
=
IMF2DBuffer2_ContiguousCopyTo
(
_2dbuffer2
,
data2
,
ptr
->
contiguous_length
-
1
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
memset
(
data2
,
0xff
,
ptr
->
contiguous_length
+
16
);
memset
(
data2
,
0xff
,
ptr
->
contiguous_length
+
16
);
hr
=
IMF2DBuffer2_ContiguousCopyTo
(
_2dbuffer2
,
data2
,
ptr
->
contiguous_length
+
16
);
hr
=
IMF2DBuffer2_ContiguousCopyTo
(
_2dbuffer2
,
data2
,
ptr
->
contiguous_length
+
16
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to copy to contiguous buffer, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to copy to contiguous buffer, hr %#lx.
\n
"
,
hr
);
for
(
j
=
0
;
j
<
ptr
->
contiguous_length
;
j
++
)
for
(
j
=
0
;
j
<
ptr
->
contiguous_length
;
j
++
)
{
{
...
@@ -6278,12 +6278,12 @@ static void test_MFCreate2DMediaBuffer(void)
...
@@ -6278,12 +6278,12 @@ static void test_MFCreate2DMediaBuffer(void)
if
(
data2
[
j
]
!=
(
j
&
0x7f
))
if
(
data2
[
j
]
!=
(
j
&
0x7f
))
break
;
break
;
}
}
todo_wine
ok
(
j
==
ptr
->
contiguous_length
,
"Unexpected byte %02x instead of %02x at position %u.
\n
"
,
data2
[
j
],
j
&
0x7f
,
j
);
ok
(
j
==
ptr
->
contiguous_length
,
"Unexpected byte %02x instead of %02x at position %u.
\n
"
,
data2
[
j
],
j
&
0x7f
,
j
);
memset
(
data2
,
0xff
,
ptr
->
contiguous_length
+
16
);
memset
(
data2
,
0xff
,
ptr
->
contiguous_length
+
16
);
hr
=
IMF2DBuffer2_ContiguousCopyTo
(
_2dbuffer2
,
data2
,
ptr
->
contiguous_length
);
hr
=
IMF2DBuffer2_ContiguousCopyTo
(
_2dbuffer2
,
data2
,
ptr
->
contiguous_length
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to copy to contiguous buffer, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to copy to contiguous buffer, hr %#lx.
\n
"
,
hr
);
for
(
j
=
0
;
j
<
ptr
->
contiguous_length
;
j
++
)
for
(
j
=
0
;
j
<
ptr
->
contiguous_length
;
j
++
)
{
{
...
@@ -6297,7 +6297,7 @@ static void test_MFCreate2DMediaBuffer(void)
...
@@ -6297,7 +6297,7 @@ static void test_MFCreate2DMediaBuffer(void)
if
(
data2
[
j
]
!=
(
j
&
0x7f
))
if
(
data2
[
j
]
!=
(
j
&
0x7f
))
break
;
break
;
}
}
todo_wine
ok
(
j
==
ptr
->
contiguous_length
,
"Unexpected byte %02x instead of %02x at position %u.
\n
"
,
data2
[
j
],
j
&
0x7f
,
j
);
ok
(
j
==
ptr
->
contiguous_length
,
"Unexpected byte %02x instead of %02x at position %u.
\n
"
,
data2
[
j
],
j
&
0x7f
,
j
);
free
(
data2
);
free
(
data2
);
...
...
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