#include <gst/gst.h>

void on_weak_reference (gpointer data, GstMiniObject *where_the_object_was)
{
  printf ("The mini object at address %p is now being freed.\n",
      where_the_object_was);
}

int main (int argc, char** argv)
{
  gst_init (&argc, &argv);

  GstBuffer* buffer = gst_buffer_new_and_alloc (4);
  gst_mini_object_weak_ref ( GST_MINI_OBJECT (buffer), on_weak_reference,
      &buffer);
  gst_buffer_unref (buffer);

  return 0;
}
