1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-07 03:56:28 +02:00

gl: rearrange includes

Mainly to remove libplacebo include dependencies from gl converters. For now,
only the generic converter need libplacebo. Future converters will still be
able to use if they add CFLAGS/LIBADD dependencies.

This fixes the build when libplacebo includes are not in common places
(contrib,/usr/include,/usr/local/include...).
This commit is contained in:
Thomas Guillem 2018-02-14 15:33:10 +01:00
parent 971b31d933
commit 1fe5c1e3b1
4 changed files with 48 additions and 50 deletions

View File

@ -21,12 +21,35 @@
#ifndef VLC_OPENGL_CONVERTER_H
#define VLC_OPENGL_CONVERTER_H
#ifdef HAVE_LIBPLACEBO
#include <libplacebo/shaders.h>
#endif
#include "vout_helper.h"
#include <vlc_plugin.h>
#include <vlc_common.h>
#include <vlc_picture_pool.h>
#include <vlc_opengl.h>
/* if USE_OPENGL_ES2 is defined, OpenGL ES version 2 will be used, otherwise
* normal OpenGL will be used */
#ifdef __APPLE__
# include <TargetConditionals.h>
# if !TARGET_OS_IPHONE
# undef USE_OPENGL_ES2
# define MACOS_OPENGL
# include <OpenGL/gl.h>
# else /* Force ESv2 on iOS */
# define USE_OPENGL_ES2
# include <OpenGLES/ES1/gl.h>
# include <OpenGLES/ES2/gl.h>
# include <OpenGLES/ES2/glext.h>
# endif
#else /* !defined (__APPLE__) */
# if defined (USE_OPENGL_ES2)
# include <GLES2/gl2.h>
# else
# ifdef _WIN32
# include <GL/glew.h>
# endif
# include <GL/gl.h>
# endif
#endif
#define VLCGL_PICTURE_MAX 128
@ -215,6 +238,23 @@ typedef struct {
PFNGLCLIENTWAITSYNCPROC ClientWaitSync; /* can be NULL */
} opengl_vtable_t;
static inline bool HasExtension(const char *apis, const char *api)
{
size_t apilen = strlen(api);
while (apis) {
while (*apis == ' ')
apis++;
if (!strncmp(apis, api, apilen) && memchr(" ", apis[apilen], 2))
return true;
apis = strchr(apis, ' ');
}
return false;
}
struct pl_context;
struct pl_shader;
struct pl_shader_res;
/*
* Structure that is filled by "glhw converter" module probe function
* The implementation should initialize every members of the struct that are
@ -230,10 +270,8 @@ struct opengl_tex_converter_t
/* Pointer to object gl, set by the caller */
vlc_gl_t *gl;
#ifdef HAVE_LIBPLACEBO
/* libplacebo context, created by the caller (optional) */
struct pl_context *pl_ctx;
#endif
/* Function pointers to OpenGL functions, set by the caller */
const opengl_vtable_t *vt;
@ -297,10 +335,8 @@ struct opengl_tex_converter_t
bool yuv_color;
GLfloat yuv_coefficients[16];
#ifdef HAVE_LIBPLACEBO
struct pl_shader *pl_sh;
const struct pl_shader_res *pl_sh_res;
#endif
/* Private context */
void *priv;

View File

@ -33,6 +33,7 @@
#include <vlc_common.h>
#include <vlc_memstream.h>
#include "internal.h"
#include "vout_helper.h"
#ifndef GL_RED
# define GL_RED 0x1903

View File

@ -40,6 +40,7 @@
#include <vlc_vout.h>
#include <vlc_viewpoint.h>
#include "vout_helper.h"
#include "internal.h"
#ifndef GL_CLAMP_TO_EDGE

View File

@ -29,34 +29,7 @@
#ifndef VLC_OPENGL_VOUT_HELPER_H
#define VLC_OPENGL_VOUT_HELPER_H
#include <vlc_common.h>
#include <vlc_picture_pool.h>
#include <vlc_opengl.h>
/* if USE_OPENGL_ES2 is defined, OpenGL ES version 2 will be used, otherwise
* normal OpenGL will be used */
#ifdef __APPLE__
# include <TargetConditionals.h>
# if !TARGET_OS_IPHONE
# undef USE_OPENGL_ES2
# define MACOS_OPENGL
# include <OpenGL/gl.h>
# else /* Force ESv2 on iOS */
# define USE_OPENGL_ES2
# include <OpenGLES/ES1/gl.h>
# include <OpenGLES/ES2/gl.h>
# include <OpenGLES/ES2/glext.h>
# endif
#else /* !defined (__APPLE__) */
# if defined (USE_OPENGL_ES2)
# include <GLES2/gl2.h>
# else
# ifdef _WIN32
# include <GL/glew.h>
# endif
# include <GL/gl.h>
# endif
#endif
#include "converter.h"
#ifdef HAVE_LIBPLACEBO
#include <libplacebo/shaders/colorspace.h>
@ -237,19 +210,6 @@ static const vlc_fourcc_t gl_subpicture_chromas[] = {
0
};
static inline bool HasExtension(const char *apis, const char *api)
{
size_t apilen = strlen(api);
while (apis) {
while (*apis == ' ')
apis++;
if (!strncmp(apis, api, apilen) && memchr(" ", apis[apilen], 2))
return true;
apis = strchr(apis, ' ');
}
return false;
}
typedef struct vout_display_opengl_t vout_display_opengl_t;
vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,