Class AtomicQueue

java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.gst.AtomicQueue
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class AtomicQueue extends ProxyInstance
The GstAtomicQueue object implements a queue that can be used from multiple threads without performing any blocking operations.
  • Constructor Details

    • AtomicQueue

      public AtomicQueue(MemorySegment address)
      Create a AtomicQueue proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • AtomicQueue

      public AtomicQueue(int initialSize)
      Create a new atomic queue instance. initialSize will be rounded up to the nearest power of 2 and used as the initial size of the queue.
      Parameters:
      initialSize - initial queue size
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the AtomicQueue class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • length

      public int length()
      Get the amount of items in the queue.
      Returns:
      the number of elements in the queue.
    • peek

      public @Nullable MemorySegment peek()
      Peek the head element of the queue without removing it from the queue.
      Returns:
      the head element of this AtomicQueue or null when the queue is empty.
    • pop

      public @Nullable MemorySegment pop()
      Get the head element of the queue.
      Returns:
      the head element of this AtomicQueue or null when the queue is empty.
    • push

      public void push(@Nullable MemorySegment data)
      Append data to the tail of the queue.
      Parameters:
      data - the data
    • ref

      public void ref()
      Increase the refcount of queue.
    • unref

      public void unref()
      Unref this AtomicQueue and free the memory when the refcount reaches 0.