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
cd397d1a
Commit
cd397d1a
authored
Mar 24, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Use texture pointer for DXGI surface buffer.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
31b88c38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
buffer.c
dlls/mfplat/buffer.c
+19
-7
No files found.
dlls/mfplat/buffer.c
View file @
cd397d1a
...
...
@@ -63,7 +63,7 @@ struct memory_buffer
}
d3d9_surface
;
struct
{
I
Unknown
*
surfac
e
;
I
D3D11Texture2D
*
textur
e
;
unsigned
int
subresource
;
struct
attributes
attributes
;
}
dxgi_surface
;
...
...
@@ -131,9 +131,9 @@ static ULONG WINAPI memory_buffer_Release(IMFMediaBuffer *iface)
{
if
(
buffer
->
d3d9_surface
.
surface
)
IDirect3DSurface9_Release
(
buffer
->
d3d9_surface
.
surface
);
if
(
buffer
->
dxgi_surface
.
surfac
e
)
if
(
buffer
->
dxgi_surface
.
textur
e
)
{
I
Unknown_Release
(
buffer
->
dxgi_surface
.
surfac
e
);
I
D3D11Texture2D_Release
(
buffer
->
dxgi_surface
.
textur
e
);
clear_attributes_object
(
&
buffer
->
dxgi_surface
.
attributes
);
}
DeleteCriticalSection
(
&
buffer
->
cs
);
...
...
@@ -913,7 +913,7 @@ static HRESULT WINAPI dxgi_buffer_GetResource(IMFDXGIBuffer *iface, REFIID riid,
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
return
I
Unknown_QueryInterface
(
buffer
->
dxgi_surface
.
surfac
e
,
riid
,
obj
);
return
I
D3D11Texture2D_QueryInterface
(
buffer
->
dxgi_surface
.
textur
e
,
riid
,
obj
);
}
static
HRESULT
WINAPI
dxgi_buffer_GetSubresourceIndex
(
IMFDXGIBuffer
*
iface
,
UINT
*
index
)
...
...
@@ -1170,32 +1170,44 @@ static HRESULT create_dxgi_surface_buffer(IUnknown *surface, UINT subresource, B
{
struct
memory_buffer
*
object
;
D3D11_TEXTURE2D_DESC
desc
;
ID3D11Texture2D
*
texture
;
unsigned
int
stride
;
D3DFORMAT
format
;
GUID
subtype
;
BOOL
is_yuv
;
HRESULT
hr
;
ID3D11Texture2D_GetDesc
((
ID3D11Texture2D
*
)
surface
,
&
desc
);
if
(
FAILED
(
hr
=
IUnknown_QueryInterface
(
surface
,
&
IID_ID3D11Texture2D
,
(
void
**
)
&
texture
)))
{
WARN
(
"Failed to get texture interface, hr %#x.
\n
"
,
hr
);
return
hr
;
}
ID3D11Texture2D_GetDesc
(
texture
,
&
desc
);
TRACE
(
"format %#x, %u x %u.
\n
"
,
desc
.
Format
,
desc
.
Width
,
desc
.
Height
);
memcpy
(
&
subtype
,
&
MFVideoFormat_Base
,
sizeof
(
subtype
));
subtype
.
Data1
=
format
=
MFMapDXGIFormatToDX9Format
(
desc
.
Format
);
if
(
!
(
stride
=
mf_format_get_stride
(
&
subtype
,
desc
.
Width
,
&
is_yuv
)))
{
ID3D11Texture2D_Release
(
texture
);
return
MF_E_INVALIDMEDIATYPE
;
}
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
{
ID3D11Texture2D_Release
(
texture
);
return
E_OUTOFMEMORY
;
}
object
->
IMFMediaBuffer_iface
.
lpVtbl
=
&
dxgi_surface_1d_buffer_vtbl
;
object
->
IMF2DBuffer2_iface
.
lpVtbl
=
&
dxgi_surface_buffer_vtbl
;
object
->
IMFDXGIBuffer_iface
.
lpVtbl
=
&
dxgi_buffer_vtbl
;
object
->
refcount
=
1
;
InitializeCriticalSection
(
&
object
->
cs
);
object
->
dxgi_surface
.
surface
=
surface
;
IUnknown_AddRef
(
surface
);
object
->
dxgi_surface
.
texture
=
texture
;
object
->
dxgi_surface
.
subresource
=
subresource
;
MFGetPlaneSize
(
format
,
desc
.
Width
,
desc
.
Height
,
&
object
->
_2d
.
plane_size
);
...
...
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