pythia.utils.message_handlers#

Common gstreamer pipeline bus message handlers.

class pythia.utils.message_handlers.Stoppable(*args, **kwargs)[source]#

Bases: Protocol

Interface for classes whihc implement the stop method.

Mainly aimed at (but not restricted to) pythia apps.

_abc_impl = <_abc_data object>#
_is_protocol = True#
stop() None[source]#
pythia.utils.message_handlers.on_message_eos(self: Stoppable, bus: Bus, message: Message)[source]#

Stop application on EOS event.

Parameters:
  • self – A stoppable instance.

  • bus – The application’s pipeline’s bus.

  • message – The gstreamer state change message.

pythia.utils.message_handlers.on_message_error(self: Stoppable, bus: Bus, message: Message) Tuple[str, str][source]#

Stop application on error.

Parameters:
  • self – A stoppable instance.

  • bus – The application’s pipeline’s bus.

  • message – The gstreamer error message.

Returns:

Error and debug string.

pythia.utils.message_handlers.on_state_change(self: Stoppable, bus: Bus, message: Message)[source]#

Report application state changes.

Parameters:
  • self – A stoppable instance, in case an error arises.

  • bus – The application’s pipeline’s bus.

  • message – The gstreamer state change message.

Returns:

Old, new, and pending state