check/gst/gstpipeline.c: add another check
authorThomas Vander Stichele <thomas@apestaart.org>
Wed, 28 Sep 2005 15:45:21 +0000 (15:45 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Wed, 28 Sep 2005 15:45:21 +0000 (15:45 +0000)
Original commit message from CVS:

* check/gst/gstpipeline.c: (GST_START_TEST), (gst_pipeline_suite):
add another check
* gst/gstbus.c:
add some doc
* gst/gstinfo.c: (_gst_debug_init):
slightly more readable color for refcount debugging

ChangeLog
check/gst/gstpipeline.c
gst/gstbus.c
gst/gstinfo.c
tests/check/gst/gstpipeline.c

index ec1489b..015588f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-09-28  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+       * check/gst/gstpipeline.c: (GST_START_TEST), (gst_pipeline_suite):
+         add another check
+       * gst/gstbus.c:
+         add some doc
+       * gst/gstinfo.c: (_gst_debug_init):
+         slightly more readable color for refcount debugging
+
 2005-09-28  Wim Taymans  <wim@fluendo.com>
 
        * gst/gstbin.c: (gst_bin_class_init), (gst_bin_provide_clock_func),
index ab68db1..d876645 100644 (file)
@@ -108,6 +108,27 @@ GST_START_TEST (test_async_state_change_fake)
 
 GST_END_TEST;
 
+GST_START_TEST (test_bus)
+{
+  GstPipeline *pipeline;
+  GstBus *bus;
+
+  pipeline = GST_PIPELINE (gst_pipeline_new (NULL));
+  fail_unless (pipeline != NULL, "Could not create pipeline");
+  ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline", 1);
+
+  bus = gst_pipeline_get_bus (pipeline);
+  ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline after get_bus", 1);
+  ASSERT_OBJECT_REFCOUNT (bus, "bus", 2);
+
+  gst_object_unref (pipeline);
+
+  ASSERT_OBJECT_REFCOUNT (bus, "bus after unref pipeline", 1);
+  gst_object_unref (bus);
+}
+
+GST_END_TEST;
+
 Suite *
 gst_pipeline_suite (void)
 {
@@ -118,6 +139,7 @@ gst_pipeline_suite (void)
   tcase_add_test (tc_chain, test_async_state_change_empty);
   tcase_add_test (tc_chain, test_async_state_change_fake_ready);
   tcase_add_test (tc_chain, test_async_state_change_fake);
+  tcase_add_test (tc_chain, test_bus);
 
   return s;
 }
index 88881d8..6be0db4 100644 (file)
@@ -595,6 +595,8 @@ gst_bus_create_watch (GstBus * bus, GstMessageType events)
  * When the func is called, the message belongs to the caller; if you want to 
  * keep a copy of it, call gst_message_ref() before leaving the func.
  *
+ * The watch can be removed using #g_source_remove().
+ *
  * Returns: The event source id.
  *
  * MT safe.
@@ -632,6 +634,8 @@ gst_bus_add_watch_full (GstBus * bus, gint priority, GstMessageType events,
  *
  * Adds a bus watch to the default main context with the default priority.
  *
+ * The watch can be removed using #g_source_remove().
+ *
  * Returns: The event source id.
  *
  * MT safe.
index 70ffb70..d65568b 100644 (file)
@@ -319,7 +319,7 @@ _gst_debug_init (void)
   GST_CAT_NEGOTIATION = _gst_debug_category_new ("GST_NEGOTIATION",
       GST_DEBUG_BOLD | GST_DEBUG_FG_BLUE, NULL);
   GST_CAT_REFCOUNTING = _gst_debug_category_new ("GST_REFCOUNTING",
-      GST_DEBUG_BOLD | GST_DEBUG_FG_BLUE | GST_DEBUG_BG_GREEN, NULL);
+      GST_DEBUG_BOLD | GST_DEBUG_FG_RED | GST_DEBUG_BG_BLUE, NULL);
   GST_CAT_ERROR_SYSTEM = _gst_debug_category_new ("GST_ERROR_SYSTEM",
       GST_DEBUG_BOLD | GST_DEBUG_FG_RED | GST_DEBUG_BG_WHITE, NULL);
 
index ab68db1..d876645 100644 (file)
@@ -108,6 +108,27 @@ GST_START_TEST (test_async_state_change_fake)
 
 GST_END_TEST;
 
+GST_START_TEST (test_bus)
+{
+  GstPipeline *pipeline;
+  GstBus *bus;
+
+  pipeline = GST_PIPELINE (gst_pipeline_new (NULL));
+  fail_unless (pipeline != NULL, "Could not create pipeline");
+  ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline", 1);
+
+  bus = gst_pipeline_get_bus (pipeline);
+  ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline after get_bus", 1);
+  ASSERT_OBJECT_REFCOUNT (bus, "bus", 2);
+
+  gst_object_unref (pipeline);
+
+  ASSERT_OBJECT_REFCOUNT (bus, "bus after unref pipeline", 1);
+  gst_object_unref (bus);
+}
+
+GST_END_TEST;
+
 Suite *
 gst_pipeline_suite (void)
 {
@@ -118,6 +139,7 @@ gst_pipeline_suite (void)
   tcase_add_test (tc_chain, test_async_state_change_empty);
   tcase_add_test (tc_chain, test_async_state_change_fake_ready);
   tcase_add_test (tc_chain, test_async_state_change_fake);
+  tcase_add_test (tc_chain, test_bus);
 
   return s;
 }