mcst-linux-kernel/patches-2024.06.26/mplayer-1.3.0/0009-Enable-vo-gles.patch

128 lines
3.9 KiB
Diff

From 2350cd88b4a2064780503b40c7ea4e852260ee7f Mon Sep 17 00:00:00 2001
Date: Thu, 28 Dec 2017 12:01:09 +0300
Subject: [PATCH] Enable vo gles
---
DOCS/man/en/mplayer.1 | 4 ++++
Makefile | 1 +
configure | 18 ++++++++++++++++++
libvo/video_out.c | 4 ++++
4 files changed, 27 insertions(+)
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index e4b2962..5f95305 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -4489,6 +4489,10 @@ Apart from this the values have the same meaning as for \-vo gl.
.REss
.
.TP
+.B gles (X11 only)
+OpenGL ES output driver.
+.
+.TP
.B matrixview
OpenGL-based renderer creating a Matrix-like running-text effect.
.PD 0
diff --git a/Makefile b/Makefile
index f59f635..b261bf2 100644
--- a/Makefile
+++ b/Makefile
@@ -467,6 +467,7 @@ SRCS_MPLAYER-$(GGI) += libvo/vo_ggi.c
SRCS_MPLAYER-$(GIF) += libvo/vo_gif89a.c
SRCS_MPLAYER-$(GL) += libvo/gl_common.c libvo/vo_gl.c \
libvo/csputils.c
+SRCS_MPLAYER-$(GLES) += libvo/vo_gles.c
SRCS_MPLAYER-$(GL_OSX) += libvo/osx_common.c libvo/osx_objc_common.m libvo/vo_gl_tiled.c
SRCS_MPLAYER-$(GL_SDL) += libvo/sdl_common.c
SRCS_MPLAYER-$(GL_WIN32) += libvo/w32_common.c libvo/vo_gl_tiled.c
diff --git a/configure b/configure
index 9f7e5ce..c95f611 100755
--- a/configure
+++ b/configure
@@ -469,6 +469,7 @@ Video output:
--enable-dhahelper enable VIDIX dhahelper support
--enable-svgalib_helper enable VIDIX svgalib_helper support
--enable-gl enable OpenGL video output [autodetect]
+ --enable-gles enable OpenGL ES X11 video output [disable]
--disable-matrixview disable OpenGL MatrixView video output [autodetect]
--enable-dga2 enable DGA 2 support [autodetect]
--enable-dga1 enable DGA 1 support [autodetect]
@@ -724,6 +725,7 @@ _md5sum=yes
_yuv4mpeg=yes
_gif=auto
_gl=auto
+_gles=no
matrixview=auto
_ggi=auto
_ggiwmh=auto
@@ -1095,6 +1097,8 @@ for ac_option do
--disable-gif) _gif=no ;;
--enable-gl) _gl=yes ;;
--disable-gl) _gl=no ;;
+ --enable-gles) _gles=yes ;;
+ --disable-gles) _gles=no ;;
--enable-matrixview) matrixview=yes ;;
--disable-matrixview) matrixview=no ;;
--enable-ggi) _ggi=yes ;;
@@ -5512,6 +5516,18 @@ fi
echores "$sdl_image"
+echocheck "OpenGL ES"
+if test "$_gles" = yes ; then
+ vomodules="gles $vomodules"
+ libs_mplayer="$libs_mplayer -lEGL -lGLESv1_CM"
+ def_gles='#define CONFIG_GLES 1'
+else
+ novomodules="gles $novomodules"
+ def_gles='#undef CONFIG_GLES'
+fi
+echores "$_gles"
+
+
# make sure this stays below CoreVideo to avoid issues due to namespace
# conflicts between -lGL and -framework OpenGL
echocheck "OpenGL"
@@ -8498,6 +8514,7 @@ GL_WIN32 = $_gl_win32
GL_X11 = $_gl_x11
GL_EGL_X11 = $_gl_egl_x11
GL_SDL = $_gl_sdl
+GLES = $_gles
GL_OSX = $_gl_osx
MATRIXVIEW = $matrixview
GUI = $_gui
@@ -9122,6 +9139,7 @@ $def_gif_4
$def_gif_tvt_hack
$def_gl
$def_gl_win32
+$def_gles
$def_gl_x11
$def_gl_egl_android
$def_gl_egl_x11
diff --git a/libvo/video_out.c b/libvo/video_out.c
index bcf5174..1d98705 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -105,6 +105,7 @@ extern const vo_functions_t video_out_vdpau;
extern const vo_functions_t video_out_xv;
extern const vo_functions_t video_out_gl_nosw;
extern const vo_functions_t video_out_gl;
+extern const vo_functions_t video_out_gles;
extern const vo_functions_t video_out_gl_tiled;
extern const vo_functions_t video_out_matrixview;
extern const vo_functions_t video_out_dga;
@@ -217,6 +218,9 @@ const vo_functions_t* const video_out_drivers[] =
#if defined(CONFIG_GL_WIN32) || defined(CONFIG_GL_X11) || defined(CONFIG_GL_OSX)
&video_out_gl_tiled,
#endif
+#ifdef CONFIG_GLES
+ &video_out_gles,
+#endif
#ifdef CONFIG_DGA
&video_out_dga,
#endif
--
2.16.4