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