From 03ac16c1d8e1641c5323340c5b8f91e7ab401535 Mon Sep 17 00:00:00 2001 From: Tim-Philipp Müller Date: Mon, 25 Jun 2012 19:52:44 +0100 Subject: tocsetter: clean up and update API for refcounted TOCs Let's keep it simple for now: gst_toc_setter_reset_toc() -> gst_toc_setter_reset() gst_toc_setter_get_toc_copy() -> removed gst_toc_setter_get_toc() -> returns a ref now gst_toc_setter_get_toc_entry_copy() -> removed, use TOC functions instead gst_toc_setter_get_toc_entry() -> removed, use TOC functions instead gst_toc_setter_add_toc_entry() -> removed, to avoid problems with (refcount-dependent) writability of TOC; use TOC functions instead --- tests/check/gst/gsttocsetter.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/check/gst/gsttocsetter.c b/tests/check/gst/gsttocsetter.c index 52c8f1e88..fae08d4c2 100644 --- a/tests/check/gst/gsttocsetter.c +++ b/tests/check/gst/gsttocsetter.c @@ -240,7 +240,9 @@ create_toc (void) GST_START_TEST (test_set) { GstToc *toc; +#if 0 GstTocEntry *entry, *ed; +#endif GstTocSetter *setter; GstElement *enc; @@ -255,10 +257,11 @@ GST_START_TEST (test_set) gst_toc_setter_set_toc (setter, toc); gst_toc_unref (toc); - toc = gst_toc_setter_get_toc_copy (setter); + toc = gst_toc_setter_get_toc (setter); CHECK_TOC (toc); +#if 0 /* test entry adding into the root TOC */ entry = g_list_last (toc->entries)->data; toc->entries = g_list_remove (toc->entries, entry); @@ -268,10 +271,12 @@ GST_START_TEST (test_set) gst_toc_unref (toc); gst_toc_entry_unref (entry); - toc = gst_toc_setter_get_toc_copy (setter); + toc = gst_toc_setter_get_toc (setter); CHECK_TOC (toc); +#endif +#if 0 /* test entry adding into the arbitrary entry */ entry = gst_toc_find_entry (toc, ENTRY_CH2); fail_if (entry == NULL); @@ -282,10 +287,11 @@ GST_START_TEST (test_set) gst_toc_setter_add_toc_entry (setter, ed->uid, entry); CHECK_TOC (toc); +#endif gst_toc_unref (toc); - gst_toc_setter_reset_toc (setter); - toc = gst_toc_setter_get_toc_copy (setter); + gst_toc_setter_reset (setter); + toc = gst_toc_setter_get_toc (setter); fail_unless (toc == NULL); @@ -367,7 +373,7 @@ test_threads_thread_func3 (gpointer data) g_timer_start (timer); while (g_timer_elapsed (timer, NULL) < THREADS_TEST_SECONDS) { - gst_toc_setter_reset_toc (setter); + gst_toc_setter_reset (setter); } g_timer_destroy (timer); -- cgit v1.2.3