gstreamerqtgstreamer

QtGstreamer & g_signal_connect


i need to use a typefind element with my qt-gstreamer application.

The specific Qt element binding seems to be missing so the question: shall i use g_signal_connect even with qt-gstreamer in this case? How?

I'm a beginner with gt-gstreamer and i still don't see clearly how g_signal_connect is implemented in Qt style or how to use them together.

This is the code written in C:

filesrc = g_str_has_prefix(argv[1], "http://") || g_str_has_prefix(argv[1], "https://")? gst_element_factory_make ("souphttpsrc", "source") : gst_element_factory_make ("filesrc", "source");
g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
typefind = gst_element_factory_make ("typefind", "typefinder");
g_signal_connect (typefind, "have-type", G_CALLBACK (cb_typefound), loop);
fakesink = gst_element_factory_make ("fakesink", "sink");

Thanks!


Solution

  • Just for others, tt's pretty straightforward:

    g_signal_connect((GstElement*) pipeline->getElementByName("typedef"), "have-type", G_CALLBACK(&MyClass::typefoundCB), this);
    

    Regards