rtpdtmfsrc: minor logging clean-up

Only serialise event structure for debug logging purposes
if logging is actually enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7060>
This commit is contained in:
Tim-Philipp Müller 2024-06-19 02:10:29 +01:00 committed by GStreamer Marge Bot
parent 62047a9f8d
commit 8d845d4a02

View file

@ -352,9 +352,7 @@ gst_rtp_dtmf_src_handle_custom_upstream (GstRTPDTMFSrc * dtmfsrc,
GstEvent * event) GstEvent * event)
{ {
gboolean result = FALSE; gboolean result = FALSE;
gchar *struct_str;
const GstStructure *structure; const GstStructure *structure;
GstState state; GstState state;
GstStateChangeReturn ret; GstStateChangeReturn ret;
@ -364,11 +362,10 @@ gst_rtp_dtmf_src_handle_custom_upstream (GstRTPDTMFSrc * dtmfsrc,
goto ret; goto ret;
} }
GST_DEBUG_OBJECT (dtmfsrc, "Received event is of our interest");
structure = gst_event_get_structure (event); structure = gst_event_get_structure (event);
struct_str = gst_structure_to_string (structure);
GST_DEBUG_OBJECT (dtmfsrc, "Event has structure %s", struct_str); GST_DEBUG_OBJECT (dtmfsrc, "Received event: %" GST_PTR_FORMAT, structure);
g_free (struct_str);
if (structure && gst_structure_has_name (structure, "dtmf-event")) if (structure && gst_structure_has_name (structure, "dtmf-event"))
result = gst_rtp_dtmf_src_handle_dtmf_event (dtmfsrc, structure); result = gst_rtp_dtmf_src_handle_dtmf_event (dtmfsrc, structure);
@ -384,7 +381,9 @@ gst_rtp_dtmf_src_handle_event (GstBaseSrc * basesrc, GstEvent * event)
dtmfsrc = GST_RTP_DTMF_SRC (basesrc); dtmfsrc = GST_RTP_DTMF_SRC (basesrc);
GST_DEBUG_OBJECT (dtmfsrc, "Received an event on the src pad"); GST_DEBUG_OBJECT (dtmfsrc, "Received %s event on the src pad",
GST_EVENT_TYPE_NAME (event));
if (GST_EVENT_TYPE (event) == GST_EVENT_CUSTOM_UPSTREAM) { if (GST_EVENT_TYPE (event) == GST_EVENT_CUSTOM_UPSTREAM) {
result = gst_rtp_dtmf_src_handle_custom_upstream (dtmfsrc, event); result = gst_rtp_dtmf_src_handle_custom_upstream (dtmfsrc, event);
} }