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
0d383fe1
Commit
0d383fe1
authored
Mar 30, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Add Lock()/Unlock() for d3d11 buffers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f404e309
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
15 deletions
+62
-15
buffer.c
dlls/mfplat/buffer.c
+61
-4
mfplat.c
dlls/mfplat/tests/mfplat.c
+1
-11
No files found.
dlls/mfplat/buffer.c
View file @
0d383fe1
...
...
@@ -914,16 +914,73 @@ static void dxgi_surface_buffer_unmap(struct buffer *buffer)
static
HRESULT
WINAPI
dxgi_surface_buffer_Lock
(
IMFMediaBuffer
*
iface
,
BYTE
**
data
,
DWORD
*
max_length
,
DWORD
*
current_length
)
{
FIXME
(
"%p, %p, %p, %p.
\n
"
,
iface
,
data
,
max_length
,
current_length
);
struct
buffer
*
buffer
=
impl_from_IMFMediaBuffer
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %p, %p.
\n
"
,
iface
,
data
,
max_length
,
current_length
);
if
(
!
data
)
return
E_POINTER
;
EnterCriticalSection
(
&
buffer
->
cs
);
if
(
!
buffer
->
_2d
.
linear_buffer
&&
buffer
->
_2d
.
locks
)
hr
=
MF_E_INVALIDREQUEST
;
else
if
(
!
buffer
->
_2d
.
linear_buffer
)
{
if
(
!
(
buffer
->
_2d
.
linear_buffer
=
heap_alloc
(
ALIGN_SIZE
(
buffer
->
_2d
.
plane_size
,
MF_64_BYTE_ALIGNMENT
))))
hr
=
E_OUTOFMEMORY
;
if
(
SUCCEEDED
(
hr
))
{
hr
=
dxgi_surface_buffer_map
(
buffer
);
if
(
SUCCEEDED
(
hr
))
{
MFCopyImage
(
buffer
->
_2d
.
linear_buffer
,
buffer
->
_2d
.
width
,
buffer
->
dxgi_surface
.
map_desc
.
pData
,
buffer
->
dxgi_surface
.
map_desc
.
RowPitch
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
height
);
}
}
}
if
(
SUCCEEDED
(
hr
))
{
++
buffer
->
_2d
.
locks
;
*
data
=
buffer
->
_2d
.
linear_buffer
;
if
(
max_length
)
*
max_length
=
buffer
->
_2d
.
plane_size
;
if
(
current_length
)
*
current_length
=
buffer
->
_2d
.
plane_size
;
}
LeaveCriticalSection
(
&
buffer
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
dxgi_surface_buffer_Unlock
(
IMFMediaBuffer
*
iface
)
{
FIXME
(
"%p.
\n
"
,
iface
);
struct
buffer
*
buffer
=
impl_from_IMFMediaBuffer
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p.
\n
"
,
iface
);
EnterCriticalSection
(
&
buffer
->
cs
);
if
(
!
buffer
->
_2d
.
linear_buffer
)
hr
=
HRESULT_FROM_WIN32
(
ERROR_WAS_UNLOCKED
);
else
if
(
!--
buffer
->
_2d
.
locks
)
{
MFCopyImage
(
buffer
->
dxgi_surface
.
map_desc
.
pData
,
buffer
->
dxgi_surface
.
map_desc
.
RowPitch
,
buffer
->
_2d
.
linear_buffer
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
height
);
dxgi_surface_buffer_unmap
(
buffer
);
heap_free
(
buffer
->
_2d
.
linear_buffer
);
buffer
->
_2d
.
linear_buffer
=
NULL
;
}
LeaveCriticalSection
(
&
buffer
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
dxgi_surface_buffer_SetCurrentLength
(
IMFMediaBuffer
*
iface
,
DWORD
current_length
)
...
...
dlls/mfplat/tests/mfplat.c
View file @
0d383fe1
...
...
@@ -6479,31 +6479,24 @@ static void test_dxgi_surface_buffer(void)
max_length
=
cur_length
=
0
;
data
=
NULL
;
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
&
max_length
,
&
cur_length
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
max_length
&&
max_length
==
cur_length
,
"Unexpected length %u.
\n
"
,
max_length
);
}
if
(
data
)
*
(
DWORD
*
)
data
=
~
0u
;
color
=
get_d3d11_texture_color
(
texture
,
0
,
0
);
ok
(
!
color
,
"Unexpected texture color %#x.
\n
"
,
color
);
hr
=
IMFMediaBuffer_Unlock
(
buffer
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
color
=
get_d3d11_texture_color
(
texture
,
0
,
0
);
todo_wine
ok
(
color
==
~
0u
,
"Unexpected texture color %#x.
\n
"
,
color
);
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
&
max_length
,
&
cur_length
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
ok
(
*
(
DWORD
*
)
data
==
~
0u
,
"Unexpected buffer %#x.
\n
"
,
*
(
DWORD
*
)
data
);
ok
(
*
(
DWORD
*
)
data
==
~
0u
,
"Unexpected buffer %#x.
\n
"
,
*
(
DWORD
*
)
data
);
hr
=
IMFMediaBuffer_Unlock
(
buffer
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* Lock2D()/Unlock2D() */
...
...
@@ -6526,7 +6519,6 @@ todo_wine
ok
(
data2
==
data
&&
pitch2
==
pitch
,
"Unexpected data/pitch.
\n
"
);
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
&
max_length
,
&
cur_length
);
todo_wine
ok
(
hr
==
MF_E_INVALIDREQUEST
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMF2DBuffer_Unlock2D
(
_2d_buffer
);
...
...
@@ -6906,11 +6898,9 @@ todo_wine
IMFDXGIBuffer_Release
(
dxgi_buffer
);
hr
=
IMFMediaBuffer_Lock
(
buffer
,
&
data
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaBuffer_Unlock
(
buffer
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
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