#include #define ITERS 100000 #include "mem.h" static void print_element_props (GstElement *element) { g_print ("name %s\n", gst_element_get_name (element)); g_print ("flags 0x%08x\n", GST_FLAGS (element)); } int main (int argc, gchar *argv[]) { GstElement *element; long usage1, usage2; gint i; gst_init (&argc, &argv); g_print ("creating new element\n"); element = gst_element_new (); usage1 = vmsize(); print_element_props (element); g_print ("unref new element %ld\n", vmsize()-usage1); gst_object_unref (GST_OBJECT (element)); g_print ("creating new element\n"); element = gst_element_new (); g_assert (GST_OBJECT_FLOATING (element)); print_element_props (element); g_print ("sink new element %ld\n", vmsize()-usage1); gst_object_ref (GST_OBJECT (element)); gst_object_sink (GST_OBJECT (element)); g_assert (!GST_OBJECT_FLOATING (element)); print_element_props (element); g_print ("unref new element %ld\n", vmsize()-usage1); gst_object_unref (GST_OBJECT (element)); for (i=0; i