[gst-devel] Recent change in gstregistry.c - FIX

Benjamin Otte in7y118 at public.uni-hamburg.de
Mon Nov 17 04:20:07 CET 2003


On Mon, 17 Nov 2003, Ronald Bultje wrote:

> Dave said that the value was being *copied* if it was of type GstPlugin
> (or, more general, of fundamental-type GBoxed). Assuming this is true,
> how do we prevent that?
>
We prevent that by using a G_TYPE_POINTER. GstPlugin is something that
definitely should not be boxed. A boxed type is something that can be
copied and each copy can be freed individually. Which is not true for
GstPlugin, because a GstPlugin refers to a GModule and modules can't be
copied. Apart from that GStreamer assumes there is a 1:1 relation between
plugin name and GstPlugin. Both of that won't work with boxed types.

One solution is to simply use a pointer as we know that a GstPlugin
struct will never be removed, that shouldn't be a problem. The other is to
make a GObject out of GstPlugin. This would solve the problem via
refcounting and the problems I mentioned above weren't there as we
wouldn't copy the GstPlugin.


Anyway, a boxed type is something that can be copied, GstPlugin is not.

Benjamin





More information about the gstreamer-devel mailing list