mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
gst/gstbuffer.override: a buffer is not a boxed
Original commit message from CVS: * gst/gstbuffer.override: a buffer is not a boxed * gst/gstobject.override: use Py_VISIT for cleaner and more pythonic code do not visit GstObjects that still have a parent
This commit is contained in:
parent
aabc3e7be1
commit
02193a3552
3 changed files with 18 additions and 14 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2005-10-05 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* gst/gstbuffer.override:
|
||||||
|
a buffer is not a boxed
|
||||||
|
* gst/gstobject.override:
|
||||||
|
use Py_VISIT for cleaner and more pythonic code
|
||||||
|
do not visit GstObjects that still have a parent
|
||||||
|
|
||||||
2005-10-05 Edward Hervey <edward@fluendo.com>
|
2005-10-05 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
* codegen/argtypes.py:
|
* codegen/argtypes.py:
|
||||||
|
|
|
@ -102,7 +102,7 @@ _wrap_gst_buffer_tp_repr (PyGstMiniObject *self)
|
||||||
PyObject *ret;
|
PyObject *ret;
|
||||||
|
|
||||||
g_assert (self);
|
g_assert (self);
|
||||||
buf = pyg_boxed_get (self, GstBuffer);
|
buf = GST_BUFFER(self->obj);
|
||||||
g_assert (buf);
|
g_assert (buf);
|
||||||
|
|
||||||
size = GST_BUFFER_SIZE (buf);
|
size = GST_BUFFER_SIZE (buf);
|
||||||
|
|
|
@ -46,7 +46,6 @@ _wrap_gst_object__get___gstrefcount__(PyGObject *self, void *closure)
|
||||||
* compare with pygtk/gobject/pygobject.c
|
* compare with pygtk/gobject/pygobject.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* a define is a little evil, but it seems to generate the right code
|
/* a define is a little evil, but it seems to generate the right code
|
||||||
* to allow us to do our garbage collection routines */
|
* to allow us to do our garbage collection routines */
|
||||||
%%
|
%%
|
||||||
|
@ -64,23 +63,17 @@ _wrap_gst_object_tp_traverse(PyGObject *self, visitproc visit, void *arg)
|
||||||
GST_LOG_OBJECT(self->obj,
|
GST_LOG_OBJECT(self->obj,
|
||||||
"gst.Object.tp_traverse");
|
"gst.Object.tp_traverse");
|
||||||
|
|
||||||
if (self->inst_dict) ret = visit(self->inst_dict, arg);
|
Py_VISIT(self->inst_dict);
|
||||||
if (ret != 0) return ret;
|
|
||||||
|
|
||||||
for (tmp = self->closures; tmp != NULL; tmp = tmp->next) {
|
for (tmp = self->closures; tmp != NULL; tmp = tmp->next) {
|
||||||
PyGClosure *closure = tmp->data;
|
PyGClosure *closure = tmp->data;
|
||||||
|
|
||||||
if (closure->callback) ret = visit(closure->callback, arg);
|
Py_VISIT(closure->callback);
|
||||||
if (ret != 0) return ret;
|
Py_VISIT(closure->extra_args);
|
||||||
|
Py_VISIT(closure->swap_data);
|
||||||
if (closure->extra_args) ret = visit(closure->extra_args, arg);
|
|
||||||
if (ret != 0) return ret;
|
|
||||||
|
|
||||||
if (closure->swap_data) ret = visit(closure->swap_data, arg);
|
|
||||||
if (ret != 0) return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->obj && GST_OBJECT_REFCOUNT_VALUE(self->obj) == 1) {
|
if (self->obj && GST_OBJECT_REFCOUNT_VALUE(self->obj) == 1 && GST_OBJECT(self->obj)->parent == NULL) {
|
||||||
GST_DEBUG_OBJECT(self->obj,
|
GST_DEBUG_OBJECT(self->obj,
|
||||||
"gst.Object.tp_traverse: GstObject refcount of %p is 1, visit",
|
"gst.Object.tp_traverse: GstObject refcount of %p is 1, visit",
|
||||||
self->obj);
|
self->obj);
|
||||||
|
@ -106,7 +99,10 @@ _wrap_gst_object_tp_clear(PyGObject *self)
|
||||||
if (! GST_IS_OBJECT (obj))
|
if (! GST_IS_OBJECT (obj))
|
||||||
obj = NULL;
|
obj = NULL;
|
||||||
else {
|
else {
|
||||||
GST_DEBUG_OBJECT (obj, "gst.Object.tp_clear");
|
GST_DEBUG_OBJECT (obj,
|
||||||
|
"gst.Object.tp_clear, pyo %p, pyo rc %d, gsto %p, gst rc %d",
|
||||||
|
self, ((PyObject *) self)->ob_refcnt, obj,
|
||||||
|
GST_OBJECT_REFCOUNT_VALUE (obj));
|
||||||
g_object_ref (obj);
|
g_object_ref (obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue