Interface AppSink.TryPullSampleCallback

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.TryPullSampleCallback extends FunctionPointer

Functional interface declaration of the TryPullSampleCallback callback.

See Also:
  • Method Summary

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

    • run

      Sample run(long timeout)

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

      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 or the timeout expires, this function returns null. Use gst_app_sink_is_eos () to check for the EOS condition.

      Since:
      1.10
    • upcall

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

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