Interface MainFunc

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 MainFunc extends FunctionPointer

Functional interface declaration of the MainFunc callback.

See Also:
  • Method Details

    • run

      int run(@Nullable String @Nullable [] argv)
      Represents a simple pointer to the main() function of a program. It is used to pass that function along with its arguments to gst_macos_main(), which ensures correct behaviour of various GStreamer elements (e.g glimagesink) on macOS.
      Parameters:
      argv - an array of arguments passed to the main function
    • upcall

      default int upcall(int argc, MemorySegment argv, MemorySegment userData)
      The upcall method is called from native code. The parameters are marshaled and run(String[]) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(int, 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