GST-RTSP-Server + GST Pipelines (not in string/launch sintax)

Mariano Koremblum nicolas.koremblum at globant.com
Thu May 28 13:19:29 UTC 2020


I have found out that the RTSP server automatically handles the bus... You
can see it here, in the function "gst_rtsp_media_prepare":

https://github.com/alessandrod/gst-rtsp-server/blob/master/gst/rtsp-server/rtsp-media.c

It uses a function "bus_message" that then calls the
"default_handle_message" function. This last one can be overridden, so I did
then the following:

#define TEST_TYPE_RTSP_MEDIA (test_rtsp_media_get_type())

typedef struct TestRTSPMediaClass    TestRTSPMediaClass;
typedef struct TestRTSPMedia         TestRTSPMedia;

struct TestRTSPMediaClass
{
    GstRTSPMediaClass parent;
};

struct TestRTSPMedia
{
    GstRTSPMedia parent;
};

static gboolean custom_handle_message (GstRTSPMedia * media, GstMessage *
message);

G_DEFINE_TYPE(TestRTSPMedia, test_rtsp_media, GST_TYPE_RTSP_MEDIA);

static void
test_rtsp_media_class_init(TestRTSPMediaClass *test_klass)
{
    GstRTSPMediaClass *klass = (GstRTSPMediaClass *)(test_klass);
    klass->handle_message = custom_handle_message;
}

static void
test_rtsp_media_init(TestRTSPMedia *media)
{
}

The thing now is that I am not really sure which and how to set an object as
"TEST_TYPE_RTSP_MEDIA" as I did before with the factory (myFactory =
g_object_new(TEST_TYPE_RTSP_MEDIA_FACTORY, NULL)) in order to get the bus
handler function overriden but keeping the things working as before.

Another thing I tried doing was to remove the watcher an then add the one I
wanted (on the factory signal "media-configure") but couldn't do it, mainly
because it uses a "source" to attach the signal and I am not really sure how
to get it, I always ran into messages like:

GStreamer-CRITICAL **: 18:45:25.964: gst_element_get_bus: assertion
'GST_IS_ELEMENT (element)' failed

GStreamer-CRITICAL **: 18:45:25.964: gst_bus_remove_watch: assertion
'GST_IS_BUS (bus)' failed

or

GStreamer-CRITICAL **: 18:53:19.372: gst_bus_create_watch: assertion
'bus->priv->poll != NULL' failed

GLib-CRITICAL **: 18:53:19.372: g_source_set_callback: assertion 'source !=
NULL' failed

or

GStreamer-CRITICAL **: 18:45:25.964: gst_element_get_bus: assertion
'GST_IS_ELEMENT (element)' failed

GStreamer-CRITICAL **: 18:45:25.964: gst_bus_remove_watch: assertion
'GST_IS_BUS (bus)' failed

And never gets the watcher removed since I watched the debug logs and there
is always some entries on the "default_handle_message".

Sorry for the long post! I would really appreciate any help you can provide
me! Thanks a lot in advance! :)




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list