return;
}
destpad = gst_element_get_pad (dest, destpadname);
- if (srcpad == NULL) {
+ if (destpad == NULL) {
GST_WARNING_OBJECT (dest, "destination element has no pad \"%s\"",
destpadname);
+ gst_object_unref (srcpad);
return;
}
/* we're satisified they can be unlinked, let's do it */
gst_pad_unlink (srcpad, destpad);
+ gst_object_unref (srcpad);
+ gst_object_unref (destpad);
}
/**
fret = gst_pad_chain (sinkpad, buffer);
fail_if (fret != GST_FLOW_OK);
}
+
+ gst_element_set_state (sink, GST_STATE_NULL);
+ gst_element_get_state (sink, NULL, NULL, GST_CLOCK_TIME_NONE);
+ gst_object_unref (sinkpad);
+ gst_object_unref (sink);
}
GST_END_TEST;
GstState current, pending;
sink = gst_element_factory_make ("fakesink", "sink");
+ g_object_set (G_OBJECT (sink), "sync", TRUE, NULL);
ret = gst_element_set_state (sink, GST_STATE_PLAYING);
fail_unless (ret == GST_STATE_CHANGE_ASYNC, "no async state return");
fail_unless (pending == GST_STATE_PLAYING, "bad pending state");
src = gst_element_factory_make ("fakesrc", "src");
+ g_object_set (G_OBJECT (src), "datarate", 200, "sizetype", 2, NULL);
gst_element_link (src, sink);
ret = gst_element_set_state (src, GST_STATE_PLAYING);
fail_unless (ret == GST_STATE_CHANGE_ASYNC, "not async");
fail_unless (current == GST_STATE_PAUSED, "not paused");
fail_unless (pending == GST_STATE_PAUSED, "not paused");
+
+ gst_object_unref (pipeline);
}
GST_END_TEST
gst_object_unref (GST_OBJECT (element));
}
+ gst_plugin_feature_list_free (features);
gst_task_cleanup_all ();
}
gst_bin_add (bin, filesrc);
fail_unless (gst_bin_get_by_interface (bin, GST_TYPE_URI_HANDLER) == filesrc);
+ gst_object_unref (filesrc);
+
it = gst_bin_iterate_all_by_interface (bin, GST_TYPE_URI_HANDLER);
fail_unless (it != NULL);
fail_unless (gst_iterator_next (it, &item) == GST_ITERATOR_OK);
fail_unless (item == (gpointer) filesrc);
+ gst_object_unref (GST_OBJECT (item));
fail_unless (gst_iterator_next (it, &item) == GST_ITERATOR_DONE);
gst_iterator_free (it);
gst_element_factory_make ("identity", NULL),
gst_element_factory_make ("identity", NULL),
gst_element_factory_make ("identity", NULL), NULL);
- fail_unless (gst_bin_get_by_interface (bin, GST_TYPE_URI_HANDLER) == filesrc);
it = gst_bin_iterate_all_by_interface (bin, GST_TYPE_URI_HANDLER);
fail_unless (it != NULL);
fail_unless (gst_iterator_next (it, &item) == GST_ITERATOR_OK);
fail_unless (item == (gpointer) filesrc);
+ gst_object_unref (GST_OBJECT (item));
fail_unless (gst_iterator_next (it, &item) == GST_ITERATOR_DONE);
gst_iterator_free (it);
gst_element_factory_make ("identity", NULL),
gst_element_factory_make ("identity", NULL),
GST_ELEMENT (bin2), gst_element_factory_make ("identity", NULL), NULL);
- fail_unless (gst_bin_get_by_interface (bin, GST_TYPE_URI_HANDLER) == filesrc);
it = gst_bin_iterate_all_by_interface (bin, GST_TYPE_URI_HANDLER);
fail_unless (gst_iterator_next (it, &item) == GST_ITERATOR_OK);
fail_unless (item == (gpointer) filesrc);
+ gst_object_unref (GST_OBJECT (item));
fail_unless (gst_iterator_next (it, &item) == GST_ITERATOR_DONE);
gst_iterator_free (it);
gst_bin_add (bin2, gst_element_factory_make ("filesrc", NULL));
it = gst_bin_iterate_all_by_interface (bin, GST_TYPE_URI_HANDLER);
fail_unless (gst_iterator_next (it, &item) == GST_ITERATOR_OK);
+ gst_object_unref (GST_OBJECT (item));
fail_unless (gst_iterator_next (it, &item) == GST_ITERATOR_OK);
+ gst_object_unref (GST_OBJECT (item));
fail_unless (gst_iterator_next (it, &item) == GST_ITERATOR_OK);
+ gst_object_unref (GST_OBJECT (item));
fail_unless (gst_iterator_next (it, &item) == GST_ITERATOR_DONE);
gst_iterator_free (it);
fail_unless (gst_caps_is_equal (caps, caps2));
- g_free (caps);
- g_free (caps2);
+ gst_caps_unref (caps);
+ gst_caps_unref (caps2);
g_free (to_str);
}
}
"buffer", GST_TYPE_BUFFER, buffer, NULL);
GST_DEBUG ("caps: %" GST_PTR_FORMAT, c1);
-
- gst_buffer_set_caps (buffer, c1); /* gives away our c1 ref */
gst_buffer_unref (buffer);
+
+ buffer = gst_buffer_new_and_alloc (1000);
+ gst_buffer_set_caps (buffer, c1); /* doesn't give away our c1 ref */
+
+ gst_caps_unref (c1);
+ gst_buffer_unref (buffer); /* Should now drop both references */
}
GST_END_TEST;
GST_START_TEST (test_static_caps)
{
- GstStaticCaps scaps = GST_STATIC_CAPS ("audio/x-raw-int,rate=44100");
+ static GstStaticCaps scaps = GST_STATIC_CAPS ("audio/x-raw-int,rate=44100");
GstCaps *caps1;
GstCaps *caps2;
/* clean up our own reference */
gst_object_unref (p);
+ gst_object_unref (e);
}
GST_END_TEST;
gst_element_set_state (sink, GST_STATE_NULL);
gst_element_set_state (src, GST_STATE_NULL);
+ gst_element_get_state (sink, NULL, NULL, GST_CLOCK_TIME_NONE);
+ g_usleep (G_USEC_PER_SEC / 2);
+
ASSERT_OBJECT_REFCOUNT (sink, "sink", 1);
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
gst_element_unlink_pads (src, "src", sink, "sink");
ASSERT_OBJECT_REFCOUNT (sink, "sink", 1);
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
+
+ gst_object_unref (src);
+ gst_object_unref (sink);
}
GST_END_TEST;
srcpad = gst_element_get_pad (src, "src");
/* pad cannot be linked now */
fail_if (gst_pad_is_linked (srcpad));
+
+ gst_object_unref (b1);
}
GST_END_TEST;
/* clean up */
gst_iterator_free (iter);
g_mutex_free (m);
+ g_list_free (l);
}
GST_END_TEST;
/* clean up */
gst_iterator_free (iter);
g_mutex_free (m);
+ g_list_free (l);
}
GST_END_TEST;
/* clean up */
gst_iterator_free (iter);
g_mutex_free (m);
+ g_list_free (l);
}
GST_END_TEST;
fail_unless (GST_VALUE_HOLDS_FOURCC (&dest));
fail_unless (gst_value_get_fourcc (&dest) ==
GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'));
+
+ g_value_unset (&src1);
+ g_value_unset (&src2);
}
GST_END_TEST;