Skip to content

Commit

Permalink
Added logic to transform_ip to print real time and timestamp.
Browse files Browse the repository at this point in the history
  • Loading branch information
george-hawkins committed Aug 3, 2019
1 parent b01f7a6 commit e0c8c3c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions plugins/gstabsolutetimestamps.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "config.h"
#endif

#include <glib/gprintf.h>
#include <gst/gst.h>
#include <gst/base/gstbasetransform.h>
#include "gstabsolutetimestamps.h"
Expand Down Expand Up @@ -433,6 +434,20 @@ gst_absolutetimestamps_transform_ip (GstBaseTransform * trans, GstBuffer * buf)

GST_DEBUG_OBJECT (absolutetimestamps, "transform_ip");

GstClockTime timestamp = GST_BUFFER_TIMESTAMP (buf);

if (timestamp != GST_CLOCK_TIME_NONE) {
GTimeVal real_time;

g_get_current_time (&real_time);

gchar *s = g_time_val_to_iso8601 (&real_time);

g_printf ("%" GST_TIME_FORMAT " %s\n", GST_TIME_ARGS (timestamp), s);

g_free (s);
}

return GST_FLOW_OK;
}

Expand Down

0 comments on commit e0c8c3c

Please sign in to comment.