From: Philipp Spitzer Date: Thu, 9 Jul 2020 20:17:04 +0000 (+0200) Subject: Report error messages and EOS from gstreamer bus. X-Git-Url: https://git.toastfreeware.priv.at/toast/stream2beamer.git/commitdiff_plain/9dee09f8faf0d0b943131d2db5d9507d10b95dbb Report error messages and EOS from gstreamer bus. --- diff --git a/lagarde.py b/lagarde.py index 140ccd8..28cff73 100755 --- a/lagarde.py +++ b/lagarde.py @@ -102,12 +102,13 @@ class Lagarde: try: while True: if bus.have_pending(): - msg = bus.pop() # Gst.Message, has to be unref'ed. - if msg.type != Gst.MessageType.STATE_CHANGED: - # log.info(f'Receive Gst.Message: {msg.type}, {msg.seqnum}, {msg.get_structure()}') - # log.info(f'{webrtcbin.props.signaling_state} {webrtcbin.props.ice_gathering_state} {webrtcbin.props.ice_connection_state}') - # Gst.Message.unref(msg) - pass + msg = bus.pop() + if msg.type == Gst.MessageType.ERROR: + log.error(f'Error from gstreamer message bus: {msg.get_structure()}') + return + elif msg.type == Gst.MessageType.EOS: # end of stream + log.info(f'Gstreamer message bus reports end of stream') + return elif self.sdp_offer is not None: res, sm = GstSdp.SDPMessage.new() assert res == GstSdp.SDPResult.OK