Hi all,
I'm working on simple rtsp server using the "gst-rtsp-server" library.
I would like to retrieve media events like "start playing", "stop playing", etc etc etc.
I my main() just before the g_main_loop_run(loop) call, i put the following calls :
g_signal_connect (G_OBJECT (factory), "media-configure", G_CALLBACK (callback_media_configured), NULL);
with the following callback :
void
callback_media_configured(GstRTSPMediaFactory *factory, GstRTSPMedia *media, gpointer *userdata)
{
fprintf(stderr, "media ptr:%p\n", media); // returns a coherent value
fprintf(stderr, "media element ptr:%p\n", media->element); // returns NULL value ?!?!
g_signal_connect (G_OBJECT (media), "new-state", G_CALLBACK (callback_media_new_state), NULL);
}
void
callback_media_new_state(GstRTSPMedia *media, gpointer *ptr, int state)
{
// Returns inconsistent state value ?!?!
fprintf(stderr, "New state (%d) : %s\n", media, state, gst_element_state_get_name(state));
}
I added some debug info just before the "g_signal_emit" call in the gst_rtsp_library to compare values and they are good.
So it seems there is a problem/bug with signals but I have no idea...
--
www.psykokwak.com