{
gboolean ret = FALSE;
- GST_DEBUG_CATEGORY_INIT (gst_soup_debug, "soup", 0, "soup");
-
-#ifndef STATIC_SOUP
- if (!gst_soup_load_library ()) {
- GST_WARNING ("Failed to load libsoup library");
- return TRUE;
- }
-#endif
-
ret |= GST_ELEMENT_REGISTER (souphttpsrc, plugin);
ret |= GST_ELEMENT_REGISTER (souphttpclientsink, plugin);
GST_DEBUG_CATEGORY (soup_utils_debug);
-void
+gboolean
soup_element_init (GstPlugin * plugin)
{
static gsize res = FALSE;
g_once_init_leave (&res, TRUE);
}
+#ifndef STATIC_SOUP
+ if (!gst_soup_load_library ()) {
+ GST_WARNING ("Failed to load libsoup library");
+ return FALSE;
+ }
+#endif
+ return TRUE;
}
G_BEGIN_DECLS
-void soup_element_init (GstPlugin * plugin);
+gboolean soup_element_init (GstPlugin * plugin);
GST_ELEMENT_REGISTER_DECLARE (souphttpsrc);
GST_ELEMENT_REGISTER_DECLARE (souphttpclientsink);
#define gst_soup_http_client_sink_parent_class parent_class
G_DEFINE_TYPE (GstSoupHttpClientSink, gst_soup_http_client_sink,
GST_TYPE_BASE_SINK);
-GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (souphttpclientsink, "souphttpclientsink",
- GST_RANK_NONE, GST_TYPE_SOUP_HTTP_CLIENT_SINK, soup_element_init (plugin));
+
+static gboolean souphttpclientsink_element_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DEFINE_CUSTOM (souphttpclientsink,
+ souphttpclientsink_element_init);
+
static void
gst_soup_http_client_sink_class_init (GstSoupHttpClientSinkClass * klass)
GST_DEBUG_FUNCPTR (gst_soup_http_client_sink_unlock);
base_sink_class->render =
GST_DEBUG_FUNCPTR (gst_soup_http_client_sink_render);
-
- GST_DEBUG_CATEGORY_INIT (souphttpclientsink_dbg, "souphttpclientsink", 0,
- "souphttpclientsink element");
}
static void
}
return FALSE;
}
+
+static gboolean
+souphttpclientsink_element_init (GstPlugin * plugin)
+{
+ gboolean ret = TRUE;
+
+ GST_DEBUG_CATEGORY_INIT (souphttpclientsink_dbg, "souphttpclientsink", 0,
+ "souphttpclientsink element");
+
+ if (!soup_element_init (plugin))
+ return TRUE;
+
+ ret =
+ gst_element_register (plugin, "souphttpclientsink", GST_RANK_NONE,
+ GST_TYPE_SOUP_HTTP_CLIENT_SINK);
+
+ return ret;
+}
G_DEFINE_TYPE_WITH_CODE (GstSoupHTTPSrc, gst_soup_http_src, GST_TYPE_PUSH_SRC,
G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER,
gst_soup_http_src_uri_handler_init));
-GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (souphttpsrc, "souphttpsrc",
- GST_RANK_PRIMARY, GST_TYPE_SOUP_HTTP_SRC, soup_element_init (plugin));
+
+static gboolean souphttpsrc_element_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DEFINE_CUSTOM (souphttpsrc, souphttpsrc_element_init);
static void
gst_soup_http_src_class_init (GstSoupHTTPSrcClass * klass)
gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_soup_http_src_query);
gstpushsrc_class->create = GST_DEBUG_FUNCPTR (gst_soup_http_src_create);
-
- GST_DEBUG_CATEGORY_INIT (souphttpsrc_debug, "souphttpsrc", 0,
- "SOUP HTTP src");
}
static void
iface->get_uri = gst_soup_http_src_uri_get_uri;
iface->set_uri = gst_soup_http_src_uri_set_uri;
}
+
+static gboolean
+souphttpsrc_element_init (GstPlugin * plugin)
+{
+ gboolean ret = TRUE;
+
+ GST_DEBUG_CATEGORY_INIT (souphttpsrc_debug, "souphttpsrc", 0,
+ "SOUP HTTP src");
+
+ if (!soup_element_init (plugin))
+ return TRUE;
+
+ ret = gst_element_register (plugin, "souphttpsrc",
+ GST_RANK_PRIMARY, GST_TYPE_SOUP_HTTP_SRC);
+
+ return ret;
+}