Building GStreamer as static for iOS app w/ AWS kvssink plugin

I’m working at a company in which we are building an iOS Swift app that is deployed on modern iPad devices that streams video & audio from the iPad cameras/microphones into the device’s folder & to an AWS Kinesis Video Stream service (using the AWS kvssink GStreamer plugin).

As part developing this iOS app we strive using static libraries over dynamic ones from reasons of security along with some gains in performance.

I’ve got these questions:

  • Feedback from anyone that has build an app as GStreamer as static libraries in a production application deployed to many users?

  • Are there special caveats/considerations that we need to be aware of for an iOS app?

Something that I’m still mulling over is the fact that this app uses the AWS kvssink GStreamer plugin. At present, it a separate Git repository that we build afterwards since there are dependencies on the GStreamer project.

One idea is to create our fork of the GStreamer Git repository which includes the kvssink as a subproject. Thus when building GStreamer as static library then the kvssink plugin is incorporated alongside the other plugins.

Does someone have a experiences on incorporating their GStreamer plugins being built as a static library incorporated alongside the other plugins?

Thanks,
Steven

The official binaries shipped by the GStreamer project (using Cerbero) support building for iOS and there are example iOS application and tutorials. The rust plugins are shipped as well.

To add to what Matt already said, the official tutorials and examples all use static linking. All this is already supported.

https://gstreamer.freedesktop.org/documentation/tutorials/ios/index.html?gi-language=c

https://gstreamer.freedesktop.org/documentation/installing/for-ios-development.html?gi-language=c

Since the AWS kvssink plugin is third-party, you should just build it as part of your app, instead of forking gstreamer and building everything.

On my MacBook Pro, I built the GStreamer as a static library, then built the AWS Kinesis Video Stream plugin (kvssink) as a shared library using the package of the previously built GStreamer.

When performing the gst-inspect-1.0 a crash occurs.

me@workstation bin % export DYLD_LIBRARY_PATH=:/usr/local/lib:/Users/me/install/MAC_ARM64/gstreamer/lib:/Users/me/install/MAC_ARM64/aws_kinesis/lib
me@workstation bin bin % export GST_PLUGIN_PATH=:/Users/me/install/MAC_ARM64/gstreamer/lib:/Users/me/install/MAC_ARM64/aws_kinesis/lib                 
me@workstation % ./gst-inspect-1.0                                                                                                                               

(gst-plugin-scanner:42520): GLib-GObject-CRITICAL **: 13:43:55.904: cannot register existing type 'GstObject'

(gst-plugin-scanner:42520): GLib-CRITICAL **: 13:43:55.905: g_once_init_leave_pointer: assertion 'result != 0' failed

(gst-plugin-scanner:42520): GLib-GObject-CRITICAL **: 13:43:55.905: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:42520): GLib-CRITICAL **: 13:43:55.905: g_once_init_leave: assertion 'result != 0' failed

(gst-plugin-scanner:42520): GLib-GObject-CRITICAL **: 13:43:55.905: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:42520): GLib-CRITICAL **: 13:43:55.905: g_once_init_leave_pointer: assertion 'result != 0' failed

When removing the /Users/me/install/MAC_ARM64/aws_kinesis/lib from the DYLD_LIBRARY_PATH and GST_PLUGIN_PATH, then the gst-inspect-1.0 tool behaves as expected listing the plugins.

Which I gather are those compiled into libgstreamer-full-1.0.dylib.

I just what to state that verified that this isn’t a case as mentioned in the Troubleshooting section mentionned in subprojects/gstreamer/docs/random/porting-to-1.0.txt where there are multiple GStreamer editions. I’ve reviewed that the kvssink plugin is compiled and linked using GStreamer package that I just built. Therefor, it matches the executables in the package’s ../gstreamer/bin folder.

My comprehension of the crash, is that gst-inspect-1.0 tools is load the plugins using the folder from the GST_PLUGIN_PATH but when it gets to kvssink plugin after it loaded that plugin dynamically, it attempts to a register function is invoked. However, that block of code is meant to be invoked only once.

I’ll look into this a bit and provide an update on what I discover.