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
40b90380
Commit
40b90380
authored
Mar 30, 2015
by
Steve Lhomme
Committed by
Jean-Baptiste Kempf
Mar 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
direct3d11: favor the format requested by the decoder if possible
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
edea8117
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
29 deletions
+56
-29
modules/video_output/msw/direct3d11.c
modules/video_output/msw/direct3d11.c
+56
-29
No files found.
modules/video_output/msw/direct3d11.c
View file @
40b90380
...
...
@@ -694,48 +694,75 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
# endif
#endif
// look for the request pixel format first
for
(
unsigned
i
=
0
;
d3d_formats
[
i
].
name
!=
0
;
i
++
)
{
UINT
i_formatSupport
;
if
(
SUCCEEDED
(
ID3D11Device_CheckFormatSupport
(
sys
->
d3ddevice
,
d3d_formats
[
i
].
formatTexture
,
&
i_formatSupport
))
&&
(
i_formatSupport
&
D3D11_FORMAT_SUPPORT_TEXTURE2D
))
if
(
fmt
->
i_chroma
==
d3d_formats
[
i
].
fourcc
)
{
msg_Dbg
(
vd
,
"Using pixel format %s"
,
d3d_formats
[
i
].
name
);
sys
->
d3dFormatTex
=
d3d_formats
[
i
].
formatTexture
;
sys
->
vlcFormat
=
d3d_formats
[
i
].
fourcc
;
sys
->
d3dFormatY
=
d3d_formats
[
i
].
formatY
;
sys
->
d3dFormatUV
=
d3d_formats
[
i
].
formatUV
;
switch
(
sys
->
vlcFormat
)
UINT
i_formatSupport
;
if
(
SUCCEEDED
(
ID3D11Device_CheckFormatSupport
(
sys
->
d3ddevice
,
d3d_formats
[
i
].
formatTexture
,
&
i_formatSupport
))
&&
(
i_formatSupport
&
D3D11_FORMAT_SUPPORT_TEXTURE2D
))
{
case
VLC_CODEC_NV12
:
if
(
fmt
->
i_height
>
576
)
sys
->
d3dPxShader
=
globPixelShaderBiplanarYUV_BT709_2RGB
;
else
sys
->
d3dPxShader
=
globPixelShaderBiplanarYUV_BT601_2RGB
;
msg_Dbg
(
vd
,
"Using pixel format %s"
,
d3d_formats
[
i
].
name
);
sys
->
d3dFormatTex
=
d3d_formats
[
i
].
formatTexture
;
sys
->
vlcFormat
=
d3d_formats
[
i
].
fourcc
;
sys
->
d3dFormatY
=
d3d_formats
[
i
].
formatY
;
sys
->
d3dFormatUV
=
d3d_formats
[
i
].
formatUV
;
break
;
case
VLC_CODEC_I420
:
if
(
fmt
->
i_height
>
576
)
sys
->
d3dPxShader
=
globPixelShaderBiplanarI420_BT709_2RGB
;
else
sys
->
d3dPxShader
=
globPixelShaderBiplanarI420_BT601_2RGB
;
break
;
case
VLC_CODEC_RGB32
:
case
VLC_CODEC_BGRA
:
case
VLC_CODEC_RGB16
:
default:
sys
->
d3dPxShader
=
globPixelShaderDefault
;
}
}
}
// look for any pixel format that we can handle
if
(
!
sys
->
vlcFormat
)
{
for
(
unsigned
i
=
0
;
d3d_formats
[
i
].
name
!=
0
;
i
++
)
{
UINT
i_formatSupport
;
if
(
SUCCEEDED
(
ID3D11Device_CheckFormatSupport
(
sys
->
d3ddevice
,
d3d_formats
[
i
].
formatTexture
,
&
i_formatSupport
))
&&
(
i_formatSupport
&
D3D11_FORMAT_SUPPORT_TEXTURE2D
))
{
msg_Dbg
(
vd
,
"Using pixel format %s"
,
d3d_formats
[
i
].
name
);
sys
->
d3dFormatTex
=
d3d_formats
[
i
].
formatTexture
;
sys
->
vlcFormat
=
d3d_formats
[
i
].
fourcc
;
sys
->
d3dFormatY
=
d3d_formats
[
i
].
formatY
;
sys
->
d3dFormatUV
=
d3d_formats
[
i
].
formatUV
;
break
;
}
break
;
}
}
if
(
!
sys
->
vlcFormat
)
{
if
(
!
sys
->
vlcFormat
)
{
msg_Err
(
vd
,
"Could not get a suitable texture pixel format"
);
return
VLC_EGENERIC
;
}
switch
(
sys
->
vlcFormat
)
{
case
VLC_CODEC_NV12
:
if
(
fmt
->
i_height
>
576
)
sys
->
d3dPxShader
=
globPixelShaderBiplanarYUV_BT709_2RGB
;
else
sys
->
d3dPxShader
=
globPixelShaderBiplanarYUV_BT601_2RGB
;
break
;
case
VLC_CODEC_I420
:
if
(
fmt
->
i_height
>
576
)
sys
->
d3dPxShader
=
globPixelShaderBiplanarI420_BT709_2RGB
;
else
sys
->
d3dPxShader
=
globPixelShaderBiplanarI420_BT601_2RGB
;
break
;
case
VLC_CODEC_RGB32
:
case
VLC_CODEC_BGRA
:
case
VLC_CODEC_RGB16
:
default:
sys
->
d3dPxShader
=
globPixelShaderDefault
;
break
;
}
UpdateRects
(
vd
,
NULL
,
NULL
,
true
);
if
(
Direct3D11CreateResources
(
vd
,
fmt
))
{
...
...
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