diff --git a/configure.ac b/configure.ac index adbc4a7..771d26c 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ dnl when going to/from release please set the nano (fourth number) right ! dnl releases only do Wall, git and prerelease does Werror too dnl AC_INIT([GstShark], - [0.8.0.1], + [0.8.1.1], [https://github.com/RidgeRun/gst-shark], [gst-shark], [https://github.com/RidgeRun/gst-shark]) diff --git a/meson.build b/meson.build index 3d07a56..d4fd83f 100644 --- a/meson.build +++ b/meson.build @@ -8,7 +8,7 @@ # Roberto Gutierrez project('gst-shark', 'c', - version : '0.8.0', + version : '0.8.1', meson_version : '>= 0.58',) # Project version diff --git a/plugins/tracers/gstbuffer.c b/plugins/tracers/gstbuffer.c index fa11f14..93bb408 100644 --- a/plugins/tracers/gstbuffer.c +++ b/plugins/tracers/gstbuffer.c @@ -148,8 +148,6 @@ gst_buffer_buffer_list_pre (GObject * self, GstClockTime ts, GstPad * pad, static void gst_buffer_tracer_class_init (GstBufferTracerClass * klass) { - gchar *metadata_event; - tr_buffer = gst_tracer_record_new ("buffer.class", "pad", GST_TYPE_STRUCTURE, gst_structure_new ("value", "type", G_TYPE_GTYPE, G_TYPE_STRING, @@ -178,16 +176,13 @@ gst_buffer_tracer_class_init (GstBufferTracerClass * klass) GST_TYPE_STRUCTURE, gst_structure_new ("value", "type", G_TYPE_GTYPE, G_TYPE_UINT, "description", G_TYPE_STRING, "Ref Count", "min", G_TYPE_UINT, 0, "max", G_TYPE_UINT, G_MAXUINT32, NULL), NULL); - - metadata_event = g_strdup_printf (buffer_metadata_event, BUFFER_EVENT_ID, 0); - add_metadata_event_struct (metadata_event); - g_free (metadata_event); } static void gst_buffer_tracer_init (GstBufferTracer * self) { GstSharkTracer *tracer = GST_SHARK_TRACER (self); + gchar *metadata_event = NULL; gst_shark_tracer_register_hook (tracer, "pad-push-pre", G_CALLBACK (gst_buffer_buffer_pre)); @@ -197,4 +192,8 @@ gst_buffer_tracer_init (GstBufferTracer * self) gst_shark_tracer_register_hook (tracer, "pad-pull-range-post", G_CALLBACK (gst_buffer_range_post)); + + metadata_event = g_strdup_printf (buffer_metadata_event, BUFFER_EVENT_ID, 0); + add_metadata_event_struct (metadata_event); + g_free (metadata_event); } diff --git a/plugins/tracers/gstinterlatency.c b/plugins/tracers/gstinterlatency.c index b8475af..24ea323 100644 --- a/plugins/tracers/gstinterlatency.c +++ b/plugins/tracers/gstinterlatency.c @@ -271,7 +271,6 @@ static void gst_interlatency_tracer_class_init (GstInterLatencyTracerClass * klass) { GObjectClass *oclass; - gchar *metadata_event; oclass = G_OBJECT_CLASS (klass); @@ -312,17 +311,13 @@ gst_interlatency_tracer_class_init (GstInterLatencyTracerClass * klass) /* *INDENT-ON* */ oclass->dispose = gst_interlatency_tracer_dispose; - - metadata_event = - g_strdup_printf (interlatency_metadata_event, INTERLATENCY_EVENT_ID, 0); - add_metadata_event_struct (metadata_event); - g_free (metadata_event); } static void gst_interlatency_tracer_init (GstInterLatencyTracer * self) { GstTracer *tracer = GST_TRACER (self); + gchar *metadata_event = NULL; /* In push mode, pre/post will be called before/after the peer chain * function has been called. For this reason, we only use -pre to avoid @@ -344,6 +339,11 @@ gst_interlatency_tracer_init (GstInterLatencyTracer * self) G_CALLBACK (do_pull_range_post)); gst_tracing_register_hook (tracer, "pad-push-event-pre", G_CALLBACK (do_push_event_pre)); + + metadata_event = + g_strdup_printf (interlatency_metadata_event, INTERLATENCY_EVENT_ID, 0); + add_metadata_event_struct (metadata_event); + g_free (metadata_event); } static void diff --git a/plugins/tracers/gstproctime.c b/plugins/tracers/gstproctime.c index 643e0fa..0e0bc7a 100644 --- a/plugins/tracers/gstproctime.c +++ b/plugins/tracers/gstproctime.c @@ -135,7 +135,7 @@ static void gst_proc_time_tracer_class_init (GstProcTimeTracerClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - gchar *metadata_event; + gobject_class->finalize = gst_proc_time_tracer_finalize; @@ -147,11 +147,6 @@ gst_proc_time_tracer_class_init (GstProcTimeTracerClass * klass) gst_structure_new ("scope", "type", G_TYPE_GTYPE, G_TYPE_STRING, "related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PROCESS, NULL), NULL); - - metadata_event = - g_strdup_printf (proc_time_metadata_event, PROCTIME_EVENT_ID, 0); - add_metadata_event_struct (metadata_event); - g_free (metadata_event); } @@ -159,7 +154,7 @@ static void gst_proc_time_tracer_init (GstProcTimeTracer * self) { GstTracer *tracer = GST_TRACER (self); - + gchar *metadata_event = NULL; self->proc_time = gst_proctime_new (); @@ -168,4 +163,9 @@ gst_proc_time_tracer_init (GstProcTimeTracer * self) gst_tracing_register_hook (tracer, "element-new", G_CALLBACK (do_element_new)); + + metadata_event = + g_strdup_printf (proc_time_metadata_event, PROCTIME_EVENT_ID, 0); + add_metadata_event_struct (metadata_event); + g_free (metadata_event); } diff --git a/plugins/tracers/gstqueuelevel.c b/plugins/tracers/gstqueuelevel.c index 38de80d..b1f32c3 100644 --- a/plugins/tracers/gstqueuelevel.c +++ b/plugins/tracers/gstqueuelevel.c @@ -170,8 +170,6 @@ is_queue (GstElement * element) static void gst_queue_level_tracer_class_init (GstQueueLevelTracerClass * klass) { - gchar *metadata_event; - tr_qlevel = gst_tracer_record_new ("queuelevel.class", "queue", GST_TYPE_STRUCTURE, gst_structure_new ("scope", "type", G_TYPE_GTYPE, G_TYPE_STRING, @@ -201,17 +199,13 @@ gst_queue_level_tracer_class_init (GstQueueLevelTracerClass * klass) "type", G_TYPE_GTYPE, G_TYPE_STRING, "related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT, NULL), NULL); - - metadata_event = - g_strdup_printf (queue_level_metadata_event, QUEUE_LEVEL_EVENT_ID, 0); - add_metadata_event_struct (metadata_event); - g_free (metadata_event); } static void gst_queue_level_tracer_init (GstQueueLevelTracer * self) { GstSharkTracer *tracer = GST_SHARK_TRACER (self); + gchar *metadata_event = NULL; gst_shark_tracer_register_hook (tracer, "pad-push-pre", G_CALLBACK (do_queue_level)); @@ -221,4 +215,9 @@ gst_queue_level_tracer_init (GstQueueLevelTracer * self) gst_shark_tracer_register_hook (tracer, "pad-pull-range-pre", G_CALLBACK (do_queue_level)); + + metadata_event = + g_strdup_printf (queue_level_metadata_event, QUEUE_LEVEL_EVENT_ID, 0); + add_metadata_event_struct (metadata_event); + g_free (metadata_event); } diff --git a/plugins/tracers/gstscheduletime.c b/plugins/tracers/gstscheduletime.c index 327217b..d15e4a4 100644 --- a/plugins/tracers/gstscheduletime.c +++ b/plugins/tracers/gstscheduletime.c @@ -155,7 +155,6 @@ static void gst_scheduletime_tracer_class_init (GstScheduletimeTracerClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - gchar *metadata_event; gobject_class->finalize = gst_scheduletime_tracer_finalize; @@ -168,17 +167,13 @@ gst_scheduletime_tracer_class_init (GstScheduletimeTracerClass * klass) "type", G_TYPE_GTYPE, G_TYPE_STRING, "related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PROCESS, NULL), NULL); - - metadata_event = - g_strdup_printf (scheduling_metadata_event, SCHED_TIME_EVENT_ID, 0); - add_metadata_event_struct (metadata_event); - g_free (metadata_event); } static void gst_scheduletime_tracer_init (GstScheduletimeTracer * self) { GstSharkTracer *tracer = GST_SHARK_TRACER (self); + gchar *metadata_event = NULL; self->schedule_pads = g_hash_table_new_full (g_direct_hash, g_direct_equal, key_destroy, @@ -192,4 +187,9 @@ gst_scheduletime_tracer_init (GstScheduletimeTracer * self) gst_shark_tracer_register_hook (tracer, "pad-pull-range-pre", G_CALLBACK (sched_time_compute)); + + metadata_event = + g_strdup_printf (scheduling_metadata_event, SCHED_TIME_EVENT_ID, 0); + add_metadata_event_struct (metadata_event); + g_free (metadata_event); } diff --git a/plugins/tracers/gstsharktracer.c b/plugins/tracers/gstsharktracer.c index ba21d60..2a87980 100644 --- a/plugins/tracers/gstsharktracer.c +++ b/plugins/tracers/gstsharktracer.c @@ -137,12 +137,18 @@ static void gst_shark_tracer_init (GstSharkTracer * self) { GstSharkTracerPrivate *priv = GST_SHARK_TRACER_PRIVATE (self); + gint prev_count = 0; priv->params = g_hash_table_new (g_str_hash, g_str_equal); priv->hooks = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); priv->myhooks = g_hash_table_new (g_str_hash, g_str_equal); gst_shark_tracer_fill_hooks (priv); + + prev_count = g_atomic_int_add (&g_shark_tracer_refcount, 1); + if (prev_count == 0) { + gst_ctf_init (); + } } static void @@ -223,15 +229,10 @@ gst_shark_tracer_fill_hooks (GstSharkTracerPrivate * priv) static void gst_shark_tracer_constructed (GObject * object) { - gint prev_count; + GstSharkTracer *self = GST_SHARK_TRACER (object); gst_shark_tracer_save_params (self); - - prev_count = g_atomic_int_add (&g_shark_tracer_refcount, 1); - if (prev_count == 0) { - gst_ctf_init (); - } } static void