code: def _on_message_cb(self, bus, message):
      t = message.type
      if t == Gst.MessageType.EOS:
          self.end_cond.acquire()
          if self.streaming:
              self._streaming_queue.put(Gst.MessageType.EOS)
  
          self.pipeline.set_state(Gst.State.NULL)
          self.mainloop.quit()
          self.end_reached = True
          self.end_cond.notify()
          self.end_cond.release()
  
      elif t == Gst.MessageType.ERROR:
          self.end_cond.acquire()
          self.pipeline.set_state(Gst.State.NULL)
          self.mainloop.quit()
          self.end_reached = True
          err, debug = message.parse_error()
          self.error_msg = "Error: %s" % err, debug
          self.end_cond.notify()
          self.end_cond.release()
  
file_path: TimeSide/timeside/core/encoder.py
imports: from timeside.core import Processor, implements, interfacedoc, abstract
  from timeside.core.api import IEncoder
  from .tools.gstutils import numpy_array_to_gst_buffer, MainloopThread
  import gi
  from gi.repository import GLib, Gst
  import threading
label_desc: Use image node_id 5 for calling the GstEncoder obj's underlying member method code with example usage: obj._on_message_cb(bus, message) without return types