GNOME Bugzilla – Bug 785215
gstreamer-1.0 vapi lacks GST_DEBUG_BIN_TO_DOT_FILE
Last modified: 2017-11-20 20:04:34 UTC
I am using vala 0.36.4, compiled from sources on ubuntu zesty. gstreamer-1.0 does not export GST_DEBUG_BIN_TO_DOT_FILE and GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS macros that are extremely useful for debugging. That also applies to associated enum such as https://github.com/GStreamer/gstreamer/blob/2bf0a98bcd4e8af126725e1bd66fe41a04d4c330/gst/gstdebugutils.h#L48
Are those not working or bound correctly? Gst.Debug.bin_to_dot_data () Gst.Debug.bin_to_dot_file () Gst.Debug.bin_to_dot_file_with_ts ()
Created attachment 358468 [details] [review] gstreamer-1.0: Use corresponding debug macros for Debug.bin_to_dot_file* GST_DEBUG_BIN_TO_DOT_FILE and GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS are conditionally set depending on GST_DISABLE_GST_DEBUG.
Review of attachment 358468 [details] [review]: That makes sense to me. Most G-I based bindings can't take advantage of the conditional definitions, but since Vala can I think it makes sense to do so. My only concern is that perhaps we should offer both versions instead of just directing the lowercase versions to the uppercase ones, since it could be useful for people who want to dump the graph when not in debug mode…
@evan: I see. Any idea what would be an appropriate to way to add those in parallel? (in a discoverable way)
Untested, but I think this should do the trick: diff --git a/vapi/metadata/Gst-1.0-custom.vala b/vapi/metadata/Gst-1.0-custom.vala index 87467efad..f62d56025 100644 --- a/vapi/metadata/Gst-1.0-custom.vala +++ b/vapi/metadata/Gst-1.0-custom.vala @@ -1,4 +1,10 @@ namespace Gst { + namespace Debug { + [CCode (cheader_filename = "gst/gst.h", cname = "GST_DEBUG_BIN_TO_DOT_FILE")] + public static void BIN_TO_DOT_FILE (Gst.Bin bin, Gst.DebugGraphDetails details, string file_name); + [CCode (cheader_filename = "gst/gst.h", cname = "GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS")] + public static void BIT_TO_DOT_FILE_WITH_TS (Gst.Bin bin, Gst.DebugGraphDetails details, string file_name); + } [Compact, CCode (copy_function = "gst_allocation_params_copy", free_function = "gst_allocation_params_free", type_id = "gst_allocation_params_get_type ()")] public class AllocationParams { }
Created attachment 364039 [details] [review] gstreamer-1.0: Bind GST_DEBUG_BIN_TO_DOT_FILE/*_WITH_TS
Review of attachment 364039 [details] [review]: Is there not a typo here? BIN_TO_DOT_FILE_WITH_TS is BIT_TO_DOT_FILE_WITH_TS.
Created attachment 364055 [details] [review] gstreamer-1.0: Bind GST_DEBUG_BIN_TO_DOT_FILE/*_WITH_TS
Attachment 364055 [details] pushed as 78a9230 - gstreamer-1.0: Bind GST_DEBUG_BIN_TO_DOT_FILE/*_WITH_TS