After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750834 - gstreamer-1.0: add bindings for GstInfo logging function
gstreamer-1.0: add bindings for GstInfo logging function
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Bindings: GTK+ GStreamer WebKitGTK+
unspecified
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-12 11:52 UTC by Pierre Lamot
Modified: 2018-05-22 15:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (2.77 KB, patch)
2015-06-12 11:52 UTC, Pierre Lamot
none Details | Review
gstreamer-1.0: add bindings for GstInfo logging function (2.80 KB, patch)
2015-08-11 12:18 UTC, Pierre Lamot
none Details | Review

Description Pierre Lamot 2015-06-12 11:52:19 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"
}

}
Comment 1 Pierre Lamot 2015-08-11 12:18:30 UTC
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
Comment 2 Pierre Lamot 2015-08-11 16:23:54 UTC
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;
        }
Comment 3 Michael 'Mickey' Lauer 2018-02-25 15:44:03 UTC
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?
Comment 4 GNOME Infrastructure Team 2018-05-22 15:24:07 UTC
-- 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.