Search code examples
iosqtgstreamer

GStreamer on Qt for iOS


I'm trying to develop an iOS application (iPad should be the main target) for controlling a device (Linux embedded) connected to the same network.

Basically it is a remote desktop application.

The application must be multi-platform, so it has be built within a multi-platform framework. This requirement is fulfilled by developing the app with Qt and Qt Creator.

The application should play a stream video stream transmitted over the network from the Linux device. I use GStreamer for that. I already downloaded and succesfully installed the iOS package from the official site (https://gstreamer.freedesktop.org/documentation/installing/for-ios-development.html?gi-language=c.).

So far I've managed to correctly link the library and successfully run the project in the Simulator, but when I try to create GStreamer elements it fails at runtime.

Here it is my .pro

#iOS
INCLUDEPATH += /Users/user/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework/Headers
LIBS += -F /Users/user/Library/Developer/GStreamer/iPhone.sdk -framework GStreamer

LIBS += -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib -liconv

QMAKE_IOS_DEPLOYMENT_TARGET = 12.0

#Universal target (iPhone and iPad)
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2

QMAKE_APPLE_DEVICE_ARCHS = arm64
QMAKE_APPLE_SIMULATOR_ARCHS = x86_64

And here it is where the application fails:

data.pipeline = gst_pipeline_new ("pipeline");
qDebug() << "pipeline" << data.pipeline;

data.udpsrc = gst_element_factory_make("udpsrc", NULL);
data.rtph264depay = gst_element_factory_make("rtph264depay", NULL);
data.avdec_h264 = gst_element_factory_make("avdec_h264", NULL);
data.videoconvert = gst_element_factory_make("videoconvert", NULL);
data.videoflip = gst_element_factory_make ("videoflip", NULL);

qDebug() << "udpsrc" << data.udpsrc;
qDebug() << "rtph264depay" << data.rtph264depay;
qDebug() << "avdec_h264" << data.avdec_h264;
qDebug() << "videoconvert" << data.videoconvert;
qDebug() << "videoflip" << data.videoflip;

All the calls to gst_element_factory_make return null.

Additional Info

  • Qt 5.15.2
  • Xcode 12.5
  • Develop on Big Sur

Any ideas?

Thanks


Solution

  • The problem was that the plugins (which udpsrc, rtph264depay, avdec_h264, etc. belong to) must be statically linked. Solution explained in https://forum.qt.io/topic/126746/gstreamer-on-ios