diff --git a/girs/Gst-1.0.gir b/girs/Gst-1.0.gir index 922e9fb9c3..06e4fcd3b6 100644 --- a/girs/Gst-1.0.gir +++ b/girs/Gst-1.0.gir @@ -51551,6 +51551,47 @@ would write out. + + Returns a string that represents @ptr. This is safe to call with +%GstStructure, %GstCapsFeatures, %GstMiniObject s (e.g. %GstCaps, +%GstBuffer or %GstMessage), and %GObjects (e.g. %GstElement or %GstPad). + +The string representation is meant to be used for debugging purposes and +might change between GStreamer versions. + +Passing other kind of pointers might or might not work and is generally +unsafe to do. + + + a string containing a string + representation of the object + + + + + the object + + + + + + Returns a string that represents @segments. + +The string representation is meant to be used for debugging purposes and +might change between GStreamer versions. + + + a string containing a string + representation of the segment + + + + + the %GstSegment + + + + If libunwind, glibc backtrace or DbgHelp are present a stack trace is printed. diff --git a/subprojects/gstreamer/gst/gstinfo.c b/subprojects/gstreamer/gst/gstinfo.c index 782bb28975..dd38bf9859 100644 --- a/subprojects/gstreamer/gst/gstinfo.c +++ b/subprojects/gstreamer/gst/gstinfo.c @@ -1065,8 +1065,27 @@ gst_info_describe_stream_collection (GstStreamCollection * collection) return ret; } -static gchar * -gst_debug_print_object (gpointer ptr) +/** + * gst_debug_print_object: + * @ptr: (nullable): the object + * + * Returns a string that represents @ptr. This is safe to call with + * %GstStructure, %GstCapsFeatures, %GstMiniObject s (e.g. %GstCaps, + * %GstBuffer or %GstMessage), and %GObjects (e.g. %GstElement or %GstPad). + * + * The string representation is meant to be used for debugging purposes and + * might change between GStreamer versions. + * + * Passing other kind of pointers might or might not work and is generally + * unsafe to do. + * + * Returns: (transfer full) (type gchar*): a string containing a string + * representation of the object + * + * Since: 1.26 + */ +gchar * +gst_debug_print_object (gconstpointer ptr) { GObject *object = (GObject *) ptr; @@ -1162,11 +1181,23 @@ gst_debug_print_object (gpointer ptr) return g_strdup_printf ("%p", ptr); } -static gchar * -gst_debug_print_segment (gpointer ptr) +/** + * gst_debug_print_segment: + * @segment: (nullable): the %GstSegment + * + * Returns a string that represents @segments. + * + * The string representation is meant to be used for debugging purposes and + * might change between GStreamer versions. + * + * Returns: (transfer full) (type gchar*): a string containing a string + * representation of the segment + * + * Since: 1.26 + */ +gchar * +gst_debug_print_segment (const GstSegment * segment) { - GstSegment *segment = (GstSegment *) ptr; - /* nicely printed segment */ if (segment == NULL) { return g_strdup ("(NULL)"); diff --git a/subprojects/gstreamer/gst/gstinfo.h b/subprojects/gstreamer/gst/gstinfo.h index 416bd7c25f..fb392f38d3 100644 --- a/subprojects/gstreamer/gst/gstinfo.h +++ b/subprojects/gstreamer/gst/gstinfo.h @@ -27,6 +27,7 @@ #include #include #include +#include G_BEGIN_DECLS @@ -553,6 +554,12 @@ GST_API GSList * gst_debug_get_all_categories (void); +GST_API +gchar * gst_debug_print_object (gconstpointer ptr); + +GST_API +gchar * gst_debug_print_segment (const GstSegment *segment); + GST_API gchar * gst_debug_construct_term_color (guint colorinfo);