gstreamer/common.override: Attempt to handle GstBuffer vs GstData better
authorDavid I. Lehn <dlehn@users.sourceforge.net>
Tue, 24 Feb 2004 18:47:32 +0000 (18:47 +0000)
committerDavid I. Lehn <dlehn@users.sourceforge.net>
Tue, 24 Feb 2004 18:47:32 +0000 (18:47 +0000)
Original commit message from CVS:
* gstreamer/common.override:
Attempt to handle GstBuffer vs GstData better

ChangeLog
gst/common.override
gstreamer/common.override

index 252aea0..b8ef8ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-24  David I. Lehn  <dlehn@users.sourceforge.net>
+
+       * gstreamer/common.override:
+       Attempt to handle GstBuffer vs GstData better
+
 2004-02-24  Johan Dahlin  <johan@gnome.org>
 
        * gstreamer/gstreamer.defs: rename all functions, remove
index be4491f..f93b430 100644 (file)
@@ -132,7 +132,7 @@ _wrap_gst_pad_set_link_function (PyGObject *self,
 override gst_pad_set_chain_function kwargs
 
 static void
-call_chain_function(GstPad *pad, GstBuffer *buf)
+call_chain_function(GstPad *pad, GstData *data)
 {
        PyObject *function;
 
@@ -140,10 +140,17 @@ call_chain_function(GstPad *pad, GstBuffer *buf)
 
        pyg_block_threads();
 
-       PyObject_CallFunction (function,
-                       "OO", 
-                       pad_private(pad)->pad,
-                       pyg_boxed_new(GST_TYPE_BUFFER, buf, TRUE, TRUE));
+       if (GST_IS_BUFFER(data)) {
+               PyObject_CallFunction (function,
+                               "OO", 
+                               pad_private(pad)->pad,
+                               pyg_boxed_new(GST_TYPE_BUFFER, data, TRUE, TRUE));
+       } else if (GST_IS_EVENT(data)) {
+               PyObject_CallFunction (function,
+                               "OO", 
+                               pad_private(pad)->pad,
+                               pyg_boxed_new(GST_TYPE_EVENT, data, TRUE, TRUE));
+       }
 
        if (PyErr_Occurred ()) {
                PyErr_Print ();
index be4491f..f93b430 100644 (file)
@@ -132,7 +132,7 @@ _wrap_gst_pad_set_link_function (PyGObject *self,
 override gst_pad_set_chain_function kwargs
 
 static void
-call_chain_function(GstPad *pad, GstBuffer *buf)
+call_chain_function(GstPad *pad, GstData *data)
 {
        PyObject *function;
 
@@ -140,10 +140,17 @@ call_chain_function(GstPad *pad, GstBuffer *buf)
 
        pyg_block_threads();
 
-       PyObject_CallFunction (function,
-                       "OO", 
-                       pad_private(pad)->pad,
-                       pyg_boxed_new(GST_TYPE_BUFFER, buf, TRUE, TRUE));
+       if (GST_IS_BUFFER(data)) {
+               PyObject_CallFunction (function,
+                               "OO", 
+                               pad_private(pad)->pad,
+                               pyg_boxed_new(GST_TYPE_BUFFER, data, TRUE, TRUE));
+       } else if (GST_IS_EVENT(data)) {
+               PyObject_CallFunction (function,
+                               "OO", 
+                               pad_private(pad)->pad,
+                               pyg_boxed_new(GST_TYPE_EVENT, data, TRUE, TRUE));
+       }
 
        if (PyErr_Occurred ()) {
                PyErr_Print ();