Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding gstreamer support. #7

Open
dradtke opened this issue Jan 18, 2013 · 3 comments
Open

Adding gstreamer support. #7

dradtke opened this issue Jan 18, 2013 · 3 comments

Comments

@dradtke
Copy link

dradtke commented Jan 18, 2013

I'm trying to add gstreamer support, but I keep running into a weird build error. I already found and fixed a couple (mostly related to locating modules), but now it's complaining that it can't find the ObjectLike interface, despite the "gobject/gobject-2.0" module being successfully imported. From basing the input file off of what's already there, I'm not sure what I'm doing wrong.

The changes I've made so far can be found in my forked copy, and the full build log can be found here.

@nsf
Copy link
Owner

nsf commented Jan 19, 2013

I'll try to figure out what's wrong with this one. But I should also warn you about two things:

  1. I don't work on gogobject anymore as you can see, there are various reasons for that: Go cannot handle signals within threads created by C code (happens on some desktop configurations with gtk and dbus), Go bloats binaries because of its reflection model (gogtk-demo = 20M + 56 linked .so libraries), lack of enthusiasm.
  2. Gogobject is terribly broken for Go tip version, which means when go 1.1 comes out, it will require more changes to keep it working.

Now to your issue. I've cloned your repo, trying to build it shows this error instead of the one you have:

In file included from gstreamer-0.10/gst.go:3:0:
/home/nsf/tmp/gogobject/build/gstreamer-0.10/gst.gen.h:1440:41: error: unknown type name 'GStaticRecMutex'
/home/nsf/tmp/gogobject/build/gstreamer-0.10/gst.gen.h:1442:45: error: unknown type name 'GThreadPriority'

So, I'm wondering what go compiler version are you using?

@nsf
Copy link
Owner

nsf commented Jan 19, 2013

But in general when you see errors like that, probably it's due to broken gobject-introspection type annotations. For example I'm looking at the generated build/gstreamer-0.10/gst.go file, and it contains functions like this:

func ChildProxyChildAdded(object0 ObjectLike, child0 ObjectLike) {
        var object1 *C.GstObject
        var child1 *C.GstObject
        if object0 != nil {
            object1 = object0.InheritedFromGstObject()
        }
        if child0 != nil {
            child1 = child0.InheritedFromGstObject()
        }
        C.gst_child_proxy_child_added(object1, child1)
}

It refers to the C type GstObject. Now I'm looking at the file /usr/share/gir-1.0/Gst-0.10.gir and it definitely contains the Object type annotations. So, it must be defined then if not blacklisted, looking for Object definition in the gst.go and seeing this: // blacklisted: Object (object)

In your config file you've blacklisted all objects implicitly by not adding them to the whitelist:

    "whitelist": {
            "objects": [],
            "structs": [],
            "functions": [],
            "callbacks": []
    },

So, hence that's the reason of a failure.

@nsf
Copy link
Owner

nsf commented Jan 19, 2013

The process of adding bindings is quite painful as it is. You blacklist things that don't work, you whitelist things that work properly and if there is a desirable dependency that is not automatically generated you implement it manually. Generator is incomplete (I haven't finished it, for example it doesn't handle maps (aka dicts, hashmaps) marshaling properly), the build system is incomplete, the project is far from completion. Sorry if that's the only thing you can rely on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants