gst-plugin: Properly export external API symbols

We do not install headers from gst-plugin, but still need to export
symbols to compile modules that use plugin provided shared libraries.
This commit is contained in:
Rafał Dzięgiel
2024-06-15 19:53:06 +02:00
parent 521a83bad0
commit 3ce937c2b9
5 changed files with 37 additions and 1 deletions

View File

@@ -22,6 +22,8 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/base/gstbasesink.h> #include <gst/base/gstbasesink.h>
#include "gst/plugin/clapper-gst-visibility.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_CLAPPER_CONTEXT_HANDLER (gst_clapper_context_handler_get_type()) #define GST_TYPE_CLAPPER_CONTEXT_HANDLER (gst_clapper_context_handler_get_type())
@@ -53,10 +55,13 @@ struct _GstClapperContextHandlerClass
GstQuery *query); GstQuery *query);
}; };
CLAPPER_GST_API
GType gst_clapper_context_handler_get_type (void); GType gst_clapper_context_handler_get_type (void);
CLAPPER_GST_API
gboolean gst_clapper_context_handler_handle_context_query (GstClapperContextHandler *handler, GstBaseSink *bsink, GstQuery *query); gboolean gst_clapper_context_handler_handle_context_query (GstClapperContextHandler *handler, GstBaseSink *bsink, GstQuery *query);
CLAPPER_GST_API
GstClapperContextHandler * gst_clapper_context_handler_obtain_with_type (GPtrArray *context_handlers, GType type); GstClapperContextHandler * gst_clapper_context_handler_obtain_with_type (GPtrArray *context_handlers, GType type);
G_END_DECLS G_END_DECLS

View File

@@ -23,6 +23,8 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gst/plugin/clapper-gst-visibility.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_CLAPPER_IMPORTER (gst_clapper_importer_get_type()) #define GST_TYPE_CLAPPER_IMPORTER (gst_clapper_importer_get_type())
@@ -79,6 +81,7 @@ struct _GstClapperImporterClass
GstVideoInfo *v_info); GstVideoInfo *v_info);
}; };
CLAPPER_GST_API
GType gst_clapper_importer_get_type (void); GType gst_clapper_importer_get_type (void);
GstBufferPool * gst_clapper_importer_create_pool (GstClapperImporter *importer, GstStructure **config); GstBufferPool * gst_clapper_importer_create_pool (GstClapperImporter *importer, GstStructure **config);

View File

@@ -26,10 +26,14 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gst/plugin/clapper-gst-visibility.h"
G_BEGIN_DECLS G_BEGIN_DECLS
CLAPPER_GST_API
gpointer gst_gtk_invoke_on_main (GThreadFunc func, gpointer data); gpointer gst_gtk_invoke_on_main (GThreadFunc func, gpointer data);
CLAPPER_GST_API
GdkTexture * gst_video_frame_into_gdk_texture (GstVideoFrame *frame); GdkTexture * gst_video_frame_into_gdk_texture (GstVideoFrame *frame);
void gst_gtk_get_width_height_for_rotation (gint width, gint height, void gst_gtk_get_width_height_for_rotation (gint width, gint height,

View File

@@ -27,10 +27,13 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "gst/plugin/gstclappercontexthandler.h" #include "gst/plugin/gstclappercontexthandler.h"
#include "gst/plugin/clapper-gst-visibility.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_CLAPPER_GL_CONTEXT_HANDLER (gst_clapper_gl_context_handler_get_type()) #define GST_TYPE_CLAPPER_GL_CONTEXT_HANDLER (gst_clapper_gl_context_handler_get_type())
CLAPPER_GST_API
G_DECLARE_FINAL_TYPE (GstClapperGLContextHandler, gst_clapper_gl_context_handler, GST, CLAPPER_GL_CONTEXT_HANDLER, GstClapperContextHandler) G_DECLARE_FINAL_TYPE (GstClapperGLContextHandler, gst_clapper_gl_context_handler, GST, CLAPPER_GL_CONTEXT_HANDLER, GstClapperContextHandler)
#define GST_CLAPPER_GL_CONTEXT_HANDLER_CAST(obj) ((GstClapperGLContextHandler *)(obj)) #define GST_CLAPPER_GL_CONTEXT_HANDLER_CAST(obj) ((GstClapperGLContextHandler *)(obj))
@@ -55,10 +58,13 @@ struct _GstClapperGLContextHandler
GstGLContext *gst_context; GstGLContext *gst_context;
}; };
CLAPPER_GST_API
void gst_clapper_gl_context_handler_add_handler (GPtrArray *context_handlers); void gst_clapper_gl_context_handler_add_handler (GPtrArray *context_handlers);
CLAPPER_GST_API
GstCaps * gst_clapper_gl_context_handler_make_gdk_gl_caps (const gchar *features, gboolean only_2d); GstCaps * gst_clapper_gl_context_handler_make_gdk_gl_caps (const gchar *features, gboolean only_2d);
CLAPPER_GST_API
GdkTexture * gst_clapper_gl_context_handler_make_gl_texture (GstClapperGLContextHandler *handler, GstBuffer *buffer, GstVideoInfo *v_info); GdkTexture * gst_clapper_gl_context_handler_make_gl_texture (GstClapperGLContextHandler *handler, GstBuffer *buffer, GstVideoInfo *v_info);
G_END_DECLS G_END_DECLS

View File

@@ -23,11 +23,15 @@ endforeach
gst_clapper_plugin_args = [ gst_clapper_plugin_args = [
'-DHAVE_CONFIG_H', '-DHAVE_CONFIG_H',
'-DCLAPPER_GST_COMPILATION',
'-DGST_USE_UNSTABLE_API', '-DGST_USE_UNSTABLE_API',
] ]
if get_option('default_library') == 'static' if get_option('default_library') == 'static'
gst_clapper_plugin_args += ['-DGST_STATIC_COMPILATION'] gst_clapper_plugin_args += [
'-DGST_STATIC_COMPILATION',
'-DCLAPPER_GST_STATIC_COMPILATION',
]
endif endif
cdata = configuration_data() cdata = configuration_data()
@@ -46,6 +50,20 @@ configure_file(
output: 'config.h', output: 'config.h',
configuration: cdata, configuration: cdata,
) )
visibility_conf = configuration_data()
visibility_conf.set(
'CLAPPER_API',
'CLAPPER_GST',
)
clappergst_visibility_header = configure_file(
input: '../../shared/clapper-api-visibility.h.in',
output: 'clapper-gst-visibility.h',
configuration: visibility_conf,
)
gst_plugin_conf_inc = [ gst_plugin_conf_inc = [
include_directories('.'), include_directories('.'),
include_directories('..'), include_directories('..'),