gst/gstbus.override: Raise an exception if the callback doesn't return anything
Original commit message from CVS: * gst/gstbus.override: (bus_handler) (bus_sync_handler): Raise an exception if the callback doesn't return anything * gst/pygstminiobject.c: removed the 'ref' and 'unref' methods
This commit is contained in:
parent
d32e28af85
commit
19dd2cc030
@ -1,3 +1,11 @@
|
|||||||
|
2005-07-13 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
|
* gst/gstbus.override: (bus_handler) (bus_sync_handler):
|
||||||
|
Raise an exception if the callback doesn't return anything
|
||||||
|
|
||||||
|
* gst/pygstminiobject.c:
|
||||||
|
removed the 'ref' and 'unref' methods
|
||||||
|
|
||||||
2005-07-13 Andy Wingo <wingo@pobox.com>
|
2005-07-13 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
* examples/pipeline-tester: Tweaks, show messages.
|
* examples/pipeline-tester: Tweaks, show messages.
|
||||||
|
@ -55,7 +55,11 @@ bus_sync_handler (GstBus *bus, GstMessage *message, gpointer user_data)
|
|||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
res = GST_BUS_PASS;
|
res = GST_BUS_PASS;
|
||||||
} else {
|
} else {
|
||||||
if (pyg_enum_get_value(GST_TYPE_BUS_SYNC_REPLY, ret, (gint *) &res))
|
if (ret == Py_None) {
|
||||||
|
PyErr_SetString(PyExc_TypeError, "callback should return a BusSyncReply");
|
||||||
|
PyErr_Print();
|
||||||
|
res = GST_BUS_PASS;
|
||||||
|
} else if (pyg_enum_get_value(GST_TYPE_BUS_SYNC_REPLY, ret, (gint *) &res))
|
||||||
res = GST_BUS_PASS;
|
res = GST_BUS_PASS;
|
||||||
Py_DECREF (ret);
|
Py_DECREF (ret);
|
||||||
}
|
}
|
||||||
@ -101,6 +105,11 @@ bus_handler (GstBus *bus, GstMessage *message, gpointer user_data)
|
|||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
if (ret == Py_None) {
|
||||||
|
PyErr_SetString(PyExc_TypeError, "callback should return True or False");
|
||||||
|
PyErr_Print();
|
||||||
|
res = TRUE;
|
||||||
|
} else
|
||||||
res = PyObject_IsTrue(ret);
|
res = PyObject_IsTrue(ret);
|
||||||
Py_DECREF(ret);
|
Py_DECREF(ret);
|
||||||
}
|
}
|
||||||
|
@ -405,27 +405,10 @@ pygstminiobject_copy(PyGstMiniObject *self, PyObject *args)
|
|||||||
return pygstminiobject_new(gst_mini_object_copy(self->obj));
|
return pygstminiobject_new(gst_mini_object_copy(self->obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
pygstminiobject_ref(PyGstMiniObject *self, PyObject *args)
|
|
||||||
{
|
|
||||||
gst_mini_object_ref(self->obj);
|
|
||||||
return (PyObject*) self;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
pygstminiobject_unref(PyGstMiniObject *self, PyObject *args)
|
|
||||||
{
|
|
||||||
gst_mini_object_ref(self->obj);
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
return Py_None;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyMethodDef pygstminiobject_methods[] = {
|
static PyMethodDef pygstminiobject_methods[] = {
|
||||||
{ "__gstminiobject_init__", (PyCFunction)pygstminiobject__gstminiobject_init__,
|
{ "__gstminiobject_init__", (PyCFunction)pygstminiobject__gstminiobject_init__,
|
||||||
METH_VARARGS|METH_KEYWORDS },
|
METH_VARARGS|METH_KEYWORDS },
|
||||||
{ "copy", (PyCFunction)pygstminiobject_copy, METH_VARARGS, "Copies the miniobject"},
|
{ "copy", (PyCFunction)pygstminiobject_copy, METH_VARARGS, "Copies the miniobject"},
|
||||||
{ "ref", (PyCFunction)pygstminiobject_ref, METH_VARARGS, "Adds a reference to the miniobject" },
|
|
||||||
{ "unref", (PyCFunction)pygstminiobject_unref, METH_VARARGS, "Removes a reference from the miniobject"},
|
|
||||||
{ NULL, NULL, 0 }
|
{ NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user