diff --git a/playback/player/ios/GstPlay/gst_ios_init.h b/playback/player/ios/GstPlay/gst_ios_init.h index 870515bd87..a5626f11ef 100644 --- a/playback/player/ios/GstPlay/gst_ios_init.h +++ b/playback/player/ios/GstPlay/gst_ios_init.h @@ -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 diff --git a/playback/player/ios/GstPlay/gst_ios_init.m b/playback/player/ios/GstPlay/gst_ios_init.m index aea37caf99..fbee884a84 100644 --- a/playback/player/ios/GstPlay/gst_ios_init.m +++ b/playback/player/ios/GstPlay/gst_ios_init.m @@ -1,4 +1,5 @@ #include "gst_ios_init.h" +#include #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 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();