mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 12:41:05 +00:00
Use macros to register boxed types thread safely
This commit is contained in:
parent
cb044668d3
commit
e391118125
3 changed files with 7 additions and 26 deletions
|
@ -465,18 +465,9 @@ gst_install_plugins_context_copy (GstInstallPluginsContext * ctx)
|
|||
return ret;
|
||||
}
|
||||
|
||||
GType
|
||||
gst_install_plugins_context_get_type (void)
|
||||
{
|
||||
static GType gst_ipc_type = 0;
|
||||
|
||||
if (G_UNLIKELY (gst_ipc_type == 0)) {
|
||||
gst_ipc_type = g_boxed_type_register_static ("GstInstallPluginsContext",
|
||||
G_DEFINE_BOXED_TYPE (GstInstallPluginsContext, gst_install_plugins_context,
|
||||
(GBoxedCopyFunc) gst_install_plugins_context_copy,
|
||||
(GBoxedFreeFunc) gst_install_plugins_context_free);
|
||||
}
|
||||
return gst_ipc_type;
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
gst_install_plugins_get_helper (void)
|
||||
|
|
|
@ -54,19 +54,8 @@
|
|||
|
||||
#include "gstrtspurl.h"
|
||||
|
||||
GType
|
||||
gst_rtsp_url_get_type (void)
|
||||
{
|
||||
static volatile gsize url_type = 0;
|
||||
|
||||
if (g_once_init_enter (&url_type)) {
|
||||
GType tmp = g_boxed_type_register_static ("GstRTSPUrl",
|
||||
G_DEFINE_BOXED_TYPE (GstRTSPUrl, gst_rtsp_url,
|
||||
(GBoxedCopyFunc) gst_rtsp_url_copy, (GBoxedFreeFunc) gst_rtsp_url_free);
|
||||
g_once_init_leave (&url_type, tmp);
|
||||
}
|
||||
|
||||
return (GType) url_type;
|
||||
}
|
||||
|
||||
static const struct
|
||||
{
|
||||
|
|
|
@ -1028,6 +1028,7 @@ gst_adder_release_pad (GstElement * element, GstPad * pad)
|
|||
|
||||
GST_DEBUG_OBJECT (adder, "release pad %s:%s", GST_DEBUG_PAD_NAME (pad));
|
||||
|
||||
if (adder->collect)
|
||||
gst_collect_pads2_remove_pad (adder->collect, pad);
|
||||
gst_element_remove_pad (element, pad);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue