1 /* GStreamer
2 * Copyright (C) 2007-2008 Wouter Cloetens <wouter@mind.be>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more
13 */
14
15 #ifdef HAVE_CONFIG_H
16 #include "config.h"
17 #endif
18
19 #include <gst/gst-i18n-plugin.h>
20
21 #include "gstsoupelements.h"
22 #include "gstsouphttpsrc.h"
23 #include "gstsouphttpclientsink.h"
24 #include "gstsouputils.h"
25
26 GST_DEBUG_CATEGORY (soup_utils_debug);
27 #define GST_CAT_DEFAULT soup_utils_debug
28
29 gboolean
soup_element_init(GstPlugin * plugin)30 soup_element_init (GstPlugin * plugin)
31 {
32 static gsize res = FALSE;
33
34 if (g_once_init_enter (&res)) {
35 GST_DEBUG_CATEGORY_INIT (soup_utils_debug, "souputils", 0, "Soup utils");
36 #ifdef ENABLE_NLS
37 GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
38 LOCALEDIR);
39 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
40 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
41 #endif
42
43 /* see https://bugzilla.gnome.org/show_bug.cgi?id=674885 */
44 g_type_ensure (G_TYPE_SOCKET);
45 g_type_ensure (G_TYPE_SOCKET_ADDRESS);
46 g_type_ensure (G_TYPE_SOCKET_SERVICE);
47 g_type_ensure (G_TYPE_SOCKET_FAMILY);
48 g_type_ensure (G_TYPE_SOCKET_CLIENT);
49 g_type_ensure (G_TYPE_RESOLVER);
50 g_type_ensure (G_TYPE_PROXY_RESOLVER);
51 g_type_ensure (G_TYPE_PROXY_ADDRESS);
52 g_type_ensure (G_TYPE_TLS_CERTIFICATE);
53 g_type_ensure (G_TYPE_TLS_CONNECTION);
54 g_type_ensure (G_TYPE_TLS_DATABASE);
55 g_type_ensure (G_TYPE_TLS_INTERACTION);
56
57 g_once_init_leave (&res, TRUE);
58 }
59 #ifndef STATIC_SOUP
60 if (!gst_soup_load_library ()) {
61 GST_WARNING ("Failed to load libsoup library");
62 return FALSE;
63 }
64 #endif
65 return TRUE;
66 }
67