Class QueueArray

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

@Generated("org.javagi.JavaGI") @Deprecated public class QueueArray extends ProxyInstance
Deprecated.
Use GstVecDeque instead.
GstQueueArray is an object that provides standard queue functionality based on an array instead of linked lists. This reduces the overhead caused by memory management by a large factor.
  • Constructor Details

    • QueueArray

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

    • getMemoryLayout

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

      public static QueueArray new_(int initialSize)
      Deprecated.
      Allocates a new GstQueueArray object with an initial queue size of initialSize.
      Parameters:
      initialSize - Initial size of the new queue
      Returns:
      a new GstQueueArray object
      Since:
      1.2
    • newForStruct

      @Deprecated public static QueueArray newForStruct(long structSize, int initialSize)
      Deprecated.
      Use GstVecDeque instead.
      Allocates a new GstQueueArray object for elements (e.g. structures) of size structSize, with an initial queue size of initialSize.
      Parameters:
      structSize - Size of each element (e.g. structure) in the array
      initialSize - Initial size of the new queue
      Returns:
      a new GstQueueArray object
      Since:
      1.6
    • clear

      @Deprecated public void clear()
      Deprecated.
      Use GstVecDeque instead.
      Clears queue this QueueArray and frees all memory associated to it.
      Since:
      1.16
    • dropElement

      @Deprecated public @Nullable MemorySegment dropElement(int idx)
      Deprecated.
      Use GstVecDeque instead.
      Drops the queue element at position idx from queue array.
      Parameters:
      idx - index to drop
      Returns:
      the dropped element
      Since:
      1.2
    • dropStruct

      @Deprecated public boolean dropStruct(int idx, @Nullable MemorySegment pStruct)
      Deprecated.
      Use GstVecDeque instead.
      Drops the queue element at position idx from queue this QueueArray and copies the data of the element or structure that was removed into pStruct if pStruct is set (not NULL).
      Parameters:
      idx - index to drop
      pStruct - address into which to store the data of the dropped structure, or NULL
      Returns:
      TRUE on success, or FALSE on error
      Since:
      1.6
    • find

      @Deprecated public int find(@Nullable CompareFunc func)
      Deprecated.
      Use GstVecDeque instead.
      Finds an element in the queue array, either by comparing every element with func or by looking up data if no compare function func is provided, and returning the index of the found element.
      Parameters:
      func - comparison function, or null to find data by value
      Returns:
      Index of the found element or -1 if nothing was found.
      Since:
      1.2
    • free

      @Deprecated public void free()
      Deprecated.
      Use GstVecDeque instead.
      Frees queue this QueueArray and all memory associated to it.
      Since:
      1.2
    • getLength

      @Deprecated public int getLength()
      Deprecated.
      Use GstVecDeque instead.
      Returns the length of the queue this QueueArray
      Returns:
      the length of the queue array.
      Since:
      1.2
    • isEmpty

      @Deprecated public boolean isEmpty()
      Deprecated.
      Use GstVecDeque instead.
      Checks if the queue this QueueArray is empty.
      Returns:
      true if the queue this QueueArray is empty
      Since:
      1.2
    • peekHead

      @Deprecated public @Nullable MemorySegment peekHead()
      Deprecated.
      Use GstVecDeque instead.
      Returns the head of the queue this QueueArray and does not remove it from the queue.
      Returns:
      The head of the queue
      Since:
      1.2
    • peekHeadStruct

      @Deprecated public @Nullable MemorySegment peekHeadStruct()
      Deprecated.
      Use GstVecDeque instead.
      Returns the head of the queue this QueueArray without removing it from the queue.
      Returns:
      pointer to element or struct, or NULL if this QueueArray was empty. The data pointed to by the returned pointer stays valid only as long as the queue array is not modified further!
      Since:
      1.6
    • peekNth

      @Deprecated public @Nullable MemorySegment peekNth(int idx)
      Deprecated.
      Use GstVecDeque instead.
      Returns the item at idx in array, but does not remove it from the queue.
      Returns:
      The item, or null if idx was out of bounds
      Since:
      1.16
    • peekNthStruct

      @Deprecated public @Nullable MemorySegment peekNthStruct(int idx)
      Deprecated.
      Use GstVecDeque instead.
      Returns the item at idx in array, but does not remove it from the queue.
      Returns:
      The item, or null if idx was out of bounds
      Since:
      1.16
    • peekTail

      @Deprecated public @Nullable MemorySegment peekTail()
      Deprecated.
      Use GstVecDeque instead.
      Returns the tail of the queue array, but does not remove it from the queue.
      Returns:
      The tail of the queue
      Since:
      1.14
    • peekTailStruct

      @Deprecated public @Nullable MemorySegment peekTailStruct()
      Deprecated.
      Use GstVecDeque instead.
      Returns the tail of the queue array, but does not remove it from the queue.
      Returns:
      The tail of the queue
      Since:
      1.14
    • popHead

      @Deprecated public @Nullable MemorySegment popHead()
      Deprecated.
      Use GstVecDeque instead.
      Returns and head of the queue this QueueArray and removes it from the queue.
      Returns:
      The head of the queue
      Since:
      1.2
    • popHeadStruct

      @Deprecated public @Nullable MemorySegment popHeadStruct()
      Deprecated.
      Use GstVecDeque instead.
      Returns the head of the queue this QueueArray and removes it from the queue.
      Returns:
      pointer to element or struct, or NULL if this QueueArray was empty. The data pointed to by the returned pointer stays valid only as long as the queue array is not modified further!
      Since:
      1.6
    • popTail

      @Deprecated public @Nullable MemorySegment popTail()
      Deprecated.
      Use GstVecDeque instead.
      Returns the tail of the queue this QueueArray and removes it from the queue.
      Returns:
      The tail of the queue
      Since:
      1.14
    • popTailStruct

      @Deprecated public @Nullable MemorySegment popTailStruct()
      Deprecated.
      Use GstVecDeque instead.
      Returns the tail of the queue this QueueArray and removes it from the queue.
      Returns:
      The tail of the queue
      Since:
      1.14
    • pushSorted

      @Deprecated public void pushSorted(@Nullable MemorySegment data, @Nullable CompareDataFunc func)
      Deprecated.
      Use GstVecDeque instead.

      Pushes data to the queue array, finding the correct position by comparing data with each array element using func.

      This has a time complexity of O(n), so depending on the size of the queue and expected access patterns, a different data structure might be better.

      Assumes that the array is already sorted. If it is not, make sure to call gst_queue_array_sort() first.

      Parameters:
      data - object to push
      func - comparison function
      Since:
      1.24
    • pushSortedStruct

      @Deprecated public void pushSortedStruct(@Nullable MemorySegment pStruct, @Nullable CompareDataFunc func)
      Deprecated.
      Use GstVecDeque instead.

      Pushes the element at address pStruct into the queue this QueueArray (copying the contents of a structure of the struct_size specified when creating the queue into the array), finding the correct position by comparing the element at pStruct with each element in the array using func.

      This has a time complexity of O(n), so depending on the size of the queue and expected access patterns, a different data structure might be better.

      Assumes that the array is already sorted. If it is not, make sure to call gst_queue_array_sort() first.

      Parameters:
      pStruct - address of element or structure to push into the queue
      func - comparison function
      Since:
      1.24
    • pushTail

      @Deprecated public void pushTail(@Nullable MemorySegment data)
      Deprecated.
      Use GstVecDeque instead.
      Pushes data to the tail of the queue array.
      Parameters:
      data - object to push
      Since:
      1.2
    • pushTailStruct

      public void pushTailStruct(@Nullable MemorySegment pStruct)
      Deprecated.
    • setClearFunc

      @Deprecated public void setClearFunc()
      Deprecated.
      Use GstVecDeque instead.

      Sets a function to clear an element of array.

      The clearFunc will be called when an element in the array data segment is removed and when the array is freed and data segment is deallocated as well. clearFunc will be passed a pointer to the element to clear, rather than the element itself.

      Note that in contrast with other uses of GDestroyNotify functions, clearFunc is expected to clear the contents of the array element it is given, but not free the element itself.

      Since:
      1.16
    • sort

      @Deprecated public void sort(@Nullable CompareDataFunc compareFunc)
      Deprecated.
      Use GstVecDeque instead.
      Sorts the queue this QueueArray by comparing elements against each other using the provided compareFunc.
      Parameters:
      compareFunc - comparison function
      Since:
      1.24