aggregator: Assert if the sink/src pad type that is to be used is not a GstAggregator...
[platform/upstream/gstreamer.git] / libs / gst / base / gstdataqueue.c
index 0e57794..d6479bb 100644 (file)
 
 /**
  * SECTION:gstdataqueue
+ * @title: GstDataQueue
  * @short_description: Threadsafe queueing object
  *
  * #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.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <gst/gst.h>
 #include "string.h"
@@ -128,21 +132,20 @@ static guint gst_data_queue_signals[LAST_SIGNAL] = { 0 };
 }
 
 #define parent_class gst_data_queue_parent_class
-G_DEFINE_TYPE_WITH_CODE (GstDataQueue, gst_data_queue, G_TYPE_OBJECT, _do_init);
+G_DEFINE_TYPE_WITH_CODE (GstDataQueue, gst_data_queue, G_TYPE_OBJECT,
+    G_ADD_PRIVATE (GstDataQueue) _do_init);
 
 static void
 gst_data_queue_class_init (GstDataQueueClass * klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-  g_type_class_add_private (klass, sizeof (GstDataQueuePrivate));
-
   gobject_class->set_property = gst_data_queue_set_property;
   gobject_class->get_property = gst_data_queue_get_property;
 
   /* signals */
   /**
-   * GstDataQueue::empty:
+   * GstDataQueue::empty: (skip)
    * @queue: the queue instance
    *
    * Reports that the queue became empty (empty).
@@ -156,7 +159,7 @@ gst_data_queue_class_init (GstDataQueueClass * klass)
       g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
 
   /**
-   * GstDataQueue::full:
+   * GstDataQueue::full: (skip)
    * @queue: the queue instance
    *
    * Reports that the queue became full (full).
@@ -190,9 +193,7 @@ gst_data_queue_class_init (GstDataQueueClass * klass)
 static void
 gst_data_queue_init (GstDataQueue * queue)
 {
-  queue->priv =
-      G_TYPE_INSTANCE_GET_PRIVATE (queue, GST_TYPE_DATA_QUEUE,
-      GstDataQueuePrivate);
+  queue->priv = gst_data_queue_get_instance_private (queue);
 
   queue->priv->cur_level.visible = 0;   /* no content */
   queue->priv->cur_level.bytes = 0;     /* no content */
@@ -214,11 +215,13 @@ gst_data_queue_init (GstDataQueue * queue)
  * 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 given in the @checkfull callback.
+ * @checkdata: a #gpointer that will be passed to the @checkfull, @fullcallback,
+ *   and @emptycallback callbacks.
  *
- * Creates a new #GstDataQueue. The difference with @gst_data_queue_new is that it will
- * not emit the 'full' and 'empty' signals, but instead calling directly @fullcallback
- * or @emptycallback.
+ * 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.
  *
  * Returns: a new #GstDataQueue.
  *
@@ -233,7 +236,7 @@ gst_data_queue_new (GstDataQueueCheckFullFunction checkfull,
 
   g_return_val_if_fail (checkfull != NULL, NULL);
 
-  ret = g_object_newv (GST_TYPE_DATA_QUEUE, 0, NULL);
+  ret = g_object_new (GST_TYPE_DATA_QUEUE, NULL);
   ret->priv->checkfull = checkfull;
   ret->priv->checkdata = checkdata;
   ret->priv->fullcallback = fullcallback;
@@ -311,7 +314,7 @@ gst_data_queue_locked_is_full (GstDataQueue * queue)
 }
 
 /**
- * gst_data_queue_flush:
+ * gst_data_queue_flush: (skip)
  * @queue: a #GstDataQueue.
  *
  * Flushes all the contents of the @queue. Any call to #gst_data_queue_push and
@@ -330,7 +333,7 @@ gst_data_queue_flush (GstDataQueue * queue)
 }
 
 /**
- * gst_data_queue_is_empty:
+ * gst_data_queue_is_empty: (skip)
  * @queue: a #GstDataQueue.
  *
  * Queries if there are any items in the @queue.
@@ -353,7 +356,7 @@ gst_data_queue_is_empty (GstDataQueue * queue)
 }
 
 /**
- * gst_data_queue_is_full:
+ * gst_data_queue_is_full: (skip)
  * @queue: a #GstDataQueue.
  *
  * Queries if @queue is full. This check will be done using the
@@ -377,14 +380,14 @@ gst_data_queue_is_full (GstDataQueue * queue)
 }
 
 /**
- * gst_data_queue_set_flushing:
+ * gst_data_queue_set_flushing: (skip)
  * @queue: a #GstDataQueue.
  * @flushing: a #gboolean stating if the queue will be flushing or not.
  *
  * 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, 
+ * 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.
@@ -425,7 +428,7 @@ gst_data_queue_push_force_unlocked (GstDataQueue * queue,
 }
 
 /**
- * gst_data_queue_push_force:
+ * gst_data_queue_push_force: (skip)
  * @queue: a #GstDataQueue.
  * @item: a #GstDataQueueItem.
  *
@@ -473,7 +476,7 @@ flushing:
 }
 
 /**
- * gst_data_queue_push:
+ * gst_data_queue_push: (skip)
  * @queue: a #GstDataQueue.
  * @item: a #GstDataQueueItem.
  *
@@ -557,9 +560,9 @@ _gst_data_queue_wait_non_empty (GstDataQueue * queue)
 }
 
 /**
- * gst_data_queue_pop:
+ * gst_data_queue_pop: (skip)
  * @queue: a #GstDataQueue.
- * @item: pointer to store the returned #GstDataQueueItem.
+ * @item: (out): pointer to store the returned #GstDataQueueItem.
  *
  * 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
@@ -627,9 +630,9 @@ is_of_type (gconstpointer a, gconstpointer b)
 }
 
 /**
- * gst_data_queue_peek:
+ * gst_data_queue_peek: (skip)
  * @queue: a #GstDataQueue.
- * @item: pointer to store the returned #GstDataQueueItem.
+ * @item: (out): pointer to store the returned #GstDataQueueItem.
  *
  * Retrieves the first @item available on the @queue without removing it.
  * If the queue is currently empty, the call will block until at least
@@ -682,7 +685,7 @@ flushing:
 }
 
 /**
- * gst_data_queue_drop_head:
+ * gst_data_queue_drop_head: (skip)
  * @queue: The #GstDataQueue to drop an item from.
  * @type: The #GType of the item to drop.
  *
@@ -730,7 +733,7 @@ done:
 }
 
 /**
- * gst_data_queue_limits_changed:
+ * gst_data_queue_limits_changed: (skip)
  * @queue: The #GstDataQueue
  *
  * Inform the queue that the limits for the fullness check have changed and that
@@ -754,9 +757,9 @@ gst_data_queue_limits_changed (GstDataQueue * queue)
 }
 
 /**
- * gst_data_queue_get_level:
+ * gst_data_queue_get_level: (skip)
  * @queue: The #GstDataQueue
- * @level: the location to store the result
+ * @level: (out): the location to store the result
  *
  * Get the current level of the queue.
  *