Class: GstBase::DataQueue

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initialize(checkfull, fullcallback, emptycallback, checkdata) ⇒ GstBase::DataQueue

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

Parameters:

  • checkfull (GstBase::DataQueueCheckFullFunction)

    the callback used to tell if the element considers the queue full

  • fullcallback (GstBase::DataQueueFullCallback)

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

  • emptycallback (GstBase::DataQueueEmptyCallback)

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

  • checkdata (GObject)

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

Instance Method Details

#current_level_bytesInteger

Returns current-level-bytes.

Returns:

  • (Integer)

    current-level-bytes

#current_level_bytes=(current_level_bytes) ⇒ Integer

Parameters:

  • current_level_bytes (Integer)

Returns:

  • (Integer)

    current-level-bytes

  • (Integer)

    current-level-bytes

#current_level_timeInteger

Returns current-level-time.

Returns:

  • (Integer)

    current-level-time

#current_level_time=(current_level_time) ⇒ Integer

Parameters:

  • current_level_time (Integer)

Returns:

  • (Integer)

    current-level-time

  • (Integer)

    current-level-time

#current_level_visibleInteger

Returns current-level-visible.

Returns:

  • (Integer)

    current-level-visible

#current_level_visible=(current_level_visible) ⇒ Integer

Parameters:

  • current_level_visible (Integer)

Returns:

  • (Integer)

    current-level-visible

  • (Integer)

    current-level-visible

#drop_head(type) ⇒ Boolean

Pop and unref the head-most Gst::MiniObject with the given #GType.

Parameters:

  • type (GLib::Type)

    The #GType of the item to drop.

Returns:

  • (Boolean)

    true if an element was removed.

#flushnil

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

Returns:

  • (nil)

#flushing=(flushing) ⇒ nil

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:

  • flushing (Boolean)

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

Returns:

  • (nil)

#get_level(level) ⇒ nil

Get the current level of the queue.

Parameters:

  • level (GstBase::DataQueueSize)

    the location to store the result

Returns:

  • (nil)

#is_emptyBoolean

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

Returns:

  • (Boolean)

    true if queue is empty.

#is_fullBoolean

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

Returns:

  • (Boolean)

    true if queue is full.

#limits_changednil

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.

Returns:

  • (nil)

#peek(item) ⇒ Boolean

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:

  • item (GstBase::DataQueueItem)

    pointer to store the returned Gst::DataQueueItem.

Returns:

  • (Boolean)

    true if an item was successfully retrieved from the queue.

#pop(item) ⇒ Boolean

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:

  • item (GstBase::DataQueueItem)

    pointer to store the returned Gst::DataQueueItem.

Returns:

  • (Boolean)

    true if an item was successfully retrieved from the queue.

#push(item) ⇒ Boolean

Pushes a Gst::DataQueueItem (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 Gst::MiniObject contained in item if the push was successful. If false is returned, the caller is responsible for freeing item and its contents.

Parameters:

  • item (GstBase::DataQueueItem)

    a Gst::DataQueueItem.

Returns:

  • (Boolean)

    true if the item was successfully pushed on the queue.

#push_force(item) ⇒ Boolean

Pushes a Gst::DataQueueItem (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 Gst::MiniObject contained in item if the push was successful. If false is returned, the caller is responsible for freeing item and its contents.

Parameters:

  • item (GstBase::DataQueueItem)

    a Gst::DataQueueItem.

Returns:

  • (Boolean)

    true if the item was successfully pushed on the queue.