#include #define ITERS 100000 #include "mem.h" static void print_pad_props (GstPad *pad) { g_print ("name %s\n", gst_pad_get_name (pad)); g_print ("flags 0x%08x\n", GST_FLAGS (pad)); } int main (int argc, gchar *argv[]) { GstPad *pad; GstPad *pad2; GstPadTemplate *padtempl; long usage1; gint i; gst_init (&argc, &argv); g_print ("creating new pad\n"); pad = gst_pad_new ("padname", GST_PAD_SINK); usage1 = vmsize(); print_pad_props (pad); g_print ("unref new pad %ld\n", vmsize()-usage1); gst_object_unref (GST_OBJECT (pad)); g_print ("creating new pad\n"); pad = gst_pad_new ("padname", GST_PAD_SINK); g_assert (GST_OBJECT_FLOATING (pad)); print_pad_props (pad); g_print ("sink new pad %ld\n", vmsize()-usage1); gst_object_ref (GST_OBJECT (pad)); gst_object_sink (GST_OBJECT (pad)); g_assert (!GST_OBJECT_FLOATING (pad)); print_pad_props (pad); g_print ("unref new pad %ld\n", vmsize()-usage1); gst_object_unref (GST_OBJECT (pad)); for (i=0; i