tocsetter, gst-launch, tests: update for GstToc API changes

This commit is contained in:
Tim-Philipp Müller 2012-06-24 20:10:34 +01:00
parent f20efe23a3
commit 8590be2861
4 changed files with 17 additions and 17 deletions

View file

@ -101,7 +101,7 @@ gst_toc_data_free (gpointer p)
GstTocData *data = (GstTocData *) p; GstTocData *data = (GstTocData *) p;
if (data->toc) if (data->toc)
gst_toc_free (data->toc); gst_toc_unref (data->toc);
g_mutex_clear (&data->lock); g_mutex_clear (&data->lock);
@ -153,7 +153,7 @@ gst_toc_setter_reset_toc (GstTocSetter * setter)
g_mutex_lock (&data->lock); g_mutex_lock (&data->lock);
if (data->toc) { if (data->toc) {
gst_toc_free (data->toc); gst_toc_unref (data->toc);
data->toc = NULL; data->toc = NULL;
} }
g_mutex_unlock (&data->lock); g_mutex_unlock (&data->lock);
@ -188,7 +188,7 @@ gst_toc_setter_get_toc (GstTocSetter * setter)
* Return current TOC the setter uses. The difference between this * Return current TOC the setter uses. The difference between this
* function and gst_toc_setter_get_toc() is that this function returns deep * function and gst_toc_setter_get_toc() is that this function returns deep
* copy of the TOC, so you can modify it in any way. This function is thread-safe. * copy of the TOC, so you can modify it in any way. This function is thread-safe.
* Free it when done with gst_toc_free(). * Free it when done with gst_toc_unref().
* *
* Returns: a copy of the current snapshot of the TOC used in the setter * Returns: a copy of the current snapshot of the TOC used in the setter
* or NULL if none is used. * or NULL if none is used.
@ -235,7 +235,7 @@ gst_toc_setter_set_toc (GstTocSetter * setter, const GstToc * toc)
g_mutex_lock (&data->lock); g_mutex_lock (&data->lock);
if (data->toc) if (data->toc)
gst_toc_free (data->toc); gst_toc_unref (data->toc);
data->toc = gst_toc_copy (toc); data->toc = gst_toc_copy (toc);

View file

@ -274,7 +274,7 @@ GST_START_TEST (test_serializing)
test_toc = gst_toc_copy (toc); test_toc = gst_toc_copy (toc);
fail_if (test_toc == NULL); fail_if (test_toc == NULL);
CHECK_TOC (test_toc); CHECK_TOC (test_toc);
gst_toc_free (test_toc); gst_toc_unref (test_toc);
test_toc = NULL; test_toc = NULL;
/* check TOC event handling */ /* check TOC event handling */
@ -287,7 +287,7 @@ GST_START_TEST (test_serializing)
fail_unless (updated == TRUE); fail_unless (updated == TRUE);
fail_if (test_toc == NULL); fail_if (test_toc == NULL);
CHECK_TOC (test_toc); CHECK_TOC (test_toc);
gst_toc_free (test_toc); gst_toc_unref (test_toc);
gst_event_unref (event); gst_event_unref (event);
updated = FALSE; updated = FALSE;
test_toc = NULL; test_toc = NULL;
@ -302,7 +302,7 @@ GST_START_TEST (test_serializing)
fail_unless (updated == TRUE); fail_unless (updated == TRUE);
fail_if (test_toc == NULL); fail_if (test_toc == NULL);
CHECK_TOC (test_toc); CHECK_TOC (test_toc);
gst_toc_free (test_toc); gst_toc_unref (test_toc);
gst_message_unref (message); gst_message_unref (message);
test_toc = NULL; test_toc = NULL;
@ -328,7 +328,7 @@ GST_START_TEST (test_serializing)
fail_unless_equals_string (uid, TEST_UID); fail_unless_equals_string (uid, TEST_UID);
fail_if (test_toc == NULL); fail_if (test_toc == NULL);
CHECK_TOC (test_toc); CHECK_TOC (test_toc);
gst_toc_free (test_toc); gst_toc_unref (test_toc);
gst_query_unref (query); gst_query_unref (query);
g_free (uid); g_free (uid);
@ -339,13 +339,13 @@ GST_START_TEST (test_serializing)
/* and yet another one */ /* and yet another one */
toc->entries = g_list_remove (toc->entries, ch); toc->entries = g_list_remove (toc->entries, ch);
gst_toc_entry_free (ch); gst_toc_entry_unref (ch);
ed = gst_toc_entry_new (GST_TOC_ENTRY_TYPE_EDITION, ENTRY_ED3); ed = gst_toc_entry_new (GST_TOC_ENTRY_TYPE_EDITION, ENTRY_ED3);
ch = (GstTocEntry *) (toc->entries->data); ch = (GstTocEntry *) (toc->entries->data);
ch->subentries = g_list_prepend (ch->subentries, ed); ch->subentries = g_list_prepend (ch->subentries, ed);
ASSERT_WARNING (message = gst_message_new_toc (NULL, toc, TRUE)); ASSERT_WARNING (message = gst_message_new_toc (NULL, toc, TRUE));
gst_toc_free (toc); gst_toc_unref (toc);
} }
GST_END_TEST; GST_END_TEST;

View file

@ -254,7 +254,7 @@ GST_START_TEST (test_set)
gst_toc_setter_set_toc (setter, toc); gst_toc_setter_set_toc (setter, toc);
gst_toc_free (toc); gst_toc_unref (toc);
toc = gst_toc_setter_get_toc_copy (setter); toc = gst_toc_setter_get_toc_copy (setter);
CHECK_TOC (toc); CHECK_TOC (toc);
@ -266,8 +266,8 @@ GST_START_TEST (test_set)
gst_toc_setter_set_toc (setter, toc); gst_toc_setter_set_toc (setter, toc);
gst_toc_setter_add_toc_entry (setter, "0", entry); gst_toc_setter_add_toc_entry (setter, "0", entry);
gst_toc_free (toc); gst_toc_unref (toc);
gst_toc_entry_free (entry); gst_toc_entry_unref (entry);
toc = gst_toc_setter_get_toc_copy (setter); toc = gst_toc_setter_get_toc_copy (setter);
CHECK_TOC (toc); CHECK_TOC (toc);
@ -283,7 +283,7 @@ GST_START_TEST (test_set)
CHECK_TOC (toc); CHECK_TOC (toc);
gst_toc_free (toc); gst_toc_unref (toc);
gst_toc_setter_reset_toc (setter); gst_toc_setter_reset_toc (setter);
toc = gst_toc_setter_get_toc_copy (setter); toc = gst_toc_setter_get_toc_copy (setter);
@ -317,7 +317,7 @@ test_threads_thread_func1 (gpointer data)
while (g_timer_elapsed (timer, NULL) < THREADS_TEST_SECONDS) while (g_timer_elapsed (timer, NULL) < THREADS_TEST_SECONDS)
gst_toc_setter_set_toc (setter, toc); gst_toc_setter_set_toc (setter, toc);
gst_toc_free (toc); gst_toc_unref (toc);
g_timer_destroy (timer); g_timer_destroy (timer);
GST_INFO ("Done"); GST_INFO ("Done");
@ -344,7 +344,7 @@ test_threads_thread_func2 (gpointer data)
while (g_timer_elapsed (timer, NULL) < THREADS_TEST_SECONDS) while (g_timer_elapsed (timer, NULL) < THREADS_TEST_SECONDS)
gst_toc_setter_set_toc (setter, toc); gst_toc_setter_set_toc (setter, toc);
gst_toc_free (toc); gst_toc_unref (toc);
g_timer_destroy (timer); g_timer_destroy (timer);
GST_INFO ("Done"); GST_INFO ("Done");

View file

@ -685,7 +685,7 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
/* recursively loop over toc entries */ /* recursively loop over toc entries */
g_list_foreach (toc_msg->entries, print_toc_entry, g_list_foreach (toc_msg->entries, print_toc_entry,
GUINT_TO_POINTER (0)); GUINT_TO_POINTER (0));
gst_toc_free (toc_msg); gst_toc_unref (toc_msg);
} }
break; break;
case GST_MESSAGE_INFO:{ case GST_MESSAGE_INFO:{