Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b7fe6359
Commit
b7fe6359
authored
May 09, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Oct 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/buffer: Do not flip in memory_2d_buffer_ContiguousCopy{From|To}().
parent
8487666e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
buffer.c
dlls/mfplat/buffer.c
+8
-2
mfplat.c
dlls/mfplat/tests/mfplat.c
+7
-7
No files found.
dlls/mfplat/buffer.c
View file @
b7fe6359
...
@@ -626,7 +626,10 @@ static HRESULT WINAPI memory_2d_buffer_ContiguousCopyTo(IMF2DBuffer2 *iface, BYT
...
@@ -626,7 +626,10 @@ static HRESULT WINAPI memory_2d_buffer_ContiguousCopyTo(IMF2DBuffer2 *iface, BYT
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
copy_image
(
buffer
,
dest_buffer
,
buffer
->
_2d
.
width
,
src_scanline0
,
src_pitch
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
height
);
if
(
src_pitch
<
0
)
src_pitch
=
-
src_pitch
;
copy_image
(
buffer
,
dest_buffer
,
buffer
->
_2d
.
width
,
src_buffer_start
,
src_pitch
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
height
);
if
(
FAILED
(
IMF2DBuffer2_Unlock2D
(
iface
)))
if
(
FAILED
(
IMF2DBuffer2_Unlock2D
(
iface
)))
WARN
(
"Couldn't unlock source buffer %p, hr %#lx.
\n
"
,
iface
,
hr
);
WARN
(
"Couldn't unlock source buffer %p, hr %#lx.
\n
"
,
iface
,
hr
);
...
@@ -652,7 +655,10 @@ static HRESULT WINAPI memory_2d_buffer_ContiguousCopyFrom(IMF2DBuffer2 *iface, c
...
@@ -652,7 +655,10 @@ static HRESULT WINAPI memory_2d_buffer_ContiguousCopyFrom(IMF2DBuffer2 *iface, c
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
copy_image
(
buffer
,
dst_scanline0
,
dst_pitch
,
src_buffer
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
height
);
if
(
dst_pitch
<
0
)
dst_pitch
=
-
dst_pitch
;
copy_image
(
buffer
,
dst_buffer_start
,
dst_pitch
,
src_buffer
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
height
);
if
(
FAILED
(
IMF2DBuffer2_Unlock2D
(
iface
)))
if
(
FAILED
(
IMF2DBuffer2_Unlock2D
(
iface
)))
WARN
(
"Couldn't unlock destination buffer %p, hr %#lx.
\n
"
,
iface
,
hr
);
WARN
(
"Couldn't unlock destination buffer %p, hr %#lx.
\n
"
,
iface
,
hr
);
...
...
dlls/mfplat/tests/mfplat.c
View file @
b7fe6359
...
@@ -9506,9 +9506,9 @@ static void test_MFCreatePathFromURL(void)
...
@@ -9506,9 +9506,9 @@ static void test_MFCreatePathFromURL(void)
}
}
}
}
#define check_reset_data(a, b, c, d, e
, f) check_reset_data_(__LINE__, a, b, c, d, e, f
)
#define check_reset_data(a, b, c, d, e
) check_reset_data_(__LINE__, a, b, c, d, e
)
static
void
check_reset_data_
(
unsigned
int
line
,
IMF2DBuffer2
*
buffer2d
,
const
BYTE
*
data
,
BOOL
bottom_up
,
static
void
check_reset_data_
(
unsigned
int
line
,
IMF2DBuffer2
*
buffer2d
,
const
BYTE
*
data
,
BOOL
bottom_up
,
DWORD
width
,
DWORD
height
,
BOOL
todo
)
DWORD
width
,
DWORD
height
)
{
{
BYTE
*
scanline0
,
*
buffer_start
;
BYTE
*
scanline0
,
*
buffer_start
;
DWORD
length
,
max_length
;
DWORD
length
,
max_length
;
...
@@ -9534,7 +9534,7 @@ static void check_reset_data_(unsigned int line, IMF2DBuffer2 *buffer2d, const B
...
@@ -9534,7 +9534,7 @@ static void check_reset_data_(unsigned int line, IMF2DBuffer2 *buffer2d, const B
ok
(
buffer_start
==
scanline0
,
"buffer start mismatch.
\n
"
);
ok
(
buffer_start
==
scanline0
,
"buffer start mismatch.
\n
"
);
}
}
for
(
i
=
0
;
i
<
height
;
++
i
)
for
(
i
=
0
;
i
<
height
;
++
i
)
todo_wine_if
(
bottom_up
&&
todo
)
ok_
(
__FILE__
,
line
)(
!
memcmp
(
buffer_start
+
abs
(
pitch
)
*
i
,
data
+
width
*
i
*
4
,
width
*
4
),
ok_
(
__FILE__
,
line
)(
!
memcmp
(
buffer_start
+
abs
(
pitch
)
*
i
,
data
+
width
*
i
*
4
,
width
*
4
),
"2D Data mismatch, scaline %d.
\n
"
,
i
);
"2D Data mismatch, scaline %d.
\n
"
,
i
);
hr
=
IMF2DBuffer2_Unlock2D
(
buffer2d
);
hr
=
IMF2DBuffer2_Unlock2D
(
buffer2d
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
...
@@ -9543,7 +9543,7 @@ static void check_reset_data_(unsigned int line, IMF2DBuffer2 *buffer2d, const B
...
@@ -9543,7 +9543,7 @@ static void check_reset_data_(unsigned int line, IMF2DBuffer2 *buffer2d, const B
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
max_length
==
width
*
height
*
4
,
"got max_length %lu.
\n
"
,
max_length
);
ok_
(
__FILE__
,
line
)(
max_length
==
width
*
height
*
4
,
"got max_length %lu.
\n
"
,
max_length
);
ok_
(
__FILE__
,
line
)(
length
==
width
*
height
*
4
,
"got length %lu.
\n
"
,
length
);
ok_
(
__FILE__
,
line
)(
length
==
width
*
height
*
4
,
"got length %lu.
\n
"
,
length
);
todo_wine_if
(
bottom_up
&&
todo
)
ok_
(
__FILE__
,
line
)(
!
memcmp
(
lock
,
data
,
length
),
"contiguous data mismatch.
\n
"
);
ok_
(
__FILE__
,
line
)(
!
memcmp
(
lock
,
data
,
length
),
"contiguous data mismatch.
\n
"
);
memset
(
lock
,
0xcc
,
length
);
memset
(
lock
,
0xcc
,
length
);
hr
=
IMFMediaBuffer_Unlock
(
buffer
);
hr
=
IMFMediaBuffer_Unlock
(
buffer
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
...
@@ -9600,7 +9600,7 @@ static void test_2dbuffer_copy_(IMFMediaBuffer *buffer, BOOL bottom_up, DWORD wi
...
@@ -9600,7 +9600,7 @@ static void test_2dbuffer_copy_(IMFMediaBuffer *buffer, BOOL bottom_up, DWORD wi
memset
(
data
,
0xcc
,
sizeof
(
data
));
memset
(
data
,
0xcc
,
sizeof
(
data
));
data
[
0
]
=
((
BYTE
*
)
test_data
)[
0
];
data
[
0
]
=
((
BYTE
*
)
test_data
)[
0
];
check_reset_data
(
buffer2d
,
data
,
bottom_up
,
width
,
height
,
FALSE
);
check_reset_data
(
buffer2d
,
data
,
bottom_up
,
width
,
height
);
hr
=
IMF2DBuffer2_ContiguousCopyFrom
(
buffer2d
,
(
BYTE
*
)
test_data
,
sizeof
(
test_data
));
hr
=
IMF2DBuffer2_ContiguousCopyFrom
(
buffer2d
,
(
BYTE
*
)
test_data
,
sizeof
(
test_data
));
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
...
@@ -9608,7 +9608,7 @@ static void test_2dbuffer_copy_(IMFMediaBuffer *buffer, BOOL bottom_up, DWORD wi
...
@@ -9608,7 +9608,7 @@ static void test_2dbuffer_copy_(IMFMediaBuffer *buffer, BOOL bottom_up, DWORD wi
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
!
memcmp
(
data
,
test_data
,
sizeof
(
data
)),
"data mismatch.
\n
"
);
ok
(
!
memcmp
(
data
,
test_data
,
sizeof
(
data
)),
"data mismatch.
\n
"
);
check_reset_data
(
buffer2d
,
(
const
BYTE
*
)
test_data
,
bottom_up
,
width
,
height
,
TRUE
);
check_reset_data
(
buffer2d
,
(
const
BYTE
*
)
test_data
,
bottom_up
,
width
,
height
);
hr
=
IMFMediaBuffer_SetCurrentLength
(
src_buffer
,
sizeof
(
test_data
)
+
1
);
hr
=
IMFMediaBuffer_SetCurrentLength
(
src_buffer
,
sizeof
(
test_data
)
+
1
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
...
@@ -9620,7 +9620,7 @@ static void test_2dbuffer_copy_(IMFMediaBuffer *buffer, BOOL bottom_up, DWORD wi
...
@@ -9620,7 +9620,7 @@ static void test_2dbuffer_copy_(IMFMediaBuffer *buffer, BOOL bottom_up, DWORD wi
hr
=
IMFSample_CopyToBuffer
(
sample
,
buffer
);
hr
=
IMFSample_CopyToBuffer
(
sample
,
buffer
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
check_reset_data
(
buffer2d
,
(
const
BYTE
*
)
test_data
,
bottom_up
,
width
,
height
,
FALSE
);
check_reset_data
(
buffer2d
,
(
const
BYTE
*
)
test_data
,
bottom_up
,
width
,
height
);
IMF2DBuffer2_Release
(
buffer2d
);
IMF2DBuffer2_Release
(
buffer2d
);
ref
=
IMFSample_Release
(
sample
);
ref
=
IMFSample_Release
(
sample
);
...
...
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