GNOME Bugzilla – Bug 750834
gstreamer-1.0: add bindings for GstInfo logging function
Last modified: 2018-05-22 15:24:07 UTC
Created attachment 305132 [details] [review] patch add bindings for GstInfo logging function note that the init function actually assign the pointer. the thing is that it calls a C Macro, GST_DEBUG_CATEGORY_INIT, doing the initialisation and assignment. the _gst_debug_category_new can't be called directly due to a "#pragma GCC poison" it might be used like this public class Foo : Gst.Element { static DebugCategory* dcat = null; static construct { dcat->init("foo", DebugColorFlags.FG_YELLOW, "foo bar"); } public void myFunction() { this.warning(dcat, "a warning message for the element"); dcat.warning("a warning message for the debug cate" } }
Created attachment 309058 [details] [review] gstreamer-1.0: add bindings for GstInfo logging function DebugCategory.init should rather be a static function because calling init on a non initialised object is counter intuitive
erf, forget my last comment/patch, it would translate a calls like DebugCategory.init(dcat, "foo", Gst.DebugColorFlags.FG_BLUE, "foo bar"); into GstDebugCategory* _tmp10_ = dcat; GST_DEBUG_CATEGORY_INIT (_tmp10_ , _tmp0_, _tmp1_, _tmp2_); which is wrong. a workaround might be to wrap init with something like: [CCode(cname="GST_DEBUG_CATEGORY_INIT")] private void _init(string name, DebugColorFlags color, string description); public static unowned DebugCategory? init(string name, DebugColorFlags color, string description){ DebugCategory* dcat = null; dcat->_init(name, color, description); return (DebugCategory?)dcat; }
The GStreamer VAPI is autogenerated with vapigen. Can you find out why the debug functions you are referring to are not included in the GIR?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/501.