Interface AppSink.PullSampleCallback

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

@FunctionalInterface public static interface AppSink.PullSampleCallback extends FunctionPointer

Functional interface declaration of the PullSampleCallback callback.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    run()
    This function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state.
    Creates a native function pointer to the upcall(MemorySegment) method.
    upcall(MemorySegment sourceAppSink)
    The upcall method is called from native code.
  • Method Details

    • run

      Sample run()

      This function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state.

      This function will only return samples when the appsink is in the PLAYING state. All rendered samples will be put in a queue so that the application can pull samples at its own rate.

      Note that when the application does not pull samples fast enough, the queued samples could consume a lot of memory, especially when dealing with raw video frames. It's possible to control the behaviour of the queue with the "drop" and "max-buffers" / "max-bytes" / "max-time" set of properties.

      If an EOS event was received before any buffers, this function returns null. Use gst_app_sink_is_eos () to check for the EOS condition.

    • upcall

      default MemorySegment upcall(MemorySegment sourceAppSink)
      The upcall method is called from native code. The parameters are marshaled and run() is executed.
    • toCallback

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