1. identity element的回調.
static void my_handoff(GstElement *identity, GstBuffer *buffer, GstPad *pad, gpointer user_data) { unsigned int buflen; unsigned long int bufpts, bufdur; buflen = GST_BUFFER_SIZE(buffer); bufpts = GST_BUFFER_TIMESTAMP(buffer); bufdur = GST_BUFFER_DURATION(buffer); printf("Buffer pts = % "GST_TIME_FORMAT", duration = %10llu, len = %10u/n", GST_TIME_ARGS(bufpts), bufdur, buflen); } /* ....... */ ident = gst_element_factory_make ("identity", NULL); g_signal_connect(ident , "handoff", G_CALLBACK(my_handoff), NULL);