# GstDataQueue

GstDataQueue is an object that handles threadsafe queueing of objects. It also provides size-related functionality. This object should be used for any GstElement that wishes to provide some sort of queueing functionality.

## GstDataQueue

    GObject
        ╰──GstDataQueue

Opaque GstDataQueue structure.

### Members

`object` (GObject) –

the parent structure

### Class structure

#### GstDataQueueClass

##### Fields

`parent_class` (GObjectClass) –
No description available
`_gst_reserved` (gpointer *) –
No description available

### GstBase.DataQueueClass

##### Attributes

`parent_class` (GObject.ObjectClass) –
No description available
`_gst_reserved` ([ Object ]) –
No description available

### GstBase.DataQueueClass

##### Attributes

`parent_class` (GObject.ObjectClass) –
No description available
`_gst_reserved` ([ object ]) –
No description available

## GstBase.DataQueue

    GObject.Object
        ╰──GstBase.DataQueue

Opaque GstBase.DataQueue structure.

### Members

`object` (GObject.Object) –

the parent structure

## GstBase.DataQueue

    GObject.Object
        ╰──GstBase.DataQueue

Opaque GstBase.DataQueue structure.

### Members

`object` (GObject.Object) –

the parent structure

### Constructors

#### gst_data_queue_new

    GstDataQueue *
    gst_data_queue_new (GstDataQueueCheckFullFunction checkfull,
                        GstDataQueueFullCallback fullcallback,
                        GstDataQueueEmptyCallback emptycallback,
                        gpointer checkdata)

Creates a new GstDataQueue. If fullcallback or emptycallback are supplied, then the GstDataQueue will call the respective callback to signal full or empty condition. If the callbacks are NULL the GstDataQueue will instead emit 'full' and 'empty' signals.

Parameters:

`checkfull` –

the callback used to tell if the element considers the queue full or not.

`fullcallback` –

the callback which will be called when the queue is considered full.

`emptycallback` –

the callback which will be called when the queue is considered empty.

`checkdata` –

a gpointer that will be passed to the checkfull, fullcallback, and emptycallback callbacks.

Returns –

a new GstDataQueue.

Since : 1.2

### Methods

#### gst_data_queue_drop_head

    gboolean
    gst_data_queue_drop_head (GstDataQueue * queue,
                              GType type)

Pop and unref the head-most GstMiniObject with the given GType.

Parameters:

`queue` –

The GstDataQueue to drop an item from.

`type` –

The GType of the item to drop.

Returns –

TRUE if an element was removed.

Since : 1.2

#### gst_data_queue_flush

    gst_data_queue_flush (GstDataQueue * queue)

Flushes all the contents of the queue. Any call to gst_data_queue_push and gst_data_queue_pop will be released. MT safe.

Parameters:

`queue` –

a GstDataQueue.

Since : 1.2

#### gst_data_queue_get_level

    gst_data_queue_get_level (GstDataQueue * queue,
                              GstDataQueueSize * level)

Get the current level of the queue.

Parameters:

`queue` –

The GstDataQueue

`level` ( [out]) –

the location to store the result

Since : 1.2

#### gst_data_queue_is_empty

    gboolean
    gst_data_queue_is_empty (GstDataQueue * queue)

Queries if there are any items in the queue. MT safe.

Parameters:

`queue` –

a GstDataQueue.

Returns –

TRUE if queue is empty.

Since : 1.2

#### gst_data_queue_is_full

    gboolean
    gst_data_queue_is_full (GstDataQueue * queue)

Queries if queue is full. This check will be done using the GstDataQueueCheckFullFunction registered with queue. MT safe.

Parameters:

`queue` –

a GstDataQueue.

Returns –

TRUE if queue is full.

Since : 1.2

#### gst_data_queue_limits_changed

    gst_data_queue_limits_changed (GstDataQueue * queue)

Inform the queue that the limits for the fullness check have changed and that any blocking gst_data_queue_push should be unblocked to recheck the limits.

Parameters:

`queue` –

The GstDataQueue

Since : 1.2

#### gst_data_queue_peek

    gboolean
    gst_data_queue_peek (GstDataQueue * queue,
                         GstDataQueueItem ** item)

Retrieves the first item available on the queue without removing it. If the queue is currently empty, the call will block until at least one item is available, OR the queue is set to the flushing state. MT safe.

Parameters:

`queue` –

a GstDataQueue.

`item` ( [out]) –

pointer to store the returned GstDataQueueItem.

Returns –

TRUE if an item was successfully retrieved from the queue.

Since : 1.2

#### gst_data_queue_pop

    gboolean
    gst_data_queue_pop (GstDataQueue * queue,
                        GstDataQueueItem ** item)

Retrieves the first item available on the queue. If the queue is currently empty, the call will block until at least one item is available, OR the queue is set to the flushing state. MT safe.

Parameters:

`queue` –

a GstDataQueue.

`item` ( [out]) –

pointer to store the returned GstDataQueueItem.

Returns –

TRUE if an item was successfully retrieved from the queue.

Since : 1.2

#### gst_data_queue_push

    gboolean
    gst_data_queue_push (GstDataQueue * queue,
                         GstDataQueueItem * item)

Pushes a GstDataQueueItem (or a structure that begins with the same fields) on the queue. If the queue is full, the call will block until space is available, OR the queue is set to flushing state. MT safe.

Note that this function has slightly different semantics than gst_pad_push and gst_pad_push_event: this function only takes ownership of item and the GstMiniObject contained in item if the push was successful. If FALSE is returned, the caller is responsible for freeing item and its contents.

Parameters:

`queue` –

a GstDataQueue.

`item` –

a GstDataQueueItem.

Returns –

TRUE if the item was successfully pushed on the queue.

Since : 1.2

#### gst_data_queue_push_force

    gboolean
    gst_data_queue_push_force (GstDataQueue * queue,
                               GstDataQueueItem * item)

Pushes a GstDataQueueItem (or a structure that begins with the same fields) on the queue. It ignores if the queue is full or not and forces the item to be pushed anyway. MT safe.

Note that this function has slightly different semantics than gst_pad_push and gst_pad_push_event: this function only takes ownership of item and the GstMiniObject contained in item if the push was successful. If FALSE is returned, the caller is responsible for freeing item and its contents.

Parameters:

`queue` –

a GstDataQueue.

`item` –

a GstDataQueueItem.

Returns –

TRUE if the item was successfully pushed on the queue.

Since : 1.2

#### gst_data_queue_set_flushing

    gst_data_queue_set_flushing (GstDataQueue * queue,
                                 gboolean flushing)

Sets the queue to flushing state if flushing is TRUE. If set to flushing state, any incoming data on the queue will be discarded. Any call currently blocking on gst_data_queue_push or gst_data_queue_pop will return straight away with a return value of FALSE. While the queue is in flushing state, all calls to those two functions will return FALSE.

MT Safe.

Parameters:

`queue` –

a GstDataQueue.

`flushing` –

a gboolean stating if the queue will be flushing or not.

Since : 1.2

### Signals

#### empty

    empty_callback (GstDataQueue * self,
                    gpointer user_data)

Reports that the queue became empty (empty). A queue is empty if the total amount of visible items inside it (num-visible, time, size) is lower than the boundary values which can be set through the GObject properties.

Parameters:

`self` –
No description available
`user_data` –
No description available

Flags: Run First

#### full

    full_callback (GstDataQueue * self,
                   gpointer user_data)

Reports that the queue became full (full). A queue is full if the total amount of data inside it (num-visible, time, size) is higher than the boundary values which can be set through the GObject properties.

Parameters:

`self` –
No description available
`user_data` –
No description available

Flags: Run First

### Properties

#### current-level-bytes

    “current-level-bytes” guint

Flags : Read

#### current-level-bytes

    “current-level-bytes” Number

Flags : Read

#### current_level_bytes

    “self.props.current_level_bytes” int

Flags : Read

#### current-level-time

    “current-level-time” guint64

Flags : Read

#### current-level-time

    “current-level-time” Number

Flags : Read

#### current_level_time

    “self.props.current_level_time” int

Flags : Read

#### current-level-visible

    “current-level-visible” guint

Flags : Read

#### current-level-visible

    “current-level-visible” Number

Flags : Read

#### current_level_visible

    “self.props.current_level_visible” int

Flags : Read

### Virtual Methods

#### empty

    empty (GstDataQueue * queue)

Parameters:

`queue` –
No description available

#### vfunc_empty

    function vfunc_empty(queue: GstBase.DataQueue): {
        // javascript implementation of the 'empty' virtual method
    }

Parameters:

`queue` (GstBase.DataQueue) –
No description available

#### do_empty

    def do_empty (queue):
        #python implementation of the 'empty' virtual method

Parameters:

`queue` (GstBase.DataQueue) –
No description available

#### full

    full (GstDataQueue * queue)

Parameters:

`queue` –
No description available

#### vfunc_full

    function vfunc_full(queue: GstBase.DataQueue): {
        // javascript implementation of the 'full' virtual method
    }

Parameters:

`queue` (GstBase.DataQueue) –
No description available

#### do_full

    def do_full (queue):
        #python implementation of the 'full' virtual method

Parameters:

`queue` (GstBase.DataQueue) –
No description available

## GstDataQueueItem

Structure used by GstDataQueue. You can supply a different structure, as long as the top of the structure is identical to this structure.

### Members

`object` (GstMiniObject *) –

the GstMiniObject to queue.

`size` (guint) –

the size in bytes of the miniobject.

`duration` (guint64) –

the duration in GstClockTime of the miniobject. Can not be GST_CLOCK_TIME_NONE.

`visible` (gboolean) –

TRUE if object should be considered as a visible object.

`destroy` (GDestroyNotify) –

The GDestroyNotify function to use to free the GstDataQueueItem. This function should also drop the reference to object the owner of the GstDataQueueItem is assumed to hold.

## GstDataQueueSize

Structure describing the size of a queue.

### Members

`visible` (guint) –

number of buffers

`bytes` (guint) –

number of bytes

`time` (guint64) –

amount of time

## Constants

### GST_TYPE_DATA_QUEUE

    #define GST_TYPE_DATA_QUEUE \
      (gst_data_queue_get_type())

## Callbacks

### GstDataQueueCheckFullFunction

    gboolean
    (*GstDataQueueCheckFullFunction) (GstDataQueue * queue,
                                      guint visible,
                                      guint bytes,
                                      guint64 time,
                                      gpointer checkdata)

The prototype of the function used to inform the queue that it should be considered as full.

Parameters:

`queue` –

a GstDataQueue.

`visible` –

The number of visible items currently in the queue.

`bytes` –

The amount of bytes currently in the queue.

`time` –

The accumulated duration of the items currently in the queue.

`checkdata` –

The gpointer registered when the GstDataQueue was created.

Returns –

TRUE if the queue should be considered full.

### GstDataQueueEmptyCallback

    (*GstDataQueueEmptyCallback) (GstDataQueue * queue,
                                  gpointer checkdata)

Parameters:

`queue` –
No description available
`checkdata` –
No description available

### GstBase.DataQueueEmptyCallback

    function GstBase.DataQueueEmptyCallback(queue: GstBase.DataQueue, checkdata: Object): {
        // javascript wrapper for 'GstDataQueueEmptyCallback'
    }

Parameters:

`queue` (GstBase.DataQueue) –
No description available
`checkdata` (Object) –
No description available

### GstBase.DataQueueEmptyCallback

    def GstBase.DataQueueEmptyCallback (queue, checkdata):
        #python wrapper for 'GstDataQueueEmptyCallback'

Parameters:

`queue` (GstBase.DataQueue) –
No description available
`checkdata` (object) –
No description available

### GstDataQueueFullCallback

    (*GstDataQueueFullCallback) (GstDataQueue * queue,
                                 gpointer checkdata)

Parameters:

`queue` –
No description available
`checkdata` –
No description available

### GstBase.DataQueueFullCallback

    function GstBase.DataQueueFullCallback(queue: GstBase.DataQueue, checkdata: Object): {
        // javascript wrapper for 'GstDataQueueFullCallback'
    }

Parameters:

`queue` (GstBase.DataQueue) –
No description available
`checkdata` (Object) –
No description available

### GstBase.DataQueueFullCallback

    def GstBase.DataQueueFullCallback (queue, checkdata):
        #python wrapper for 'GstDataQueueFullCallback'

Parameters:

`queue` (GstBase.DataQueue) –
No description available
`checkdata` (object) –
No description available

The results of the search are