Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
4fa71c81
Commit
4fa71c81
authored
Mar 24, 2015
by
Steve Lhomme
Committed by
Jean-Baptiste Kempf
Mar 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
direct3d11: catch texture mapping errors
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
1dcc337d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
modules/video_output/msw/direct3d11.c
modules/video_output/msw/direct3d11.c
+12
-3
No files found.
modules/video_output/msw/direct3d11.c
View file @
4fa71c81
...
@@ -85,6 +85,7 @@ struct picture_sys_t
...
@@ -85,6 +85,7 @@ struct picture_sys_t
{
{
ID3D11Texture2D
*
texture
;
ID3D11Texture2D
*
texture
;
ID3D11DeviceContext
*
context
;
ID3D11DeviceContext
*
context
;
vout_display_t
*
vd
;
};
};
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
...
@@ -877,6 +878,7 @@ static int Direct3D11CreateResources(vout_display_t *vd, video_format_t *fmt)
...
@@ -877,6 +878,7 @@ static int Direct3D11CreateResources(vout_display_t *vd, video_format_t *fmt)
picsys
->
texture
=
sys
->
d3dtexture
;
picsys
->
texture
=
sys
->
d3dtexture
;
picsys
->
context
=
sys
->
d3dcontext
;
picsys
->
context
=
sys
->
d3dcontext
;
picsys
->
vd
=
vd
;
picture_resource_t
resource
=
{
.
p_sys
=
picsys
};
picture_resource_t
resource
=
{
.
p_sys
=
picsys
};
for
(
int
i
=
0
;
i
<
PICTURE_PLANE_MAX
;
i
++
)
for
(
int
i
=
0
;
i
<
PICTURE_PLANE_MAX
;
i
++
)
...
@@ -925,8 +927,15 @@ static void Direct3D11DestroyResources(vout_display_t *vd)
...
@@ -925,8 +927,15 @@ static void Direct3D11DestroyResources(vout_display_t *vd)
static
int
Direct3D11MapTexture
(
picture_t
*
picture
)
static
int
Direct3D11MapTexture
(
picture_t
*
picture
)
{
{
D3D11_MAPPED_SUBRESOURCE
mappedResource
;
D3D11_MAPPED_SUBRESOURCE
mappedResource
;
ID3D11DeviceContext_Map
(
picture
->
p_sys
->
context
,
(
ID3D11Resource
*
)
picture
->
p_sys
->
texture
,
0
,
D3D11_MAP_WRITE_DISCARD
,
0
,
&
mappedResource
);
HRESULT
hr
;
CommonUpdatePicture
(
picture
,
NULL
,
mappedResource
.
pData
,
mappedResource
.
RowPitch
);
int
res
;
hr
=
ID3D11DeviceContext_Map
(
picture
->
p_sys
->
context
,
(
ID3D11Resource
*
)
picture
->
p_sys
->
texture
,
0
,
D3D11_MAP_WRITE_DISCARD
,
0
,
&
mappedResource
);
if
(
FAILED
(
hr
)
)
{
msg_Dbg
(
picture
->
p_sys
->
vd
,
"failed to map the texture (hr=0x%lX)"
,
hr
);
return
VLC_EGENERIC
;
}
res
=
CommonUpdatePicture
(
picture
,
NULL
,
mappedResource
.
pData
,
mappedResource
.
RowPitch
);
ID3D11DeviceContext_Unmap
(
picture
->
p_sys
->
context
,(
ID3D11Resource
*
)
picture
->
p_sys
->
texture
,
0
);
ID3D11DeviceContext_Unmap
(
picture
->
p_sys
->
context
,(
ID3D11Resource
*
)
picture
->
p_sys
->
texture
,
0
);
return
VLC_SUCCESS
;
return
res
;
}
}
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