#include #include #include /* FIXME: WTF does this do? */ static guint64 max = 0, min = -1, total = 0; static guint count = 0; static guint print_del = 1; static guint iterations = 0; static guint mhz = 0; void handoff_src(GstElement *src, GstBuffer *buf, gpointer user_data) { gst_trace_read_tsc(&GST_BUFFER_TIMESTAMP(buf)); } void handoff_sink(GstElement *sink, GstBuffer *buf, gpointer user_data) { guint64 end, d, avg; guint avg_ns; gst_trace_read_tsc(&end); d = end - GST_BUFFER_TIMESTAMP(buf); if (d > max) max = d; if (d < min) min = d; total += d; count++; avg = total/count; avg_ns = (guint)(1000.0*(double)avg/(double)mhz); if ((count % print_del) == 0) { g_print("%07d:%08lld min:%08lld max:%08lld avg:%08lld avg-s:0.%09d\r", count, d, min, max, avg, avg_ns); } } GstElement *identity_add(GstPipeline *pipeline, GstElement *first, int count) { GstElement *last, *ident; int i; char buf[20]; last = first; for (i=0; i