Best way to indicate loss of live camera signal

Sebastian Dröge sebastian at centricular.com
Wed Nov 9 07:47:12 UTC 2016


On Wed, 2016-11-09 at 02:38 +0000, Allan Chandler wrote:
> 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.

It depends on what happens there. That can happen, it can also happen
that it just gets no media for a while and then you don't get any
error.

Look at the watchdog element for detecting that case.

> > 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.

Yes you can use the default main context, however that will cause
problems if you ever run with a Qt that is configured to use the GLib
main context for its event loop... as then you have Qt already running
a main loop on the default main context.

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

Great, good that it works now :)

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161109/38e38e3c/attachment.sig>


More information about the gstreamer-devel mailing list