mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:06:17 +00:00
meson: gl: add support for building with dispmanx on the rpi
This commit is contained in:
parent
0abeebc4e8
commit
c36ea6f56f
6 changed files with 57 additions and 16 deletions
|
@ -90,7 +90,7 @@
|
||||||
extern GType gst_ca_opengl_layer_sink_bin_get_type (void);
|
extern GType gst_ca_opengl_layer_sink_bin_get_type (void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_EGL_RPI
|
#if GST_GL_HAVE_WINDOW_DISPMANX
|
||||||
extern void bcm_host_init (void);
|
extern void bcm_host_init (void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_gl_gstgl_debug, "gstopengl", 0, "gstopengl");
|
GST_DEBUG_CATEGORY_INIT (gst_gl_gstgl_debug, "gstopengl", 0, "gstopengl");
|
||||||
|
|
||||||
#ifdef USE_EGL_RPI
|
#if GST_GL_HAVE_WINDOW_DISPMANX
|
||||||
GST_DEBUG ("Initialize BCM host");
|
GST_DEBUG ("Initialize BCM host");
|
||||||
bcm_host_init ();
|
bcm_host_init ();
|
||||||
#endif
|
#endif
|
||||||
|
@ -236,7 +236,6 @@ plugin_init (GstPlugin * plugin)
|
||||||
GST_RANK_NONE, GST_TYPE_GL_DEINTERLACE)) {
|
GST_RANK_NONE, GST_TYPE_GL_DEINTERLACE)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_JPEG
|
#if HAVE_JPEG
|
||||||
#if HAVE_PNG
|
#if HAVE_PNG
|
||||||
if (!gst_element_register (plugin, "gloverlay",
|
if (!gst_element_register (plugin, "gloverlay",
|
||||||
|
|
|
@ -97,6 +97,10 @@ if build_gstgl and gstgl_dep.found()
|
||||||
optional_deps += x11_dep
|
optional_deps += x11_dep
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if bcm_host_dep.found()
|
||||||
|
optional_deps += bcm_host_dep
|
||||||
|
endif
|
||||||
|
|
||||||
gstopengl = library('gstopengl',
|
gstopengl = library('gstopengl',
|
||||||
opengl_sources,
|
opengl_sources,
|
||||||
c_args : gst_plugins_bad_args + opengl_defines,
|
c_args : gst_plugins_bad_args + opengl_defines,
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <gst/gl/gl.h>
|
#include <gst/gl/gl.h>
|
||||||
#include <gst/gl/egl/gstegl.h>
|
#include <gst/gl/egl/gstegl.h>
|
||||||
|
|
||||||
#if defined (USE_EGL_RPI) && defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#ifndef __VCCOREVER__
|
#ifndef __VCCOREVER__
|
||||||
#define __VCCOREVER__ 0x04000000
|
#define __VCCOREVER__ 0x04000000
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
#include <bcm_host.h>
|
#include <bcm_host.h>
|
||||||
|
|
||||||
#if defined (USE_EGL_RPI) && defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#pragma GCC reset_options
|
#pragma GCC reset_options
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include <gst/gl/gstglconfig.h>
|
#include <gst/gl/gstglconfig.h>
|
||||||
|
|
||||||
#if defined (USE_EGL_RPI) && defined(__GNUC__)
|
#if GST_GL_HAVE_WINDOW_DISPMANX && defined(__GNUC__)
|
||||||
#ifndef __VCCOREVER__
|
#ifndef __VCCOREVER__
|
||||||
#define __VCCOREVER__ 0x04000000
|
#define __VCCOREVER__ 0x04000000
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
#include <EGL/eglext.h>
|
#include <EGL/eglext.h>
|
||||||
|
|
||||||
#if defined (USE_EGL_RPI) && defined(__GNUC__)
|
#if GST_GL_HAVE_WINDOW_DISPMANX && defined(__GNUC__)
|
||||||
#pragma GCC reset_options
|
#pragma GCC reset_options
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -105,12 +105,27 @@ gl_platform_deps = []
|
||||||
gl_winsys_deps = []
|
gl_winsys_deps = []
|
||||||
# other things we need.
|
# other things we need.
|
||||||
gl_misc_deps = []
|
gl_misc_deps = []
|
||||||
|
# Other preprocessor arguments
|
||||||
|
gl_cpp_args = ['-DGST_USE_UNSTABLE_API']
|
||||||
|
|
||||||
enabled_gl_apis = []
|
enabled_gl_apis = []
|
||||||
enabled_gl_platforms = []
|
enabled_gl_platforms = []
|
||||||
enabled_gl_winsys = []
|
enabled_gl_winsys = []
|
||||||
|
|
||||||
# parse provided options
|
# parse provided options
|
||||||
|
libegl_module_name = get_option('with_egl_module_name')
|
||||||
|
if libegl_module_name != ''
|
||||||
|
gl_cpp_args += ['-DGST_GL_LIBEGL_MODULE_NAME="@0@"'.format(libegl_module_name)]
|
||||||
|
endif
|
||||||
|
libgles2_module_name = get_option('with_gles2_module_name')
|
||||||
|
if libgles2_module_name != ''
|
||||||
|
gl_cpp_args += ['-DGST_GL_LIBGLESV2_MODULE_NAME="@0@"'.format(libgles2_module_name)]
|
||||||
|
endif
|
||||||
|
libgl_module_name = get_option('with_opengl_module_name')
|
||||||
|
if libgl_module_name != ''
|
||||||
|
gl_cpp_args += ['-DGST_GL_LIBGL_MODULE_NAME="@0@"'.format(libgl_module_name)]
|
||||||
|
endif
|
||||||
|
|
||||||
gl_apis_s = get_option ('with_gl_api')
|
gl_apis_s = get_option ('with_gl_api')
|
||||||
if gl_apis_s == 'auto'
|
if gl_apis_s == 'auto'
|
||||||
need_api_opengl = 'auto'
|
need_api_opengl = 'auto'
|
||||||
|
@ -188,8 +203,8 @@ else
|
||||||
# need_win_cocoa = 'yes'
|
# need_win_cocoa = 'yes'
|
||||||
# elif winsys == 'eagl'
|
# elif winsys == 'eagl'
|
||||||
# need_win_eagl = 'yes'
|
# need_win_eagl = 'yes'
|
||||||
# elif winsys == 'dispmanx'
|
elif winsys == 'dispmanx'
|
||||||
# need_win_dispmanx = 'yes'
|
need_win_dispmanx = 'yes'
|
||||||
else
|
else
|
||||||
error('Unsupported GL winsys provided ' + winsys)
|
error('Unsupported GL winsys provided ' + winsys)
|
||||||
endif
|
endif
|
||||||
|
@ -210,7 +225,7 @@ gl_include_header = '''
|
||||||
gl_dep = unneeded_dep
|
gl_dep = unneeded_dep
|
||||||
glx_dep = unneeded_dep
|
glx_dep = unneeded_dep
|
||||||
if need_api_opengl != 'no' or need_platform_glx != 'no'
|
if need_api_opengl != 'no' or need_platform_glx != 'no'
|
||||||
gl_dep = dependency('GL', required : false)
|
gl_dep = dependency('gl', required : false)
|
||||||
if not gl_dep.found()
|
if not gl_dep.found()
|
||||||
# if host_machine.system() == 'windows'
|
# if host_machine.system() == 'windows'
|
||||||
# gl_dep = cc.find_library('opengl32', required : false)
|
# gl_dep = cc.find_library('opengl32', required : false)
|
||||||
|
@ -253,7 +268,7 @@ endif
|
||||||
# GLES2 checks
|
# GLES2 checks
|
||||||
gles2_dep = unneeded_dep
|
gles2_dep = unneeded_dep
|
||||||
if need_api_gles2 != 'no'
|
if need_api_gles2 != 'no'
|
||||||
gles2_dep = dependency('GLESv2', required : false)
|
gles2_dep = dependency('glesv2', required : false)
|
||||||
if not gles2_dep.found()
|
if not gles2_dep.found()
|
||||||
# if host_machine.system() == 'windows'
|
# if host_machine.system() == 'windows'
|
||||||
# elif host_machine.system() == 'darwin'
|
# elif host_machine.system() == 'darwin'
|
||||||
|
@ -328,7 +343,7 @@ endif
|
||||||
# EGL checks
|
# EGL checks
|
||||||
egl_dep = unneeded_dep
|
egl_dep = unneeded_dep
|
||||||
if need_platform_egl != 'no'
|
if need_platform_egl != 'no'
|
||||||
egl_dep = dependency('EGL', required : false)
|
egl_dep = dependency('egl', required : false)
|
||||||
if not egl_dep.found()
|
if not egl_dep.found()
|
||||||
egl_dep = cc.find_library('EGL', required : false)
|
egl_dep = cc.find_library('EGL', required : false)
|
||||||
|
|
||||||
|
@ -446,6 +461,27 @@ if need_win_x11 != 'no'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
bcm_host_dep = unneeded_dep
|
||||||
|
if need_win_dispmanx != 'no'
|
||||||
|
bcm_host_dep = dependency('bcm_host', required : false)
|
||||||
|
if bcm_host_dep.found()
|
||||||
|
if not egl_dep.found()
|
||||||
|
error('dispmanx requires the use of egl')
|
||||||
|
endif
|
||||||
|
|
||||||
|
gl_sources += [
|
||||||
|
'dispmanx/gstglwindow_dispmanx_egl.c'
|
||||||
|
]
|
||||||
|
|
||||||
|
glconf.set('GST_GL_HAVE_WINDOW_DISPMANX', 1)
|
||||||
|
gl_winsys_deps += bcm_host_dep
|
||||||
|
enabled_gl_winsys += 'dispmanx'
|
||||||
|
gl_cpp_args += ['-DUSE_EGL_RPI']
|
||||||
|
elif need_win_dispmanx == 'yes'
|
||||||
|
error('Could not find dispmanx libraries')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# win32 checks
|
# win32 checks
|
||||||
if need_platform_wgl == 'yes'
|
if need_platform_wgl == 'yes'
|
||||||
if need_win_win32 == 'no'
|
if need_win_win32 == 'no'
|
||||||
|
@ -477,8 +513,7 @@ if host_machine.system() == 'darwin'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# TODO: Add rest of gl config here.
|
# TODO: Add rest of gl config here.
|
||||||
# --with-{egl,gles2,opengl}-module-name
|
# arm-mali, iOS, OS X, win32 specific support
|
||||||
# rpi, arm-mali, iOS, OS X, win32 specific support
|
|
||||||
|
|
||||||
build_gstgl = true
|
build_gstgl = true
|
||||||
if gl_lib_deps.length() == 0
|
if gl_lib_deps.length() == 0
|
||||||
|
@ -538,7 +573,7 @@ if build_gstgl
|
||||||
|
|
||||||
gstgl = library('gstgl-' + api_version,
|
gstgl = library('gstgl-' + api_version,
|
||||||
gl_sources,
|
gl_sources,
|
||||||
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
|
c_args : gst_plugins_bad_args + gl_cpp_args,
|
||||||
include_directories : [configinc, libsinc],
|
include_directories : [configinc, libsinc],
|
||||||
version : libversion,
|
version : libversion,
|
||||||
soversion : soversion,
|
soversion : soversion,
|
||||||
|
@ -552,5 +587,5 @@ if build_gstgl
|
||||||
|
|
||||||
gstgl_dep = declare_dependency(link_with : gstgl,
|
gstgl_dep = declare_dependency(link_with : gstgl,
|
||||||
include_directories : [libsinc],
|
include_directories : [libsinc],
|
||||||
dependencies : [gstbase_dep, gstvideo_dep])
|
dependencies : [gstbase_dep, gstvideo_dep] + gl_winsys_deps)
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -2,3 +2,6 @@ option('use_orc', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto
|
||||||
option('with_gl_api', type : 'string', value : 'auto', description : 'A comma separated list of opengl APIs to enable building against. Supported values are opengl and gles2.')
|
option('with_gl_api', type : 'string', value : 'auto', description : 'A comma separated list of opengl APIs to enable building against. Supported values are opengl and gles2.')
|
||||||
option('with_gl_platform', type : 'string', value : 'auto', description : 'A comma separated list of opengl platforms to enable building against. Supported values are glx, egl, cgl, wgl and eagl')
|
option('with_gl_platform', type : 'string', value : 'auto', description : 'A comma separated list of opengl platforms to enable building against. Supported values are glx, egl, cgl, wgl and eagl')
|
||||||
option('with_gl_winsys', type : 'string', value : 'auto', description : 'A comma separated list of opengl windows systems to enable building against. Supported values are x11, wayland, win32, cocoa, and dispmanx')
|
option('with_gl_winsys', type : 'string', value : 'auto', description : 'A comma separated list of opengl windows systems to enable building against. Supported values are x11, wayland, win32, cocoa, and dispmanx')
|
||||||
|
option('with_egl_module_name', type : 'string', value : '', description : 'The file to pass to g_module_open to open the libEGL.so library (default: libEGL.so)')
|
||||||
|
option('with_opengl_module_name', type : 'string', value : '', description : 'The file to pass to g_module_open to open the libGL.so library (default: libGL.so)')
|
||||||
|
option('with_gles2_module_name', type : 'string', value : '', description : 'The file to pass to g_module_open to open the libGLESv2.so library (default: libGLESv2.so)')
|
||||||
|
|
Loading…
Reference in a new issue