Interface MetaSerializeFunction

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

Functional interface declaration of the MetaSerializeFunction callback.

See Also:
  • Method Details

    • run

      boolean run(Meta meta, ByteArrayInterface data, Out<Byte> version)

      Serialize meta into a format that can be stored or transmitted and later deserialized by GstMetaDeserializeFunction.

      By default version is set to 0, it should be bumped if incompatible changes are made to the format so GstMetaDeserializeFunction can deserialize each version.

      Parameters:
      meta - a GstMeta
      data - GstByteArrayInterface to append serialization data
      version - version of the serialization format
      Returns:
      true on success, false otherwise.
      Since:
      1.24
    • upcall

      default int upcall(MemorySegment meta, MemorySegment data, MemorySegment version)
      The upcall method is called from native code. The parameters are marshaled and run(Meta, ByteArrayInterface, Out) 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