#include #include // compile with: // gcc jitter.c -o jitter -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -lgstreamer-1.0 -lgobject-2.0 static double time_last = 0; static void pts_analysis_cb (GstElement * identity, GstBuffer * buffer, gpointer user_data) { GstClockTime pts = GST_BUFFER_PTS(buffer); double time = pts / 1000000.0; double time_step = time - time_last; fprintf(stderr, "%04.1f ms\n", time_step); time_last = time; } void main (void) { gst_init(NULL, NULL); GstElement * pipeline = gst_parse_launch_full( "nvarguscamerasrc sensor-id=0 do-timestamp=true " "! video/x-raw(memory:NVMM),width=4032,height=3040,framerate=30/1,format=NV12 " "! identity name=identity " "! fakesink " , NULL, GST_PARSE_FLAG_FATAL_ERRORS, NULL ); GstElement * identity = GST_ELEMENT(gst_bin_get_by_name(GST_BIN(pipeline), "identity")); g_signal_connect_data(identity, "handoff", G_CALLBACK(pts_analysis_cb), NULL, NULL, 0); gst_element_set_state (pipeline, GST_STATE_PLAYING); while (1); }