tracer: latency: Don't compare element name as element Id is already unique

This commit is contained in:
Julian Bouzas 2019-04-12 09:23:52 -04:00 committed by Sebastian Dröge
parent e128c7310c
commit 35788c8563

View file

@ -353,20 +353,16 @@ do_drop_sub_latency_event (GstPad * pad, GstPadProbeInfo * info,
GstElement *peer_parent = get_real_pad_parent (peer_pad); GstElement *peer_parent = get_real_pad_parent (peer_pad);
const GValue *value; const GValue *value;
gchar *element_id = g_strdup_printf ("%p", peer_parent); gchar *element_id = g_strdup_printf ("%p", peer_parent);
gchar *element_name = gst_element_get_name (peer_parent);
gchar *pad_name = gst_pad_get_name (peer_pad); gchar *pad_name = gst_pad_get_name (peer_pad);
const gchar *value_element_id, *value_element_name, *value_pad_name; const gchar *value_element_id, *value_pad_name;
/* Get the element id, element name and pad name from data */ /* Get the element id, element name and pad name from data */
value = gst_structure_id_get_value (data, latency_probe_element_id); value = gst_structure_id_get_value (data, latency_probe_element_id);
value_element_id = g_value_get_string (value); value_element_id = g_value_get_string (value);
value = gst_structure_id_get_value (data, latency_probe_element);
value_element_name = g_value_get_string (value);
value = gst_structure_id_get_value (data, latency_probe_pad); value = gst_structure_id_get_value (data, latency_probe_pad);
value_pad_name = g_value_get_string (value); value_pad_name = g_value_get_string (value);
if (!g_str_equal (value_element_id, element_id) || if (!g_str_equal (value_element_id, element_id) ||
!g_str_equal (value_element_name, element_name) ||
!g_str_equal (value_pad_name, pad_name)) { !g_str_equal (value_pad_name, pad_name)) {
GST_DEBUG ("%s_%s: Dropping sub-latency event", GST_DEBUG ("%s_%s: Dropping sub-latency event",
GST_DEBUG_PAD_NAME (pad)); GST_DEBUG_PAD_NAME (pad));
@ -374,7 +370,6 @@ do_drop_sub_latency_event (GstPad * pad, GstPadProbeInfo * info,
} }
g_free (pad_name); g_free (pad_name);
g_free (element_name);
g_free (element_id); g_free (element_id);
} }
} }
@ -420,20 +415,16 @@ do_push_event_pre (GstTracer * self, guint64 ts, GstPad * pad, GstEvent * ev)
if (gst_structure_get_name_id (data) == sub_latency_probe_id) { if (gst_structure_get_name_id (data) == sub_latency_probe_id) {
const GValue *value; const GValue *value;
gchar *element_id = g_strdup_printf ("%p", peer_parent); gchar *element_id = g_strdup_printf ("%p", peer_parent);
gchar *element_name = gst_element_get_name (peer_parent);
gchar *pad_name = gst_pad_get_name (peer_pad); gchar *pad_name = gst_pad_get_name (peer_pad);
const gchar *value_element_id, *value_element_name, *value_pad_name; const gchar *value_element_id, *value_pad_name;
/* Get the element id, element name and pad name from data */ /* Get the element id, element name and pad name from data */
value = gst_structure_id_get_value (data, latency_probe_element_id); value = gst_structure_id_get_value (data, latency_probe_element_id);
value_element_id = g_value_get_string (value); value_element_id = g_value_get_string (value);
value = gst_structure_id_get_value (data, latency_probe_element);
value_element_name = g_value_get_string (value);
value = gst_structure_id_get_value (data, latency_probe_pad); value = gst_structure_id_get_value (data, latency_probe_pad);
value_pad_name = g_value_get_string (value); value_pad_name = g_value_get_string (value);
if (!g_str_equal (value_element_id, element_id) || if (!g_str_equal (value_element_id, element_id) ||
!g_str_equal (value_element_name, element_name) ||
!g_str_equal (value_pad_name, pad_name)) { !g_str_equal (value_pad_name, pad_name)) {
GST_DEBUG ("%s_%s: Storing sub-latency event", GST_DEBUG ("%s_%s: Storing sub-latency event",
GST_DEBUG_PAD_NAME (pad)); GST_DEBUG_PAD_NAME (pad));
@ -442,7 +433,6 @@ do_push_event_pre (GstTracer * self, guint64 ts, GstPad * pad, GstEvent * ev)
} }
g_free (pad_name); g_free (pad_name);
g_free (element_name);
g_free (element_id); g_free (element_id);
} }
} }