[gst-devel] Why wrapping GLib interfaces?

Ronald Bultje rbultje at ronald.bitfreak.net
Tue Oct 14 00:38:02 CEST 2003

Hi Murray,

On Mon, 2003-10-13 at 18:32, Murray.Cumming at Comneon.com wrote:
> I'm not following this fully, but it sound like you are talking about
> implementing Ginterfaces per-instance rather than per Gtype.

Technically, we do it per-class, with an additional function call to
check whether the specific instance supports it. We're perfectly
glib-compatible. Indeed, for C++, the advantage of automatic
instance-checking-on-case will go away and people will still have to
manually check whether the specific instance supports the interface
implementation after having casted it.

This will never lead to crashes. It will, in the worst case, trigger
some g_warning()s because an interface virtual function was called on an
instance not supporting the implementation.

Please, look at the code. It's very obvious once you look at the code,
and you'll see how simple this it.


Ronald Bultje <rbultje at ronald.bitfreak.net>
Linux Video/Multimedia developer

More information about the gstreamer-devel mailing list