gl/vulkan: Fix static linking on macOS

duplicate symbol '__invoke_on_main' in:
    /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstvulkan-1.0.a(cocoa_gstvkwindow_cocoa.m.o)
    /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstgl-1.0.a(cocoa_gstglwindow_cocoa.m.o)
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Also make the same change in iOS for consistency.

Continuation of https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1132

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3242>
This commit is contained in:
Nirbheek Chauhan 2022-10-21 21:50:01 +05:30 committed by GStreamer Marge Bot
parent 0077d13304
commit a083280a58
7 changed files with 19 additions and 19 deletions

View file

@ -49,7 +49,7 @@ G_BEGIN_DECLS
typedef void (*GstVulkanWindowFunc) (gpointer data);
G_GNUC_INTERNAL
void _invoke_on_main (GstVulkanWindowFunc func, gpointer data, GDestroyNotify notify);
void _gst_vk_invoke_on_main (GstVulkanWindowFunc func, gpointer data, GDestroyNotify notify);
G_END_DECLS

View file

@ -155,8 +155,8 @@ gst_vulkan_window_cocoa_show (GstVulkanWindow * window)
GstVulkanWindowCocoaPrivate *priv = GET_PRIV (window_cocoa);
if (!priv->visible)
_invoke_on_main ((GstVulkanWindowFunc) _show_window, gst_object_ref (window),
(GDestroyNotify) gst_object_unref);
_gst_vk_invoke_on_main ((GstVulkanWindowFunc) _show_window,
gst_object_ref (window), (GDestroyNotify) gst_object_unref);
}
static void
@ -197,7 +197,7 @@ _create_window (GstVulkanWindowCocoa * window_cocoa)
gboolean
gst_vulkan_window_cocoa_create_window (GstVulkanWindowCocoa * window_cocoa)
{
_invoke_on_main ((GstVulkanWindowFunc) _create_window,
_gst_vk_invoke_on_main ((GstVulkanWindowFunc) _create_window,
gst_object_ref (window_cocoa), gst_object_unref);
g_usleep(1000000);
@ -277,8 +277,8 @@ _close_window (gpointer * data)
static void
gst_vulkan_window_cocoa_close (GstVulkanWindow * window)
{
_invoke_on_main ((GstVulkanWindowFunc) _close_window, gst_object_ref (window),
(GDestroyNotify) gst_object_unref);
_gst_vk_invoke_on_main ((GstVulkanWindowFunc) _close_window,
gst_object_ref (window), (GDestroyNotify) gst_object_unref);
GST_VULKAN_WINDOW_CLASS (parent_class)->close (window);
}
@ -359,7 +359,7 @@ gst_vulkan_window_cocoa_close (GstVulkanWindow * window)
@end
void
_invoke_on_main (GstVulkanWindowFunc func, gpointer data, GDestroyNotify notify)
_gst_vk_invoke_on_main (GstVulkanWindowFunc func, gpointer data, GDestroyNotify notify)
{
if ([NSThread isMainThread]) {
func (data);

View file

@ -35,7 +35,7 @@ G_BEGIN_DECLS
typedef void (*GstVulkanWindowFunc) (gpointer data);
G_GNUC_INTERNAL
void _invoke_on_main (GstVulkanWindowFunc func, gpointer data, GDestroyNotify notify);
void _gst_vk_invoke_on_main (GstVulkanWindowFunc func, gpointer data, GDestroyNotify notify);
G_END_DECLS

View file

@ -178,7 +178,7 @@ gst_vulkan_window_ios_create_window (GstVulkanWindowIos * window_ios)
return FALSE;
}
_invoke_on_main ((GstVulkanWindowFunc) _create_window,
_gst_vk_invoke_on_main ((GstVulkanWindowFunc) _create_window,
gst_object_ref (window_ios), gst_object_unref);
/* XXX: Maybe we need an async create_window/get_surface()? */
@ -315,7 +315,7 @@ gst_vulkan_window_ios_set_window_handle (GstVulkanWindow * window,
@end
void
_invoke_on_main (GstVulkanWindowFunc func, gpointer data, GDestroyNotify notify)
_gst_vk_invoke_on_main (GstVulkanWindowFunc func, gpointer data, GDestroyNotify notify)
{
if ([NSThread isMainThread]) {
func (data);

View file

@ -61,7 +61,7 @@ struct _GstGLContextCocoaPrivate
gboolean gst_gl_window_cocoa_create_window (GstGLWindowCocoa *window_cocoa);
G_GNUC_INTERNAL
void _invoke_on_main (GstGLWindowCB func, gpointer data, GDestroyNotify notify);
void _gst_gl_invoke_on_main (GstGLWindowCB func, gpointer data, GDestroyNotify notify);
G_END_DECLS

View file

@ -313,7 +313,7 @@ gst_gl_context_cocoa_create_context (GstGLContext *context, GstGLAPI gl_api,
context_cocoa->priv->pixel_format = fmt;
context_cocoa->priv->gl_context = glContext;
_invoke_on_main ((GstGLWindowCB) gst_gl_window_cocoa_create_window,
_gst_gl_invoke_on_main ((GstGLWindowCB) gst_gl_window_cocoa_create_window,
gst_object_ref (window_cocoa), (GDestroyNotify) gst_object_unref);
if (!context_cocoa->priv->gl_context) {

View file

@ -263,8 +263,8 @@ _close_window (gpointer * data)
static void
gst_gl_window_cocoa_close (GstGLWindow * window)
{
_invoke_on_main ((GstGLWindowCB) _close_window, gst_object_ref (window),
(GDestroyNotify) gst_object_unref);
_gst_gl_invoke_on_main ((GstGLWindowCB) _close_window,
gst_object_ref (window), (GDestroyNotify) gst_object_unref);
}
static guintptr
@ -346,8 +346,8 @@ gst_gl_window_cocoa_show (GstGLWindow * window)
}
if (!priv->external_view && !priv->visible)
_invoke_on_main ((GstGLWindowCB) _show_window, gst_object_ref (window),
(GDestroyNotify) gst_object_unref);
_gst_gl_invoke_on_main ((GstGLWindowCB) _show_window,
gst_object_ref (window), (GDestroyNotify) gst_object_unref);
}
}
@ -579,8 +579,8 @@ gst_gl_window_cocoa_set_render_rectangle (GstGLWindow * window, gint x, gint y,
render->rect.w = width;
render->rect.h = height;
_invoke_on_main ((GstGLWindowCB) _set_render_rectangle, render,
(GDestroyNotify) _free_set_render_rectangle);
_gst_gl_invoke_on_main ((GstGLWindowCB) _set_render_rectangle, render,
(GDestroyNotify) _free_set_render_rectangle);
return TRUE;
}
@ -732,7 +732,7 @@ close_window_cb (gpointer data)
@end
void
_invoke_on_main (GstGLWindowCB func, gpointer data, GDestroyNotify notify)
_gst_gl_invoke_on_main (GstGLWindowCB func, gpointer data, GDestroyNotify notify)
{
if ([NSThread isMainThread]) {
func (data);