Commit c5b5ef16 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

gl: GST_EXPORT -> GST_GL_API

We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
parent 88215150
......@@ -67,6 +67,7 @@ libgstgl_@GST_API_VERSION@include_HEADERS = \
gstglquery.h \
gstgl_fwd.h \
gstgl_enums.h \
gl-prelude.h \
gl.h
noinst_HEADERS = \
......
......@@ -22,6 +22,7 @@
#define _GST_EGL_H_
#include <gst/gl/gstglconfig.h>
#include <gst/gl/gl-prelude.h>
#if GST_GL_HAVE_WINDOW_DISPMANX && defined(__GNUC__)
#ifndef __VCCOREVER__
......@@ -51,7 +52,7 @@
typedef gintptr EGLAttrib;
#endif
GST_EXPORT
GST_GL_API
const gchar * gst_egl_get_error_string (EGLint err);
#endif /* _GST_EGL_H_ */
......@@ -28,7 +28,7 @@
G_BEGIN_DECLS
GST_EXPORT GType gst_egl_image_get_type (void);
GST_GL_API GType gst_egl_image_get_type (void);
#define GST_TYPE_EGL_IMAGE (gst_egl_image_get_type())
#define GST_IS_EGL_IMAGE(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_EGL_IMAGE))
......@@ -68,27 +68,27 @@ struct _GstEGLImage
gpointer _padding[GST_PADDING];
};
GST_EXPORT
GST_GL_API
GstEGLImage * gst_egl_image_new_wrapped (GstGLContext * context,
gpointer image,
GstGLFormat format,
gpointer user_data,
GstEGLImageDestroyNotify user_data_destroy);
GST_EXPORT
GST_GL_API
gpointer gst_egl_image_get_image (GstEGLImage * image);
GST_EXPORT
GST_GL_API
GstEGLImage * gst_egl_image_from_texture (GstGLContext * context,
GstGLMemory * gl_mem,
guintptr * attribs);
#if GST_GL_HAVE_DMABUF
GST_EXPORT
GST_GL_API
GstEGLImage * gst_egl_image_from_dmabuf (GstGLContext * context,
gint dmabuf,
GstVideoInfo * in_info,
gint plane,
gsize offset);
GST_EXPORT
GST_GL_API
gboolean gst_egl_image_export_dmabuf (GstEGLImage *image, int *fd, gint *stride, gsize *offset);
#endif
......
......@@ -25,7 +25,7 @@
G_BEGIN_DECLS
GST_EXPORT
GST_GL_API
GType gst_gl_display_egl_get_type (void);
#define GST_TYPE_GL_DISPLAY_EGL (gst_gl_display_egl_get_type())
......@@ -63,16 +63,16 @@ struct _GstGLDisplayEGLClass
gpointer _padding[GST_PADDING];
};
GST_EXPORT
GST_GL_API
GstGLDisplayEGL *gst_gl_display_egl_new (void);
GST_EXPORT
GST_GL_API
GstGLDisplayEGL *gst_gl_display_egl_new_with_egl_display (gpointer display);
GST_EXPORT
GST_GL_API
GstGLDisplayEGL *gst_gl_display_egl_from_gl_display (GstGLDisplay * display);
GST_EXPORT
GST_GL_API
gpointer gst_gl_display_egl_get_from_native (GstGLDisplayType type, guintptr display);
#define GST_GL_DISPLAY_EGL_NAME "gst.gl.display.egl"
......
......@@ -30,7 +30,7 @@
G_BEGIN_DECLS
#define GST_TYPE_GL_MEMORY_EGL_ALLOCATOR (gst_gl_memory_egl_allocator_get_type())
GST_EXPORT GType gst_gl_memory_egl_allocator_get_type(void);
GST_GL_API GType gst_gl_memory_egl_allocator_get_type(void);
#define GST_IS_GL_MEMORY_EGL_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR))
#define GST_IS_GL_MEMORY_EGL_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR))
......@@ -61,16 +61,16 @@ struct _GstGLMemoryEGL
*/
#define GST_GL_MEMORY_EGL_ALLOCATOR_NAME "GLMemoryEGL"
GST_EXPORT
GST_GL_API
void gst_gl_memory_egl_init_once (void);
GST_EXPORT
GST_GL_API
gboolean gst_is_gl_memory_egl (GstMemory * mem);
GST_EXPORT
GST_GL_API
gpointer gst_gl_memory_egl_get_image (GstGLMemoryEGL * mem);
GST_EXPORT
GST_GL_API
gpointer gst_gl_memory_egl_get_display (GstGLMemoryEGL * mem);
/**
......
/* GStreamer GL Library
* Copyright (C) 2018 GStreamer developers
*
* gl-prelude.h: prelude include header for gst-gl library
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_GL_PRELUDE_H__
#define __GST_GL_PRELUDE_H__
#include <gst/gst.h>
#ifndef GST_GL_API
#define GST_GL_API GST_EXPORT
#endif
#endif /* __GST_GL_PRELUDE_H__ */
......@@ -22,6 +22,7 @@
#define __GST_GL_API_H__
#include <gst/gl/gstglconfig.h>
#include <gst/gl/gl-prelude.h>
#include <gst/gst.h>
......@@ -98,14 +99,14 @@ typedef enum
GST_GL_PLATFORM_ANY = G_MAXUINT32
} GstGLPlatform;
GST_EXPORT
GST_GL_API
gchar * gst_gl_api_to_string (GstGLAPI api);
GST_EXPORT
GST_GL_API
GstGLAPI gst_gl_api_from_string (const gchar * api_s);
GST_EXPORT
GST_GL_API
gchar * gst_gl_platform_to_string (GstGLPlatform platform);
GST_EXPORT
GST_GL_API
GstGLPlatform gst_gl_platform_from_string (const gchar * platform_s);
G_END_DECLS
......
......@@ -29,7 +29,7 @@
G_BEGIN_DECLS
GST_EXPORT
GST_GL_API
GType gst_gl_base_filter_get_type(void);
#define GST_TYPE_GL_BASE_FILTER (gst_gl_base_filter_get_type())
#define GST_GL_BASE_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_BASE_FILTER,GstGLBaseFilter))
......
......@@ -36,11 +36,11 @@ G_BEGIN_DECLS
* from the #GstGLBaseMemoryError enumeration
*/
#define GST_TYPE_GL_BASE_MEMORY (gst_gl_base_memory_get_type())
GST_EXPORT
GST_GL_API
GType gst_gl_base_memory_get_type(void);
#define GST_TYPE_GL_BASE_MEMORY_ALLOCATOR (gst_gl_base_memory_allocator_get_type())
GST_EXPORT
GST_GL_API
GType gst_gl_base_memory_allocator_get_type(void);
#define GST_IS_GL_BASE_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_BASE_MEMORY_ALLOCATOR))
......@@ -52,7 +52,7 @@ GType gst_gl_base_memory_allocator_get_type(void);
#define GST_GL_BASE_MEMORY_CAST(mem) ((GstGLBaseMemory *)mem)
GST_EXPORT
GST_GL_API
GQuark gst_gl_base_memory_error_quark (void);
#define GST_GL_BASE_MEMORY_ERROR (gst_gl_base_memory_error_quark ())
......@@ -148,7 +148,7 @@ typedef void (*GstGLAllocationParamsCopyFunc) (GstGLAllocationParams * src
typedef void (*GstGLAllocationParamsFreeFunc) (gpointer params);
#define GST_TYPE_GL_ALLOCATION_PARAMS (gst_gl_allocation_params_get_type())
GST_EXPORT
GST_GL_API
GType gst_gl_allocation_params_get_type (void);
/**
......@@ -219,7 +219,7 @@ struct _GstGLAllocationParams
gpointer _padding[GST_PADDING];
};
GST_EXPORT
GST_GL_API
gboolean gst_gl_allocation_params_init (GstGLAllocationParams * params,
gsize struct_size,
guint alloc_flags,
......@@ -234,18 +234,18 @@ gboolean gst_gl_allocation_params_init (GstGLAllocationPara
GDestroyNotify notify);
/* free with gst_gl_allocation_params_free */
GST_EXPORT
GST_GL_API
GstGLAllocationParams * gst_gl_allocation_params_copy (GstGLAllocationParams * src);
GST_EXPORT
GST_GL_API
void gst_gl_allocation_params_free (GstGLAllocationParams * params);
/* subclass usage */
GST_EXPORT
GST_GL_API
void gst_gl_allocation_params_free_data (GstGLAllocationParams * params);
/* subclass usage */
GST_EXPORT
GST_GL_API
void gst_gl_allocation_params_copy_data (GstGLAllocationParams * src,
GstGLAllocationParams * dest);
......@@ -387,13 +387,13 @@ struct _GstGLBaseMemoryAllocatorClass
*/
#define GST_GL_BASE_MEMORY_ALLOCATOR_NAME "GLBaseMemory"
GST_EXPORT
GST_GL_API
void gst_gl_base_memory_init_once (void);
GST_EXPORT
GST_GL_API
gboolean gst_is_gl_base_memory (GstMemory * mem);
GST_EXPORT
GST_GL_API
void gst_gl_base_memory_init (GstGLBaseMemory * mem,
GstAllocator * allocator,
GstMemory * parent,
......@@ -403,16 +403,16 @@ void gst_gl_base_memory_init (GstGLBaseMemory * mem,
gpointer user_data,
GDestroyNotify notify);
GST_EXPORT
GST_GL_API
gboolean gst_gl_base_memory_alloc_data (GstGLBaseMemory * gl_mem);
GST_EXPORT
GST_GL_API
gboolean gst_gl_base_memory_memcpy (GstGLBaseMemory * src,
GstGLBaseMemory * dest,
gssize offset,
gssize size);
GST_EXPORT
GST_GL_API
GstGLBaseMemory * gst_gl_base_memory_alloc (GstGLBaseMemoryAllocator * allocator,
GstGLAllocationParams * params);
......
......@@ -26,7 +26,7 @@
G_BEGIN_DECLS
#define GST_TYPE_GL_BUFFER_ALLOCATOR (gst_gl_buffer_allocator_get_type())
GST_EXPORT
GST_GL_API
GType gst_gl_buffer_allocator_get_type(void);
#define GST_IS_GL_BUFFER_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_ALLOCATOR))
......@@ -57,7 +57,7 @@ struct _GstGLBuffer
typedef struct _GstGLBufferAllocationParams GstGLBufferAllocationParams;
#define GST_TYPE_GL_BUFFER_ALLOCATION_PARAMS (gst_gl_buffer_allocation_params_get_type())
GST_EXPORT
GST_GL_API
GType gst_gl_buffer_allocation_params_get_type (void);
/**
......@@ -84,7 +84,7 @@ struct _GstGLBufferAllocationParams
gpointer _padding[GST_PADDING];
};
GST_EXPORT
GST_GL_API
GstGLBufferAllocationParams * gst_gl_buffer_allocation_params_new (GstGLContext * context,
gsize alloc_size,
GstAllocationParams * alloc_params,
......@@ -131,9 +131,9 @@ struct _GstGLBufferAllocatorClass
*/
#define GST_GL_BUFFER_ALLOCATOR_NAME "GLBuffer"
GST_EXPORT
GST_GL_API
void gst_gl_buffer_init_once (void);
GST_EXPORT
GST_GL_API
gboolean gst_is_gl_buffer (GstMemory * mem);
G_END_DECLS
......
......@@ -29,7 +29,7 @@
G_BEGIN_DECLS
/* buffer pool functions */
GST_EXPORT
GST_GL_API
GType gst_gl_buffer_pool_get_type (void);
#define GST_TYPE_GL_BUFFER_POOL (gst_gl_buffer_pool_get_type())
#define GST_IS_GL_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_BUFFER_POOL))
......@@ -66,12 +66,12 @@ struct _GstGLBufferPoolClass
gpointer _padding[GST_PADDING];
};
GST_EXPORT
GST_GL_API
GstBufferPool *gst_gl_buffer_pool_new (GstGLContext * context);
GST_EXPORT
GST_GL_API
GstGLAllocationParams * gst_buffer_pool_config_get_gl_allocation_params (GstStructure * config);
GST_EXPORT
GST_GL_API
void gst_buffer_pool_config_set_gl_allocation_params (GstStructure * config,
GstGLAllocationParams * params);
......
......@@ -28,7 +28,7 @@
G_BEGIN_DECLS
GST_EXPORT
GST_GL_API
GType gst_gl_color_convert_get_type (void);
#define GST_TYPE_GL_COLOR_CONVERT (gst_gl_color_convert_get_type())
#define GST_GL_COLOR_CONVERT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_COLOR_CONVERT,GstGLColorConvert))
......@@ -113,28 +113,28 @@ struct _GstGLColorConvertClass
"framerate = " GST_VIDEO_FPS_RANGE ", " \
"texture-target = (string) { 2D, rectangle, external-oes }"
GST_EXPORT
GST_GL_API
GstGLColorConvert * gst_gl_color_convert_new (GstGLContext * context);
GST_EXPORT
GST_GL_API
GstCaps * gst_gl_color_convert_transform_caps (GstGLContext * context,
GstPadDirection direction,
GstCaps * caps,
GstCaps * filter);
GST_EXPORT
GST_GL_API
GstCaps * gst_gl_color_convert_fixate_caps (GstGLContext * context,
GstPadDirection direction,
GstCaps * caps,
GstCaps * other);
GST_EXPORT
GST_GL_API
gboolean gst_gl_color_convert_set_caps (GstGLColorConvert * convert,
GstCaps * in_caps,
GstCaps * out_caps);
GST_EXPORT
GST_GL_API
gboolean gst_gl_color_convert_decide_allocation (GstGLColorConvert * convert,
GstQuery * query);
GST_EXPORT
GST_GL_API
GstBuffer * gst_gl_color_convert_perform (GstGLColorConvert * convert, GstBuffer * inbuf);
G_END_DECLS
......
......@@ -27,7 +27,7 @@
G_BEGIN_DECLS
GST_EXPORT
GST_GL_API
GType gst_gl_context_get_type (void);
#define GST_TYPE_GL_CONTEXT (gst_gl_context_get_type())
......@@ -37,7 +37,7 @@ GType gst_gl_context_get_type (void);
#define GST_IS_GL_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_GL_CONTEXT))
#define GST_GL_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_GL_CONTEXT, GstGLContextClass))
GST_EXPORT
GST_GL_API
GQuark gst_gl_context_error_quark (void);
/**
......@@ -140,75 +140,75 @@ struct _GstGLContextClass {
/* methods */
GST_EXPORT
GST_GL_API
GstGLContext * gst_gl_context_new (GstGLDisplay *display);
GST_EXPORT
GST_GL_API
GstGLContext * gst_gl_context_new_wrapped (GstGLDisplay *display,
guintptr handle,
GstGLPlatform context_type,
GstGLAPI available_apis);
GST_EXPORT
GST_GL_API
gboolean gst_gl_context_activate (GstGLContext *context, gboolean activate);
GST_EXPORT
GST_GL_API
GThread * gst_gl_context_get_thread (GstGLContext *context);
GST_EXPORT
GST_GL_API
GstGLContext * gst_gl_context_get_current (void);
GST_EXPORT
GST_GL_API
GstGLDisplay * gst_gl_context_get_display (GstGLContext *context);
GST_EXPORT
GST_GL_API
gpointer gst_gl_context_get_proc_address (GstGLContext *context, const gchar *name);
GST_EXPORT
GST_GL_API
GstGLPlatform gst_gl_context_get_gl_platform (GstGLContext *context);
GST_EXPORT
GST_GL_API
GstGLAPI gst_gl_context_get_gl_api (GstGLContext *context);
GST_EXPORT
GST_GL_API
guintptr gst_gl_context_get_gl_context (GstGLContext *context);
GST_EXPORT
GST_GL_API
gboolean gst_gl_context_can_share (GstGLContext * context, GstGLContext *other_context);
GST_EXPORT
GST_GL_API
void gst_gl_context_swap_buffers (GstGLContext * context);
GST_EXPORT
GST_GL_API
gboolean gst_gl_context_create (GstGLContext *context, GstGLContext *other_context, GError ** error);
GST_EXPORT
GST_GL_API
void gst_gl_context_destroy (GstGLContext *context);
GST_EXPORT
GST_GL_API
gpointer gst_gl_context_default_get_proc_address (GstGLAPI gl_api, const gchar *name);
GST_EXPORT
GST_GL_API
gpointer gst_gl_context_get_proc_address_with_platform (GstGLPlatform context_type, GstGLAPI gl_api, const gchar *name);
GST_EXPORT
GST_GL_API
gboolean gst_gl_context_set_window (GstGLContext *context, GstGLWindow *window);
GST_EXPORT
GST_GL_API
GstGLWindow * gst_gl_context_get_window (GstGLContext *context);
GST_EXPORT
GST_GL_API
void gst_gl_context_get_gl_version (GstGLContext *context, gint *maj, gint *min);
GST_EXPORT
GST_GL_API
gboolean gst_gl_context_check_gl_version (GstGLContext * context, GstGLAPI api, gint maj, gint min);
GST_EXPORT
GST_GL_API
gboolean gst_gl_context_check_feature (GstGLContext *context, const gchar *feature);
GST_EXPORT
GST_GL_API
void gst_gl_context_get_gl_platform_version (GstGLContext * context, gint * major, gint * minor);
GST_EXPORT
GST_GL_API
guintptr gst_gl_context_get_current_gl_context (GstGLPlatform context_type);
GST_EXPORT
GST_GL_API
GstGLAPI gst_gl_context_get_current_gl_api (GstGLPlatform platform, guint *major, guint *minor);
GST_EXPORT
GST_GL_API
gboolean gst_gl_context_is_shared (GstGLContext * context);
GST_EXPORT
GST_GL_API
void gst_gl_context_set_shared_with (GstGLContext * context, GstGLContext * share);
GST_EXPORT
GST_GL_API
gboolean gst_gl_context_fill_info (GstGLContext * context, GError ** error);
/* FIXME: remove */
GST_EXPORT
GST_GL_API
void gst_gl_context_thread_add (GstGLContext * context,
GstGLContextThreadFunc func, gpointer data);
......
......@@ -55,17 +55,17 @@ struct _GstGLAsyncDebug
gpointer _padding[GST_PADDING];
};
GST_EXPORT
GST_GL_API
GstGLAsyncDebug * gst_gl_async_debug_new (void);
GST_EXPORT
GST_GL_API
void gst_gl_async_debug_free (GstGLAsyncDebug * ad);
GST_EXPORT
GST_GL_API
void gst_gl_async_debug_init (GstGLAsyncDebug * ad);
GST_EXPORT
GST_GL_API
void gst_gl_async_debug_unset (GstGLAsyncDebug * ad);
GST_EXPORT
GST_GL_API
void gst_gl_async_debug_freeze (GstGLAsyncDebug * ad);
GST_EXPORT
GST_GL_API
void gst_gl_async_debug_thaw (GstGLAsyncDebug * ad);
/**
......@@ -119,12 +119,12 @@ GST_GL_ASYNC_CAT_LEVEL_LOG(GstGLAsyncDebug * ad, GstDebugCategory * cat,
#if !defined(GST_DISABLE_GST_DEBUG)
GST_EXPORT
GST_GL_API
void gst_gl_insert_debug_marker (GstGLContext * context,
const gchar * format, ...) G_GNUC_PRINTF (2, 3);
GST_EXPORT
GST_GL_API
void gst_gl_async_debug_output_log_msg (GstGLAsyncDebug * ad);
GST_EXPORT
GST_GL_API
void gst_gl_async_debug_store_log_msg (GstGLAsyncDebug * ad,
GstDebugCategory * cat,
GstDebugLevel level,
......@@ -133,7 +133,7 @@ void gst_gl_async_debug_store_log_msg (GstGLAsyncDebug * ad,
gint line,
GObject * object,
const gchar * format, ...) G_GNUC_PRINTF (8, 9);
GST_EXPORT
GST_GL_API
void gst_gl_async_debug_store_log_msg_valist (GstGLAsyncDebug * ad,
GstDebugCategory * cat,
GstDebugLevel level,
......
......@@ -28,7 +28,7 @@
G_BEGIN_DECLS
GST_EXPORT
GST_GL_API
GType gst_gl_display_get_type (void);
#define GST_TYPE_GL_DISPLAY (gst_gl_display_get_type())
......@@ -100,22 +100,22 @@ struct _GstGLDisplayClass
gpointer _padding[GST_PADDING];
};
GST_EXPORT
GST_GL_API
GstGLDisplay *gst_gl_display_new (void);
#define gst_gl_display_lock(display) GST_OBJECT_LOCK (display)
#define gst_gl_display_unlock(display) GST_OBJECT_UNLOCK (display)
GST_EXPORT
GST_GL_API
guintptr gst_gl_display_get_handle (GstGLDisplay * display);
GST_EXPORT
GST_GL_API
GstGLDisplayType gst_gl_display_get_handle_type (GstGLDisplay * display);
GST_EXPORT
GST_GL_API
void gst_gl_display_filter_gl_api (GstGLDisplay * display,
GstGLAPI gl_api);
GST_EXPORT
GST_GL_API
GstGLAPI gst_gl_display_get_gl_api (GstGLDisplay * display);
GST_EXPORT
GST_GL_API
GstGLAPI gst_gl_display_get_gl_api_unlocked (GstGLDisplay * display);
/**
......@@ -124,26 +124,26 @@ GstGLAPI gst_gl_display_get_gl_api_unlocked (GstGLDisplay * display);
* The name used in #GstContext queries for requesting a #GstGLDisplay
*/
#define GST_GL_DISPLAY_CONTEXT_TYPE "gst.gl.GLDisplay"
GST_EXPORT
GST_GL_API
void gst_context_set_gl_display (GstContext * context, GstGLDisplay * display);
GST_EXPORT
GST_GL_API
gboolean gst_context_get_gl_display (GstContext * context, GstGLDisplay ** display);
GST_EXPORT
GST_GL_API
gboolean gst_gl_display_create_context (GstGLDisplay * display,