[vlc-devel] [PATCH] vout: allow creating a pool of D3D9 GPU surfaces picture_t
Steve Lhomme
robUx4 at videolabs.io
Tue Apr 28 16:44:43 CEST 2015
---
src/Makefile.am | 9 +++++++++
src/video_output/vout_wrapper.c | 15 +++++++++++----
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 1f02494..a5dba6a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -301,6 +301,15 @@ SOURCES_libvlc_win32 = \
win32/rand.c \
$(NULL)
+if HAVE_DIRECTX
+if !HAVE_WINSTORE
+SOURCES_libvlc_win32 += \
+ win32/direct3d9_pool.c \
+ win32/direct3d9_pool.h \
+ $(NULL)
+endif
+endif
+
SOURCES_libvlc_symbian = \
symbian/path.cpp \
symbian/dirs.c \
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index dbaae78..c6fbb87 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -35,6 +35,9 @@
#include <assert.h>
#include "vout_internal.h"
#include "display.h"
+#if defined(_WIN32) && defined(HAVE_D3D9_H)
+#include "../win32/direct3d9_pool.h"
+#endif
/*****************************************************************************
* Local prototypes
@@ -145,10 +148,14 @@ int vout_InitWrapper(vout_thread_t *vout)
sys->decoder_pool = display_pool;
sys->display_pool = display_pool;
} else if (!sys->decoder_pool) {
- sys->decoder_pool =
- picture_pool_NewFromFormat(&source,
- __MAX(VOUT_MAX_PICTURES,
- reserved_picture + decoder_picture - DISPLAY_PICTURE_COUNT));
+ const unsigned decoder_pool_size = __MAX(VOUT_MAX_PICTURES,
+ reserved_picture + decoder_picture - DISPLAY_PICTURE_COUNT);
+#if defined(_WIN32) && defined(HAVE_D3D9_H)
+ if (source.i_chroma == VLC_CODEC_D3D9_OPAQUE)
+ sys->decoder_pool = AllocPoolD3D9( VLC_OBJECT(vout), &source, decoder_pool_size );
+ else
+#endif
+ sys->decoder_pool = picture_pool_NewFromFormat( &source, decoder_pool_size );
if (!sys->decoder_pool)
return VLC_EGENERIC;
if (allow_dr) {
--
2.3.2
More information about the vlc-devel
mailing list