sink GstObject, much like GtkObject

Original commit message from CVS:
sink GstObject, much like GtkObject
This commit is contained in:
Johan Dahlin 2004-11-23 12:33:58 +00:00
parent 2e23effc15
commit b9f4f5e5f7
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2004-11-23 Johan Dahlin <johan@gnome.org>
* gst/gstmodule.c: sink GstObject, much like GtkObject
2004-11-23 Johan Dahlin <johan@gnome.org>
* examples/gst/play.py:

View file

@ -62,6 +62,15 @@ python_do_pending_calls(gpointer data)
return TRUE;
}
static void
sink_gstobject(GObject *object)
{
if (GST_OBJECT_FLOATING(object)) {
g_object_ref(object);
gst_object_sink(GST_OBJECT(object));
}
}
DL_EXPORT(void)
init_gst (void)
{
@ -71,6 +80,7 @@ init_gst (void)
char **argv;
init_pygobject ();
/* pull in arguments */
av = PySys_GetObject ("argv");
if (av != NULL) {
@ -103,6 +113,8 @@ init_gst (void)
g_free (argv);
}
pygobject_register_sinkfunc(GST_TYPE_OBJECT, sink_gstobject);
m = Py_InitModule ("_gst", pygst_functions);
d = PyModule_GetDict (m);