diff --git a/ChangeLog b/ChangeLog index ec1489b050..015588fec8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-09-28 Thomas Vander Stichele + + * 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 * gst/gstbin.c: (gst_bin_class_init), (gst_bin_provide_clock_func), diff --git a/check/gst/gstpipeline.c b/check/gst/gstpipeline.c index ab68db1b0d..d876645e7d 100644 --- a/check/gst/gstpipeline.c +++ b/check/gst/gstpipeline.c @@ -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; } diff --git a/gst/gstbus.c b/gst/gstbus.c index 88881d8494..6be0db4b98 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -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. diff --git a/gst/gstinfo.c b/gst/gstinfo.c index 70ffb70ad4..d65568baf4 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -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); diff --git a/tests/check/gst/gstpipeline.c b/tests/check/gst/gstpipeline.c index ab68db1b0d..d876645e7d 100644 --- a/tests/check/gst/gstpipeline.c +++ b/tests/check/gst/gstpipeline.c @@ -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; }