docs: convert NULL, TRUE, and FALSE to %NULL, %TRUE, and %FALSE
[platform/upstream/gstreamer.git] / gst / gsttaskpool.c
index e17af0b..d7ff344 100644 (file)
@@ -15,8 +15,8 @@
  *
  * You should have received a copy of the GNU Library General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 /**
@@ -28,8 +28,6 @@
  * implementation uses a regular GThreadPool to start tasks.
  *
  * Subclasses can be made to create custom threads.
- *
- * Last reviewed on 2009-04-23 (0.10.24)
  */
 
 #include "gst_private.h"
@@ -40,9 +38,9 @@
 GST_DEBUG_CATEGORY_STATIC (taskpool_debug);
 #define GST_CAT_DEFAULT (taskpool_debug)
 
-static void gst_task_pool_class_init (GstTaskPoolClass * klass);
-static void gst_task_pool_init (GstTaskPool * pool);
+#ifndef GST_DISABLE_GST_DEBUG
 static void gst_task_pool_finalize (GObject * object);
+#endif
 
 #define _do_init \
 { \
@@ -128,7 +126,9 @@ gst_task_pool_class_init (GstTaskPoolClass * klass)
   gobject_class = (GObjectClass *) klass;
   gsttaskpool_class = (GstTaskPoolClass *) klass;
 
-  gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_task_pool_finalize);
+#ifndef GST_DISABLE_GST_DEBUG
+  gobject_class->finalize = gst_task_pool_finalize;
+#endif
 
   gsttaskpool_class->prepare = default_prepare;
   gsttaskpool_class->cleanup = default_cleanup;
@@ -139,32 +139,33 @@ gst_task_pool_class_init (GstTaskPoolClass * klass)
 static void
 gst_task_pool_init (GstTaskPool * pool)
 {
+  /* clear floating flag */
+  gst_object_ref_sink (pool);
 }
 
+#ifndef GST_DISABLE_GST_DEBUG
 static void
 gst_task_pool_finalize (GObject * object)
 {
-  GstTaskPool *pool = GST_TASK_POOL (object);
-
-  GST_DEBUG ("taskpool %p finalize", pool);
+  GST_DEBUG ("taskpool %p finalize", object);
 
   G_OBJECT_CLASS (gst_task_pool_parent_class)->finalize (object);
 }
-
+#endif
 /**
  * gst_task_pool_new:
  *
  * Create a new default task pool. The default task pool will use a regular
  * GThreadPool for threads.
  *
- * Returns: a new #GstTaskPool. gst_object_unref() after usage.
+ * Returns: (transfer full): a new #GstTaskPool. gst_object_unref() after usage.
  */
 GstTaskPool *
 gst_task_pool_new (void)
 {
   GstTaskPool *pool;
 
-  pool = g_object_new (GST_TYPE_TASK_POOL, NULL);
+  pool = g_object_newv (GST_TYPE_TASK_POOL, 0, NULL);
 
   return pool;
 }
@@ -216,15 +217,15 @@ gst_task_pool_cleanup (GstTaskPool * pool)
 /**
  * gst_task_pool_push:
  * @pool: a #GstTaskPool
- * @func: the function to call
- * @user_data: data to pass to @func
+ * @func: (scope async): the function to call
+ * @user_data: (closure): data to pass to @func
  * @error: return location for an error
  *
  * Start the execution of a new thread from @pool.
  *
- * Returns: a pointer that should be used for the gst_task_pool_join
- * function. This pointer can be NULL, you must check @error to detect
- * errors.
+ * Returns: (transfer none): a pointer that should be used for the
+ * gst_task_pool_join function. This pointer can be %NULL, you must
+ * check @error to detect errors.
  */
 gpointer
 gst_task_pool_push (GstTaskPool * pool, GstTaskPoolFunction func,