我的iOS应用程序在尝试将证书加载到GSTREAMER中时正在与Exc_Bad_Access崩溃。 gst_ios_init()

发布于 2025-02-01 23:59:04 字数 2489 浏览 2 评论 0原文

我想将我的iOS应用程序的GStreamer版本从1.16.3更新为 1.18.6

我知道的主要更改是,现在GSTREAMER 1.18.X仅与OpenSSL一起使用(不再使用Gnutls)。

我所做的:

我从这里下载了安装程序: https://gstreamer.freedesktop.org/data/pkg/pkg/ios/1.18.6/gstreamer-1.0-devel-1.0-devel-1.1.1.18.6-ios-universal。 PKG 我通过更新gst_ios_init.h通过替换#define gst_ios_gio_gio_module_gnutls使用#define gst_gio_gio_module_openssl现在,#define gst_ios_gio_gnutls现在,使用#define GST_GIO_MODULE_GNUTLS

现在撞车(ios 15.4.1)在调用g_tls_file_database_new(ca_certificates,null); gst_ios_init.m 文件时。我得到exc_bad_access异常,这很奇怪,因为我没有更改证书位置。

这是该应用程序崩溃的代码的片段,仅当有一个文件时,它才会崩溃。如果没有,则gst_ios_init呼叫正确结束,但是我无法使用加密,我真的需要!

 **const gchar *resources_dir = [resources UTF8String];
    const gchar *tmp_dir = [tmp UTF8String];
    const gchar *cache_dir = [cache UTF8String];
    const gchar *docs_dir = [docs UTF8String];
    const gchar *library_dir = [libraryString UTF8String];
    gchar *ca_certificates;
        
    g_setenv ("TMP", tmp_dir, TRUE);
    g_setenv ("TEMP", tmp_dir, TRUE);
    g_setenv ("TMPDIR", tmp_dir, TRUE);
    g_setenv ("XDG_RUNTIME_DIR", resources_dir, TRUE);
    g_setenv ("XDG_CACHE_HOME", cache_dir, TRUE);
        
    g_setenv ("HOME", docs_dir, TRUE);
    g_setenv ("XDG_DATA_DIRS", resources_dir, TRUE);
    g_setenv ("XDG_CONFIG_DIRS", resources_dir, TRUE);
    g_setenv ("XDG_CONFIG_HOME", cache_dir, TRUE);
    g_setenv ("XDG_DATA_HOME", resources_dir, TRUE);
    g_setenv ("FONTCONFIG_PATH", resources_dir, TRUE);


    ca_certificates = g_build_filename (library_dir, "ca.pem", NULL);
    g_setenv ("CA_CERTIFICATES", ca_certificates, TRUE);

#if defined(GST_IOS_GIO_MODULE_OPENSSL)
  GST_G_IO_MODULE_LOAD(openssl);
#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);**

这也是碰撞的屏幕截图。

在此处输入图像描述

I want to update the GStreamer version of my iOS App from 1.16.3 to 1.18.6.

The main change that I am aware of, is that now GStreamer 1.18.x only works with openssl (gnutls cannot be used anymore).

What I did:

I downloaded the installer from here: https://gstreamer.freedesktop.org/data/pkg/ios/1.18.6/gstreamer-1.0-devel-1.18.6-ios-universal.pkg
I updated the gst_ios_init.h file to use openssl instead of gnutls, by replacing the #define GST_IOS_GIO_MODULE_GNUTLS line with #define GST_IOS_GIO_MODULE_OPENSSL

The App is now crashing (iOS 15.4.1) when calling the g_tls_file_database_new (ca_certificates, NULL); on the gst_ios_init.m file. I am getting a EXC_BAD_ACCESS exception, which is weird because I didn't change the certificate location.

This is a snippet of the code where the App is crashing, it only crashes if there is a file where ca_certificates points to. If there isn't then the gst_ios_init call ends properly, but then I cannot use encryption, which I really need to!!

 **const gchar *resources_dir = [resources UTF8String];
    const gchar *tmp_dir = [tmp UTF8String];
    const gchar *cache_dir = [cache UTF8String];
    const gchar *docs_dir = [docs UTF8String];
    const gchar *library_dir = [libraryString UTF8String];
    gchar *ca_certificates;
        
    g_setenv ("TMP", tmp_dir, TRUE);
    g_setenv ("TEMP", tmp_dir, TRUE);
    g_setenv ("TMPDIR", tmp_dir, TRUE);
    g_setenv ("XDG_RUNTIME_DIR", resources_dir, TRUE);
    g_setenv ("XDG_CACHE_HOME", cache_dir, TRUE);
        
    g_setenv ("HOME", docs_dir, TRUE);
    g_setenv ("XDG_DATA_DIRS", resources_dir, TRUE);
    g_setenv ("XDG_CONFIG_DIRS", resources_dir, TRUE);
    g_setenv ("XDG_CONFIG_HOME", cache_dir, TRUE);
    g_setenv ("XDG_DATA_HOME", resources_dir, TRUE);
    g_setenv ("FONTCONFIG_PATH", resources_dir, TRUE);


    ca_certificates = g_build_filename (library_dir, "ca.pem", NULL);
    g_setenv ("CA_CERTIFICATES", ca_certificates, TRUE);

#if defined(GST_IOS_GIO_MODULE_OPENSSL)
  GST_G_IO_MODULE_LOAD(openssl);
#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);**

Here's also an screenshot of the crash.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文