#include <gst/gst.h>

static GstPadProbeReturn
probe_cb (GstPad *pad,
    GstPadProbeInfo *info,
    gpointer user_data)
{
  g_print ("probe info type: %d\n", info->type);
  return GST_PAD_PROBE_OK;
}

int main (int argc, char *argv[])
{
  GstElement *pipeline;
  GstElement *src;
  GstPad *pad;

  gst_init (&argc, &argv);

  pipeline = gst_parse_launch ("videotestsrc name=src ! xvimagesink", NULL);

  src = gst_bin_get_by_name (GST_BIN (pipeline), "src");
  pad = gst_element_get_static_pad (src, "src");
  gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_FLUSH,
      probe_cb, NULL, NULL);

  gst_element_set_state (pipeline, GST_STATE_PLAYING);

  while (TRUE);
}
