summaryrefslogtreecommitdiff
path: root/gst/pygstminiobject.c
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2005-07-12 09:45:58 +0000
committerEdward Hervey <bilboed@bilboed.com>2005-07-12 09:45:58 +0000
commitae75cbd54bd7a6d7b4fef9a41d2dc7fbf29eb3dc (patch)
tree12663bd08c94a071fc9c0545da8fd39c224658d9 /gst/pygstminiobject.c
parentbc47432fc8a9b9b4879120ec34a5340ed8198a92 (diff)
gst/: Added GError wrapping,
Original commit message from CVS: * gst/gst-types.defs: * gst/gst.defs: Added GError wrapping, Removed data field from Buffer, Added virtual methods to object Updated to latest API * gst/gst.override: wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(), gst_registry_pool_list() * gst/gstbuffer.override: gst.Buffer() works get/setters fixed wrapped gst_buffer_stamp() * gst/gstbus.override: wrapped gst_bus_set_sync_handler() and gst_bus_add_watch() * gst/gstelement.override: wrapped gst_element_send_event(), gst_element_factory_get_pad_templates() gst_element_query_convert(), gst_element_get_query_types() * gst/gstevent.override: wrapped gst_event_discont_get_value() * gst/gstmessage.override: wrapped gst_message_parse_state_changed(), gst_message_parse_error(), gst_message_parse_warning(), gst_message_parse_tag() * gst/gstmodule.c: Added registration of new fundamental type with pygtk * gst/gstpad.override: wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(), gst_pad_query_position(), gst_pad_query_convert() * gst/gstquery.override: wrapped gst_query_parse_position(), gst_query_parse_convert(), gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse() * gst/pygstminiobject.c: fixes * gst/Makefile.am: added gstbus.override, gstmessage.override, gstquery.override * testsuite/test_buffer.py: * testsuite/test_element.py: * testsuite/test_event.py: * testsuite/test_pipeline.py: Updating testsuites
Diffstat (limited to 'gst/pygstminiobject.c')
-rw-r--r--gst/pygstminiobject.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gst/pygstminiobject.c b/gst/pygstminiobject.c
index 4c438e9..a511e0e 100644
--- a/gst/pygstminiobject.c
+++ b/gst/pygstminiobject.c
@@ -54,9 +54,15 @@ pygst_miniobject_init()
PyTypeObject *
pygstminiobject_lookup_class(GType gtype)
{
- PyTypeObject *py_type;
+ PyTypeObject *py_type = NULL;
+ GType ctype = gtype;
- py_type = g_type_get_qdata(gtype, pygstminiobject_class_key);
+ while (!py_type && ctype) {
+ py_type = g_type_get_qdata(ctype, pygstminiobject_class_key);
+ ctype = g_type_parent(ctype);
+ }
+ if (!ctype)
+ g_error ("Couldn't find a good base type!!");
return py_type;
}
@@ -184,6 +190,8 @@ pygstminiobject_new(GstMiniObject *obj)
} else {
/* create wrapper */
PyTypeObject *tp = pygstminiobject_lookup_class(G_OBJECT_TYPE(obj));
+ if (!tp)
+ g_warning ("Couldn't get class for type object : %p", obj);
/* need to bump type refcount if created with
pygstminiobject_new_with_interfaces(). fixes bug #141042 */
if (tp->tp_flags & Py_TPFLAGS_HEAPTYPE)
@@ -214,6 +222,8 @@ pygstminiobject_dealloc(PyGstMiniObject *self)
{
GstMiniObject *obj = NULL;
+ g_return_if_fail (self != NULL);
+
PyGILState_STATE state;
state = pyg_gil_state_ensure();