const auto bus = gst_pipeline_get_bus( GST_PIPELINE ( pipeline ) );
gst_bus_add_signal_watch( bus );
g_signal_connect( bus, "message", G_CALLBACK( &MyClient::onBusError ), this );
is used in two RTSP streaming apps on Yocto and Ubuntu. The app on Ubuntu displays the error messages. But the app on Yocto does not catch the error messages although the error messages are displayed on the screen. Is any plugin missing or any flags are needed? What causes this issue? Any help is appreciated.
Do you use Qt by any chance? Using the bus watches requires using a GLib main loop (and in this case on the default main context). Ubuntu’s Qt is compiled with GLib support (which runs a GLib main loop by default then), while on Yocto you need to enable that yourself when compiling Qt.
The alternative would be to not use the bus watches but any of the other many ways to get bus messages.
Thank for your reply, Sebastian. True that this is a Qt app. However, Qt is from Yocto distribution and not compiled by myself. I am not sure if it is enabled or not. I will check it out.
You could integrate it with the Qt event loop via the bus’s sync handler, or by making use of the fd the bus can provide for whenever a message is available (it becomes readable then).