mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 13:08:49 +00:00
soup: allow per feature registration
Split plugin into features including dynamic types which can be indiviually registered during a static build. More details here: https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/876>
This commit is contained in:
parent
d661515829
commit
58779e7538
6 changed files with 104 additions and 31 deletions
|
@ -18,43 +18,17 @@
|
|||
|
||||
#include <gst/gst-i18n-plugin.h>
|
||||
|
||||
#include "gstsouphttpsrc.h"
|
||||
#include "gstsouphttpclientsink.h"
|
||||
#include "gstsouputils.h"
|
||||
|
||||
GST_DEBUG_CATEGORY (soup_utils_debug);
|
||||
#include "gstsoupelements.h"
|
||||
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
#ifdef ENABLE_NLS
|
||||
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
|
||||
LOCALEDIR);
|
||||
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||
#endif
|
||||
gboolean ret = FALSE;
|
||||
|
||||
/* see https://bugzilla.gnome.org/show_bug.cgi?id=674885 */
|
||||
g_type_ensure (G_TYPE_SOCKET);
|
||||
g_type_ensure (G_TYPE_SOCKET_ADDRESS);
|
||||
g_type_ensure (G_TYPE_SOCKET_SERVICE);
|
||||
g_type_ensure (G_TYPE_SOCKET_FAMILY);
|
||||
g_type_ensure (G_TYPE_SOCKET_CLIENT);
|
||||
g_type_ensure (G_TYPE_RESOLVER);
|
||||
g_type_ensure (G_TYPE_PROXY_RESOLVER);
|
||||
g_type_ensure (G_TYPE_PROXY_ADDRESS);
|
||||
g_type_ensure (G_TYPE_TLS_CERTIFICATE);
|
||||
g_type_ensure (G_TYPE_TLS_CONNECTION);
|
||||
g_type_ensure (G_TYPE_TLS_DATABASE);
|
||||
g_type_ensure (G_TYPE_TLS_INTERACTION);
|
||||
ret |= GST_ELEMENT_REGISTER (souphttpsrc, plugin);
|
||||
ret |= GST_ELEMENT_REGISTER (souphttpclientsink, plugin);
|
||||
|
||||
gst_element_register (plugin, "souphttpsrc", GST_RANK_PRIMARY,
|
||||
GST_TYPE_SOUP_HTTP_SRC);
|
||||
gst_element_register (plugin, "souphttpclientsink", GST_RANK_NONE,
|
||||
GST_TYPE_SOUP_HTTP_CLIENT_SINK);
|
||||
GST_DEBUG_CATEGORY_INIT (soup_utils_debug, "souputils", 0, "Soup utils");
|
||||
|
||||
return TRUE;
|
||||
return ret;
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
|
|
58
ext/soup/gstsoupelement.c
Normal file
58
ext/soup/gstsoupelement.c
Normal file
|
@ -0,0 +1,58 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) 2007-2008 Wouter Cloetens <wouter@mind.be>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gst/gst-i18n-plugin.h>
|
||||
|
||||
#include "gstsoupelements.h"
|
||||
#include "gstsouphttpsrc.h"
|
||||
#include "gstsouphttpclientsink.h"
|
||||
#include "gstsouputils.h"
|
||||
|
||||
GST_DEBUG_CATEGORY (soup_utils_debug);
|
||||
|
||||
void
|
||||
soup_element_init (GstPlugin * plugin)
|
||||
{
|
||||
static gsize res = FALSE;
|
||||
|
||||
if (g_once_init_enter (&res)) {
|
||||
#ifdef ENABLE_NLS
|
||||
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
|
||||
LOCALEDIR);
|
||||
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||
#endif
|
||||
|
||||
/* see https://bugzilla.gnome.org/show_bug.cgi?id=674885 */
|
||||
g_type_ensure (G_TYPE_SOCKET);
|
||||
g_type_ensure (G_TYPE_SOCKET_ADDRESS);
|
||||
g_type_ensure (G_TYPE_SOCKET_SERVICE);
|
||||
g_type_ensure (G_TYPE_SOCKET_FAMILY);
|
||||
g_type_ensure (G_TYPE_SOCKET_CLIENT);
|
||||
g_type_ensure (G_TYPE_RESOLVER);
|
||||
g_type_ensure (G_TYPE_PROXY_RESOLVER);
|
||||
g_type_ensure (G_TYPE_PROXY_ADDRESS);
|
||||
g_type_ensure (G_TYPE_TLS_CERTIFICATE);
|
||||
g_type_ensure (G_TYPE_TLS_CONNECTION);
|
||||
g_type_ensure (G_TYPE_TLS_DATABASE);
|
||||
g_type_ensure (G_TYPE_TLS_INTERACTION);
|
||||
|
||||
g_once_init_leave (&res, TRUE);
|
||||
GST_DEBUG_CATEGORY_INIT (soup_utils_debug, "souputils", 0, "Soup utils");
|
||||
}
|
||||
}
|
34
ext/soup/gstsoupelements.h
Normal file
34
ext/soup/gstsoupelements.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (C) 2020 Huawei Technologies Co., Ltd.
|
||||
* @Author: Julian Bouzas <julian.bouzas@collabora.com>
|
||||
*
|
||||
* 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_SOUP_ELEMENTS_H__
|
||||
#define __GST_SOUP_ELEMENTS_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void soup_element_init (GstPlugin * plugin);
|
||||
|
||||
GST_ELEMENT_REGISTER_DECLARE (souphttpsrc);
|
||||
GST_ELEMENT_REGISTER_DECLARE (souphttpclientsink);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_SOUP_ELEMENTS_H__ */
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstbasesink.h>
|
||||
#include "gstsoupelements.h"
|
||||
#include "gstsouphttpclientsink.h"
|
||||
#include "gstsouputils.h"
|
||||
|
||||
|
@ -114,6 +115,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
|
|||
#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 void
|
||||
gst_soup_http_client_sink_class_init (GstSoupHttpClientSinkClass * klass)
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
#include <gst/gstelement.h>
|
||||
#include <gst/gst-i18n-plugin.h>
|
||||
#include <libsoup/soup.h>
|
||||
#include "gstsoupelements.h"
|
||||
#include "gstsouphttpsrc.h"
|
||||
#include "gstsouputils.h"
|
||||
|
||||
|
@ -192,6 +193,8 @@ static void gst_soup_http_src_authenticate_cb (SoupSession * session,
|
|||
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 void
|
||||
gst_soup_http_src_class_init (GstSoupHTTPSrcClass * klass)
|
||||
|
|
|
@ -2,6 +2,7 @@ soup_sources = [
|
|||
'gstsouphttpsrc.c',
|
||||
'gstsouphttpclientsink.c',
|
||||
'gstsouputils.c',
|
||||
'gstsoupelement.c',
|
||||
'gstsoup.c',
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in a new issue