Best way to indicate loss of live camera signal

Allan Chandler allan.chandler at dti.com.au
Wed Nov 9 02:38:17 UTC 2016


Thanks for that.

> How do you detect signal loss currently? What exactly happens here? The RTSP connection shuts down? No more RTP packets for a long time?

Well, I don't detect it. My understanding was that data loss would show up as an event of some description such as the state changing from playing to paused, or a buffering < X% message. I may well be wrong in that assumption, hence my question.

> You'll have to create a new GMainContext, let the GMainLoop use that one and especially attach the GstBus watch to that very GMainContext. Then it should work like that.

I didn't think it was actually REQUIRED to have a separate context if you're running in another thread. From what I'd read, you can set up a different context if you want to separate your threads with different message pumps but I only have the one of my threads running GLib/Gst. Hence, I don't actually need the separation from my point of view. The GStreamer stuff was put into a separate thread so both Qt and it could run their own infinite message pumps, but there's only one GLib pump.

On the off-chance doing gst_init in one thread then everything else in another was causing a problem, I moved the init into the same thread. But no luck.

However, you MAY be right since it appears that all the code setting up the callback is working, it's just that the callback isn't being called, suggesting there may be a disconnect somewhere.

... suitable pause while I check, so I don't look stupid to the entire mailing list :-) ...

And it appears you ARE actually right.  When I set up a new context within the thread thusly (before any other actions):
    m_context = g_main_context_new();
    g_main_context_push_thread_default(m_context);
    m_mainLoop = g_main_loop_new(m_context, FALSE);
then the messages from the callback start to magically appear.

Now that I can see the messages coming in, I can do some analysis as to what ones appear when the camera feed disappears.

Much appreciation, Sebastian,
Cheers,
Al.



More information about the gstreamer-devel mailing list