ios: update for gio modules and GTlsBackend changes

Untested, based on https://gitlab.freedesktop.org/gstreamer/cerbero/merge_requests/103

Fixes https://gitlab.freedesktop.org/gstreamer/gst-examples/issues/5
This commit is contained in:
Tim-Philipp Müller 2019-02-07 11:12:49 +00:00
parent 2b3fc175c2
commit ef7abd54a8
2 changed files with 20 additions and 11 deletions

View file

@ -6,10 +6,10 @@
G_BEGIN_DECLS
#define GST_G_IO_MODULE_DECLARE(name) \
extern void G_PASTE(g_io_module_, G_PASTE(name, _load_static)) (void)
extern void G_PASTE(g_io_, G_PASTE(name, _load)) (gpointer module)
#define GST_G_IO_MODULE_LOAD(name) \
G_PASTE(g_io_module_, G_PASTE(name, _load_static)) ()
G_PASTE(g_io_, G_PASTE(name, _load)) (NULL)
/* Uncomment each line to enable the plugin categories that your application needs.
* You can also enable individual plugins. See gst_ios_init.c to see their names
@ -32,7 +32,7 @@ G_PASTE(g_io_module_, G_PASTE(name, _load_static)) ()
#define GST_IOS_GIO_MODULE_GNUTLS
void gst_ios_init ();
void gst_ios_init (void);
G_END_DECLS

View file

@ -1,4 +1,5 @@
#include "gst_ios_init.h"
#include <gio/gio.h>
#if defined(GST_IOS_PLUGIN_NLE) || defined(GST_IOS_PLUGINS_GES)
GST_PLUGIN_STATIC_DECLARE(nle);
@ -491,7 +492,6 @@ GST_PLUGIN_STATIC_DECLARE(rtspclientsink);
#endif
#if defined(GST_IOS_GIO_MODULE_GNUTLS)
#include <gio/gio.h>
GST_G_IO_MODULE_DECLARE(gnutls);
#endif
@ -524,13 +524,26 @@ gst_ios_init (void)
g_setenv ("XDG_DATA_HOME", resources_dir, TRUE);
g_setenv ("FONTCONFIG_PATH", resources_dir, TRUE);
ca_certificates = g_build_filename (resources_dir, "ssl", "certs", "ca-certifcates.crt", NULL);
ca_certificates = g_build_filename (resources_dir, "ssl", "certs", "ca-certificates.crt", NULL);
g_setenv ("CA_CERTIFICATES", ca_certificates, TRUE);
g_free (ca_certificates);
#if defined(GST_IOS_GIO_MODULE_GNUTLS)
GST_G_IO_MODULE_LOAD(gnutls);
#endif
if (ca_certificates) {
GTlsBackend *backend = g_tls_backend_get_default ();
if (backend) {
GTlsDatabase *db = g_tls_file_database_new (ca_certificates, NULL);
if (db)
g_tls_backend_set_default_database (backend, db);
}
}
g_free (ca_certificates);
gst_init (NULL, NULL);
#if defined(GST_IOS_PLUGIN_NLE) || defined(GST_IOS_PLUGINS_GES)
#if defined(GST_IOS_PLUGIN_NLE) || defined(GST_IOS_PLUGINS_GES)
GST_PLUGIN_STATIC_REGISTER(nle);
#endif
#if defined(GST_IOS_PLUGIN_COREELEMENTS) || defined(GST_IOS_PLUGINS_CORE)
@ -1020,10 +1033,6 @@ gst_ios_init (void)
GST_PLUGIN_STATIC_REGISTER(rtspclientsink);
#endif
#if defined(GST_IOS_GIO_MODULE_GNUTLS)
GST_G_IO_MODULE_LOAD(gnutls);
#endif
/* Lower the ranks of filesrc and giosrc so iosavassetsrc is
* tried first in gst_element_make_from_uri() for file:// */
reg = gst_registry_get();