Interface BusFunc

All Superinterfaces:
FunctionPointer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @Generated("org.javagi.JavaGI") public interface BusFunc extends FunctionPointer

Functional interface declaration of the BusFunc callback.

See Also:
  • Method Details

    • run

      boolean run(Bus bus, Message message)

      Specifies the type of function passed to gst_bus_add_watch() or gst_bus_add_watch_full(), which is called from the mainloop when a message is available on the bus.

      The message passed to the function will be unreffed after execution of this function so it should not be freed in the function.

      Note that this function is used as a GSourceFunc which means that returning false will remove the GSource from the mainloop.

      Parameters:
      bus - the GstBus that sent the message
      message - the GstMessage
      Returns:
      false if the event source should be removed.
    • upcall

      default int upcall(MemorySegment bus, MemorySegment message, MemorySegment userData)
      The upcall method is called from native code. The parameters are marshaled and run(Bus, Message) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer