gl: don't export symbols that are not supposed to be public

Make a bunch of symbols private that are currently leaked
accidentally because they have a gst_* prefix and are used
internally. We mark those we can't make static with
G_GNUC_INTERNAL so that they get hidden with the autotools
build as well (although we could just pass -fvisibility=hidden
there too).
This commit is contained in:
Tim-Philipp Müller 2017-08-11 18:38:41 +01:00
parent 957cc0e51a
commit 0b8f1f9e54
10 changed files with 52 additions and 28 deletions

View file

@ -32,7 +32,7 @@ G_BEGIN_DECLS
typedef struct _GstGLContextEGL GstGLContextEGL;
typedef struct _GstGLContextEGLClass GstGLContextEGLClass;
GType gst_gl_context_egl_get_type (void);
G_GNUC_INTERNAL GType gst_gl_context_egl_get_type (void);
#define GST_TYPE_GL_CONTEXT_EGL (gst_gl_context_egl_get_type())
/* FIXME: remove this when moving to -base */
@ -84,8 +84,13 @@ struct _GstGLContextEGLClass
GstGLContextClass parent;
};
G_GNUC_INTERNAL
GstGLContextEGL * gst_gl_context_egl_new (GstGLDisplay * display);
G_GNUC_INTERNAL
guintptr gst_gl_context_egl_get_current_context (void);
G_GNUC_INTERNAL
gpointer gst_gl_context_egl_get_proc_address (GstGLAPI gl_api, const gchar * name);
G_END_DECLS

View file

@ -234,7 +234,7 @@ typedef struct
} GstGLWrappedContextClass;
#define GST_TYPE_GL_WRAPPED_CONTEXT (gst_gl_wrapped_context_get_type())
GType gst_gl_wrapped_context_get_type (void);
static GType gst_gl_wrapped_context_get_type (void);
G_DEFINE_TYPE (GstGLWrappedContext, gst_gl_wrapped_context,
GST_TYPE_GL_CONTEXT);

View file

@ -115,7 +115,7 @@ typedef struct _GstGLDummyWindowCass
GstGLWindowClass parent;
} GstGLDummyWindowClass;
GstGLDummyWindow *gst_gl_dummy_window_new (void);
static GstGLDummyWindow *gst_gl_dummy_window_new (void);
enum
{
@ -964,7 +964,7 @@ gst_gl_window_resize (GstGLWindow * window, guint width, guint height)
window->queue_resize = FALSE;
}
GType gst_gl_dummy_window_get_type (void);
static GType gst_gl_dummy_window_get_type (void);
G_DEFINE_TYPE (GstGLDummyWindow, gst_gl_dummy_window, GST_TYPE_GL_WINDOW);
@ -1009,7 +1009,7 @@ gst_gl_dummy_window_init (GstGLDummyWindow * dummy)
dummy->handle = 0;
}
GstGLDummyWindow *
static GstGLDummyWindow *
gst_gl_dummy_window_new (void)
{
GstGLDummyWindow *window;

View file

@ -95,10 +95,13 @@ struct _GstGLWindowWaylandEGLClass {
gpointer _reserved[GST_PADDING];
};
GType gst_gl_window_wayland_egl_get_type (void);
G_GNUC_INTERNAL
GType gst_gl_window_wayland_egl_get_type (void);
G_GNUC_INTERNAL
GstGLWindowWaylandEGL * gst_gl_window_wayland_egl_new (GstGLDisplay * display);
G_GNUC_INTERNAL
void gst_gl_window_wayland_egl_create_window (GstGLWindowWaylandEGL * window_egl);
G_END_DECLS

View file

@ -55,7 +55,7 @@ static gboolean gst_gl_context_glx_create_context (GstGLContext *
static void gst_gl_context_glx_destroy_context (GstGLContext * context);
static gboolean gst_gl_context_glx_choose_format (GstGLContext *
context, GError ** error);
GstGLAPI gst_gl_context_glx_get_gl_api (GstGLContext * context);
static GstGLAPI gst_gl_context_glx_get_gl_api (GstGLContext * context);
static GstGLPlatform gst_gl_context_glx_get_gl_platform (GstGLContext *
context);
static void gst_gl_context_glx_get_gl_platform_version (GstGLContext * context,

View file

@ -28,7 +28,7 @@
G_BEGIN_DECLS
#define GST_TYPE_GL_CONTEXT_GLX (gst_gl_context_glx_get_type())
GType gst_gl_context_glx_get_type (void);
G_GNUC_INTERNAL GType gst_gl_context_glx_get_type (void);
/* FIXME: remove this when moving to -base */
#ifndef GST_DISABLE_DEPRECATED
@ -63,8 +63,13 @@ struct _GstGLContextGLXClass {
gpointer _reserved[GST_PADDING];
};
G_GNUC_INTERNAL
GstGLContextGLX * gst_gl_context_glx_new (GstGLDisplay * display);
G_GNUC_INTERNAL
guintptr gst_gl_context_glx_get_current_context (void);
G_GNUC_INTERNAL
gpointer gst_gl_context_glx_get_proc_address (GstGLAPI gl_api, const gchar * name);
G_END_DECLS

View file

@ -34,7 +34,9 @@ G_DEFINE_TYPE (GstGLDisplayX11, gst_gl_display_x11, GST_TYPE_GL_DISPLAY);
static void gst_gl_display_x11_finalize (GObject * object);
static guintptr gst_gl_display_x11_get_handle (GstGLDisplay * display);
gboolean gst_gl_display_x11_handle_event (GstGLDisplayX11 * display_x11);
G_GNUC_INTERNAL
gboolean gst_gl_display_x11_handle_event (GstGLDisplayX11 * display_x11);
extern gboolean gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11,
xcb_generic_event_t * event);

View file

@ -41,7 +41,8 @@
#define gst_gl_window_x11_parent_class parent_class
G_DEFINE_TYPE (GstGLWindowX11, gst_gl_window_x11, GST_TYPE_GL_WINDOW);
gboolean gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11,
G_GNUC_INTERNAL
gboolean gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11,
xcb_generic_event_t * event);
/* X error trap */
@ -67,23 +68,23 @@ struct _GstGLWindowX11Private
GstVideoRectangle render_rect;
};
guintptr gst_gl_window_x11_get_display (GstGLWindow * window);
static guintptr gst_gl_window_x11_get_display (GstGLWindow * window);
guintptr gst_gl_window_x11_get_gl_context (GstGLWindow * window);
gboolean gst_gl_window_x11_activate (GstGLWindow * window, gboolean activate);
void gst_gl_window_x11_set_window_handle (GstGLWindow * window,
static void gst_gl_window_x11_set_window_handle (GstGLWindow * window,
guintptr handle);
static gboolean gst_gl_window_x11_set_render_rectangle (GstGLWindow * window,
int x, int y, int width, int height);
guintptr gst_gl_window_x11_get_window_handle (GstGLWindow * window);
static guintptr gst_gl_window_x11_get_window_handle (GstGLWindow * window);
static void gst_gl_window_x11_set_preferred_size (GstGLWindow * window,
gint width, gint height);
void gst_gl_window_x11_show (GstGLWindow * window);
void gst_gl_window_x11_draw (GstGLWindow * window);
static void gst_gl_window_x11_show (GstGLWindow * window);
static void gst_gl_window_x11_draw (GstGLWindow * window);
gboolean gst_gl_window_x11_create_context (GstGLWindow * window,
GstGLAPI gl_api, guintptr external_gl_context, GError ** error);
gboolean gst_gl_window_x11_open (GstGLWindow * window, GError ** error);
void gst_gl_window_x11_close (GstGLWindow * window);
void gst_gl_window_x11_handle_events (GstGLWindow * window,
static gboolean gst_gl_window_x11_open (GstGLWindow * window, GError ** error);
static void gst_gl_window_x11_close (GstGLWindow * window);
static void gst_gl_window_x11_handle_events (GstGLWindow * window,
gboolean handle_events);
static void
@ -144,7 +145,7 @@ gst_gl_window_x11_new (GstGLDisplay * display)
return window;
}
gboolean
static gboolean
gst_gl_window_x11_open (GstGLWindow * window, GError ** error)
{
GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);
@ -261,7 +262,7 @@ gst_gl_window_x11_create_window (GstGLWindowX11 * window_x11)
return TRUE;
}
void
static void
gst_gl_window_x11_close (GstGLWindow * window)
{
GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);
@ -283,7 +284,7 @@ gst_gl_window_x11_close (GstGLWindow * window)
}
/* called by the gl thread */
void
static void
gst_gl_window_x11_set_window_handle (GstGLWindow * window, guintptr id)
{
GstGLWindowX11 *window_x11;
@ -378,7 +379,7 @@ gst_gl_window_x11_set_render_rectangle (GstGLWindow * window,
return TRUE;
}
guintptr
static guintptr
gst_gl_window_x11_get_window_handle (GstGLWindow * window)
{
GstGLWindowX11 *window_x11;
@ -417,7 +418,7 @@ _show_window (GstGLWindow * window)
}
}
void
static void
gst_gl_window_x11_show (GstGLWindow * window)
{
gst_gl_window_send_message (window, (GstGLWindowCB) _show_window, window);
@ -491,13 +492,13 @@ draw_cb (gpointer data)
}
/* Not called by the gl thread */
void
static void
gst_gl_window_x11_draw (GstGLWindow * window)
{
gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, window);
}
void
static void
gst_gl_window_x11_handle_events (GstGLWindow * window, gboolean handle_events)
{
GstGLWindowX11 *window_x11;
@ -657,7 +658,7 @@ gst_gl_window_x11_untrap_x_errors (void)
return TrappedErrorCode;
}
guintptr
static guintptr
gst_gl_window_x11_get_display (GstGLWindow * window)
{
GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);

View file

@ -29,7 +29,8 @@
G_BEGIN_DECLS
#define GST_TYPE_GL_WINDOW_X11 (gst_gl_window_x11_get_type())
GType gst_gl_window_x11_get_type (void);
G_GNUC_INTERNAL GType gst_gl_window_x11_get_type (void);
#define GST_GL_WINDOW_X11(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_WINDOW_X11, GstGLWindowX11))
#define GST_GL_WINDOW_X11_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_GL_WINDOW_X11, GstGLWindowX11Class))
#define GST_IS_GL_WINDOW_X11(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_WINDOW_X11))
@ -93,11 +94,16 @@ struct _GstGLWindowX11Class {
gpointer _reserved[GST_PADDING_LARGE];
};
G_GNUC_INTERNAL
GstGLWindowX11 * gst_gl_window_x11_new (GstGLDisplay * display);
G_GNUC_INTERNAL
void gst_gl_window_x11_trap_x_errors (void);
G_GNUC_INTERNAL
gint gst_gl_window_x11_untrap_x_errors (void);
G_GNUC_INTERNAL
gboolean gst_gl_window_x11_create_window (GstGLWindowX11 * window_x11);
G_END_DECLS

View file

@ -29,7 +29,9 @@
#include "gstgldisplay_x11.h"
#include "gstglwindow_x11.h"
extern gboolean gst_gl_display_x11_handle_event (GstGLDisplayX11 * display_x11);
G_GNUC_INTERNAL
extern gboolean gst_gl_display_x11_handle_event (GstGLDisplayX11 *
display_x11);
typedef struct _XCBEventSource
{