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
63be579e
Commit
63be579e
authored
Dec 24, 2014
by
Martell Malone
Committed by
Jean-Baptiste Kempf
Mar 09, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11 vout plugin
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
f309e643
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1039 additions
and
8 deletions
+1039
-8
NEWS
NEWS
+2
-0
configure.ac
configure.ac
+6
-1
modules/MODULES_LIST
modules/MODULES_LIST
+1
-0
modules/video_output/Makefile.am
modules/video_output/Makefile.am
+16
-0
modules/video_output/msw/common.c
modules/video_output/msw/common.c
+29
-2
modules/video_output/msw/common.h
modules/video_output/msw/common.h
+44
-0
modules/video_output/msw/direct3d11.c
modules/video_output/msw/direct3d11.c
+930
-0
modules/video_output/msw/events.c
modules/video_output/msw/events.c
+10
-5
po/POTFILES.in
po/POTFILES.in
+1
-0
No files found.
NEWS
View file @
63be579e
...
...
@@ -55,6 +55,8 @@ Video ouput:
* Large rework of the Android video outputs: there is now Surface (2.1, 2.2)
NativeWindow (2.3+, supports hw rotation, subpicture blending, opaque)
* Support rotation in Android NativeWindow output and hardware decoders
* Renamed the Direct3D output module to Direct3D9
* Added Direct3D11 video mode supporting both Windows desktop and WinRT modes.
Video filter:
* Hardware deinterlacing on the rPI, using MMAL
...
...
configure.ac
View file @
63be579e
...
...
@@ -3241,7 +3241,12 @@ AS_IF([test "${enable_directx}" != "no"], [
#include <GL/gl.h>
])
dnl Direct3D
dnl Direct3D11
AC_CHECK_HEADERS(d3d11.h, [
VLC_ADD_PLUGIN([direct3d11])
])
dnl Direct3D9
AC_CHECK_HEADERS(d3d9.h, [
VLC_ADD_PLUGIN([direct3d9])
])
...
...
modules/MODULES_LIST
View file @
63be579e
...
...
@@ -98,6 +98,7 @@ $Id$
* diracsys: BBC Dirac demuxer
* direct2d: video output module using the Direct2D API
* direct3d9: video output module using the Direct3D9 API
* direct3d11: video output module using the Direct3D11 API
* directdraw: video output module using the DirectDraw API
* directfb: Direct Framebuffer video output
* directsound: audio output module using the DirectSound API
...
...
modules/video_output/Makefile.am
View file @
63be579e
...
...
@@ -181,6 +181,22 @@ libdirect3d9_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
vout_LTLIBRARIES
+=
$(LTLIBdirect3d9)
EXTRA_LTLIBRARIES
+=
libdirect3d9_plugin.la
libdirect3d11_plugin_la_SOURCES
=
video_output/msw/direct3d11.c
\
video_output/msw/common.c video_output/msw/common.h
\
video_output/msw/events.c video_output/msw/events.h
\
video_output/msw/builtin_shaders.h
\
video_output/msw/win32touch.c video_output/msw/win32touch.h
libdirect3d11_plugin_la_CPPFLAGS
=
$(AM_CPPFLAGS)
\
-DMODULE_NAME_IS_direct3d11
if
!HAVE_WINSTORE
libdirect3d11_plugin_la_LIBADD
=
-lgdi32
-lole32
-luuid
else
libdirect3d11_plugin_la_LIBADD
=
-ld3dcompiler
-lole32
-luuid
endif
libdirect3d11_plugin_la_LDFLAGS
=
$(AM_LDFLAGS)
-rpath
'
$(voutdir)
'
vout_LTLIBRARIES
+=
$(LTLIBdirect3d11)
EXTRA_LTLIBRARIES
+=
libdirect3d11_plugin.la
libdirectdraw_plugin_la_SOURCES
=
video_output/msw/directdraw.c
\
video_output/msw/common.c video_output/msw/common.h
\
video_output/msw/events.c video_output/msw/events.h
\
...
...
modules/video_output/msw/common.c
View file @
63be579e
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
* Martell Malone <martellmalone@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -117,6 +118,13 @@ void CommonClean(vout_display_t *vd)
RestoreScreensaver
(
vd
);
}
/* */
picture_pool_t
*
CommonPool
(
vout_display_t
*
vd
,
unsigned
count
)
{
VLC_UNUSED
(
count
);
return
vd
->
sys
->
pool
;
}
void
CommonManage
(
vout_display_t
*
vd
)
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
...
...
@@ -214,6 +222,25 @@ int CommonUpdatePicture(picture_t *picture, picture_t **fallback,
picture
->
p
->
i_pitch
=
pitch
;
picture
->
p
->
i_lines
=
picture
->
format
.
i_visible_height
;
/* Fill chroma planes for biplanar YUV */
if
(
picture
->
format
.
i_chroma
==
VLC_CODEC_NV12
||
picture
->
format
.
i_chroma
==
VLC_CODEC_NV21
)
{
for
(
int
n
=
1
;
n
<
picture
->
i_planes
;
n
++
)
{
const
plane_t
*
o
=
&
picture
->
p
[
n
-
1
];
plane_t
*
p
=
&
picture
->
p
[
n
];
p
->
p_pixels
=
o
->
p_pixels
+
o
->
i_lines
*
o
->
i_pitch
;
p
->
i_pitch
=
pitch
;
p
->
i_lines
=
picture
->
format
.
i_visible_height
;
}
/* The dx/d3d buffer is always allocated as NV12 */
if
(
vlc_fourcc_AreUVPlanesSwapped
(
picture
->
format
.
i_chroma
,
VLC_CODEC_NV12
))
{
/* TODO : Swap NV21 UV planes to match NV12 */
return
VLC_EGENERIC
;
}
}
/* Fill chroma planes for planar YUV */
if
(
picture
->
format
.
i_chroma
==
VLC_CODEC_I420
||
picture
->
format
.
i_chroma
==
VLC_CODEC_J420
||
...
...
@@ -348,7 +375,7 @@ void UpdateRects(vout_display_t *vd,
SWP_NOCOPYBITS
|
SWP_NOZORDER
|
SWP_ASYNCWINDOWPOS
);
/* Destination image position and dimensions */
#if defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct2d)
#if defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct
3d11) || defined(MODULE_NAME_IS_direct
2d)
rect_dest
.
left
=
0
;
rect_dest
.
right
=
place
.
width
;
rect_dest
.
top
=
0
;
...
...
@@ -425,7 +452,7 @@ void UpdateRects(vout_display_t *vd,
/* Apply overlay hardware constraints */
if
(
sys
->
use_overlay
)
AlignRect
(
&
rect_src_clipped
,
sys
->
i_align_src_boundary
,
sys
->
i_align_src_size
);
#elif defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct2d)
#elif defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct
3d11) || defined(MODULE_NAME_IS_direct
2d)
/* Needed at least with YUV content */
rect_src_clipped
.
left
&=
~
1
;
rect_src_clipped
.
right
&=
~
1
;
...
...
modules/video_output/msw/common.h
View file @
63be579e
...
...
@@ -6,6 +6,7 @@
*
* Authors: Gildas Bazin <gbazin@videolan.org>
* Damien Fouilleul <damienf@videolan.org>
* Martell Malone <martellmalone@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -25,6 +26,15 @@
#ifdef MODULE_NAME_IS_directdraw
# include <ddraw.h>
#endif
#ifdef MODULE_NAME_IS_direct3d11
# include <d3d11.h>
# if VLC_WINSTORE_APP
# include <dxgi1_2.h>
# else
# include <dxgi.h>
#endif
# include <d3dcompiler.h>
#endif
#ifdef MODULE_NAME_IS_direct3d9
# include <d3d9.h>
# include <d3dx9effect.h>
...
...
@@ -135,6 +145,38 @@ struct vout_display_sys_t
ID2D1Bitmap
*
d2_bitmap
;
/* D2 bitmap */
#endif
#ifdef MODULE_NAME_IS_direct3d11
#if !VLC_WINSTORE_APP
HINSTANCE
hdxgi_dll
;
/* handle of the opened dxgi dll */
HINSTANCE
hd3d11_dll
;
/* handle of the opened d3d11 dll */
HINSTANCE
hd3dcompiler_dll
;
/* handle of the opened d3dcompiler dll */
IDXGIAdapter
*
dxgiadapter
;
/* DXGI adapter */
IDXGIFactory
*
dxgifactory
;
/* DXGI factory */
IDXGISwapChain
*
dxgiswapChain
;
/* DXGI 1.0 swap chain */
/* We should find a better way to store this or atleast a shorter name */
PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN
OurD3D11CreateDeviceAndSwapChain
;
PFN_D3D11_CREATE_DEVICE
OurD3D11CreateDevice
;
pD3DCompile
OurD3DCompile
;
#else
IDXGISwapChain1
*
dxgiswapChain
;
/* DXGI 1.1 swap chain */
#endif
ID3D11Device
*
d3ddevice
;
/* D3D device */
ID3D11DeviceContext
*
d3dcontext
;
/* D3D context */
ID3D11Texture2D
*
d3dtexture
;
ID3D11ShaderResourceView
*
d3dresViewY
;
ID3D11ShaderResourceView
*
d3dresViewUV
;
ID3D11RenderTargetView
*
d3drenderTargetView
;
ID3D11DepthStencilView
*
d3ddepthStencilView
;
ID3D11VertexShader
*
d3dvertexShader
;
ID3D11PixelShader
*
d3dpixelShader
;
ID3D11InputLayout
*
d3dvertexLayout
;
ID3D11SamplerState
*
d3dsampState
;
picture_sys_t
*
picsys
;
D3D_FEATURE_LEVEL
d3dfeaturelevel
;
DXGI_FORMAT
d3dFormat
;
vlc_fourcc_t
vlcFormat
;
#endif
#ifdef MODULE_NAME_IS_direct3d9
bool
allow_hw_yuv
;
/* Should we use hardware YUV->RGB conversions */
/* show video on desktop window ? */
...
...
@@ -209,6 +251,8 @@ void UpdateRects (vout_display_t *,
bool
is_forced
);
void
AlignRect
(
RECT
*
,
int
align_boundary
,
int
align_size
);
picture_pool_t
*
CommonPool
(
vout_display_t
*
,
unsigned
);
/*****************************************************************************
* Constants
*****************************************************************************/
...
...
modules/video_output/msw/direct3d11.c
0 → 100644
View file @
63be579e
This diff is collapsed.
Click to expand it.
modules/video_output/msw/events.c
View file @
63be579e
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
* Martell Malone <martellmalone@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -620,7 +621,7 @@ static void MouseReleased( event_thread_t *p_event, unsigned button )
vout_display_SendEventMouseReleased
(
p_event
->
vd
,
button
);
}
#if
def MODULE_NAME_IS_direct3d9
#if
defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct3d11)
static
int
CALLBACK
enumWindowsProc
(
HWND
hwnd
,
LPARAM
lParam
)
{
...
...
@@ -681,7 +682,7 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
/* Get this module's instance */
hInstance
=
GetModuleHandle
(
NULL
);
#if
def MODULE_NAME_IS_direct3d9
#if
defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct3d11)
if
(
!
p_event
->
use_desktop
)
#endif
{
...
...
@@ -692,7 +693,7 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
else
p_event
->
hparent
=
NULL
;
}
#if
def MODULE_NAME_IS_direct3d9
#if
defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct3d11)
else
{
vout_display_DeleteWindow
(
vd
,
NULL
);
...
...
@@ -719,7 +720,11 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
wc
.
hIcon
=
p_event
->
vlc_icon
;
/* load the vlc big icon */
wc
.
hCursor
=
p_event
->
is_cursor_hidden
?
p_event
->
cursor_empty
:
p_event
->
cursor_arrow
;
#if !VLC_WINSTORE_APP
wc
.
hbrBackground
=
GetStockObject
(
BLACK_BRUSH
);
/* background color */
#else
wc
.
hbrBackground
=
NULL
;
#endif
wc
.
lpszMenuName
=
NULL
;
/* no menu */
wc
.
lpszClassName
=
p_event
->
class_main
;
/* use a special class */
...
...
@@ -865,14 +870,14 @@ static void Win32VoutCloseWindow( event_thread_t *p_event )
vout_display_t
*
vd
=
p_event
->
vd
;
msg_Dbg
(
vd
,
"Win32VoutCloseWindow"
);
#if
def MODULE_NAME_IS_direct3d9
#if
defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct3d11)
DestroyWindow
(
p_event
->
hvideownd
);
#endif
DestroyWindow
(
p_event
->
hwnd
);
if
(
p_event
->
hfswnd
)
DestroyWindow
(
p_event
->
hfswnd
);
#if
def MODULE_NAME_IS_direct3d9
#if
defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct3d11)
if
(
!
p_event
->
use_desktop
)
#endif
vout_display_DeleteWindow
(
vd
,
p_event
->
parent_window
);
...
...
po/POTFILES.in
View file @
63be579e
...
...
@@ -1175,6 +1175,7 @@ modules/video_output/kva.c
modules/video_output/macosx.m
modules/video_output/msw/direct2d.c
modules/video_output/msw/direct3d9.c
modules/video_output/msw/direct3d11.c
modules/video_output/msw/directdraw.c
modules/video_output/msw/events.c
modules/video_output/msw/glwin32.c
...
...
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