From 0a5f74f8732fc96a3a59714ce216eb783d7b947a Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 10 Jan 2003 00:18:33 +0000 Subject: [PATCH] update to new GstPad/GstElement link API and remove old hacks to call GObject connect method Original commit message from CVS: update to new GstPad/GstElement link API and remove old hacks to call GObject connect method --- ChangeLog | 8 ++++++++ examples/gst/cp.py | 6 +++--- examples/gst/dvdplay.py | 34 +++++++++++++++++----------------- examples/gst/f2f.py | 8 ++++---- examples/gst/identity.py | 10 +++++----- examples/gst/ilat.py | 4 ++-- examples/gst/lat.py | 14 +++++++------- examples/gst/oggplay.py | 4 ++-- examples/gstreamer/cp.py | 6 +++--- examples/gstreamer/dvdplay.py | 34 +++++++++++++++++----------------- examples/gstreamer/f2f.py | 8 ++++---- examples/gstreamer/identity.py | 10 +++++----- examples/gstreamer/ilat.py | 4 ++-- examples/gstreamer/lat.py | 14 +++++++------- examples/gstreamer/oggplay.py | 4 ++-- gst/gstreamer.override | 34 +++++++++++++++++----------------- gstreamer/gstreamer.override | 34 +++++++++++++++++----------------- 17 files changed, 122 insertions(+), 114 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6dc5414536..f1bd22d207 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-01-09 David I. Lehn + + * examples/gstreamer/*, gstreamer/gstreamer.override: update to new + GstPad/GstElement link API and remove old hacks to call GObject + connect method + + * gstreamer/Makefile.am: ignore gstcompat.h + 2003-01-04 David I. Lehn * gstreamer/gstreamer.override, gstreamer/gstreamer-extra.defs: add diff --git a/examples/gst/cp.py b/examples/gst/cp.py index 5119200350..f54d355393 100755 --- a/examples/gst/cp.py +++ b/examples/gst/cp.py @@ -55,11 +55,11 @@ def filter(filters): for e in elements: bin.add(e) - # connect the elements + # link the elements previous = None for e in elements: if previous: - previous.connect(e) + previous.link(e) previous = e # start playing @@ -84,7 +84,7 @@ def main(): stats.set_property('silent', 0) stats.set_property('buffer_update_freq', 1) stats.set_property('update_on_eos', 1) - #GObject.connect(stats, 'update', update) + #stats.connect('update', update) return filter([stats]) diff --git a/examples/gst/dvdplay.py b/examples/gst/dvdplay.py index 5ca5244078..0966a67199 100755 --- a/examples/gst/dvdplay.py +++ b/examples/gst/dvdplay.py @@ -46,13 +46,13 @@ class DVDPlayer(object): #gtk.threads_enter() print '***** a new pad %s was created' % pad.get_name() if pad.get_name()[:6] == 'video_': - pad.connect(self.v_queue.get_pad('sink')) + pad.link(self.v_queue.get_pad('sink')) self.pipeline.set_state(STATE_PAUSED) self.pipeline.add(self.v_thread) #self.v_thread.set_state(STATE_PLAYING) self.pipeline.set_state(STATE_PLAYING) elif pad.get_name() == 'private_stream_1.0': - pad.connect(self.a_queue.get_pad('sink')) + pad.link(self.a_queue.get_pad('sink')) self.pipeline.set_state(STATE_PAUSED) self.pipeline.add(self.a_thread) #self.a_thread.set_state(STATE_PLAYING); @@ -146,14 +146,14 @@ class DVDPlayer(object): for e in (self.v_queue, self.v_decode, self.color, self.efx, self.color2, self.deinterlace, self.show): self.v_thread.add(e) if last: - last.connect(e) + last.link(e) last = e - #self.v_queue.connect(self.v_decode) - #self.v_decode.connect(self.color) - #self.color.connect(self.efx) - #self.efx.connect(self.color2) - #self.color2.connect(self.show) + #self.v_queue.link(self.v_decode) + #self.v_decode.link(self.color) + #self.color.link(self.efx) + #self.efx.link(self.color2) + #self.color2.link(self.show) def build_audio_thread(self): # ***** pre-construct the audio thread ***** @@ -175,8 +175,8 @@ class DVDPlayer(object): for e in (self.a_queue, self.a_decode, self.osssink): self.a_thread.add(e) - self.a_queue.connect(self.a_decode) - self.a_decode.connect(self.osssink) + self.a_queue.link(self.a_decode) + self.a_decode.link(self.osssink) def build(self): # ***** construct the main pipeline ***** @@ -186,7 +186,7 @@ class DVDPlayer(object): self.src = gst_element_factory_make('dvdreadsrc','src'); assert self.src - GObject.connect(self.src,'deep_notify',self.dnprint) + self.src.connect('deep_notify',self.dnprint) self.src.set_property('location', self.location) self.src.set_property('title', self.title) self.src.set_property('chapter', self.chapter) @@ -199,7 +199,7 @@ class DVDPlayer(object): self.pipeline.add(self.src) self.pipeline.add(self.parse) - self.src.connect(self.parse) + self.src.link(self.parse) # pre-construct the audio/video threads self.build_video_thread() @@ -218,12 +218,12 @@ class DVDPlayer(object): #gtk_socket_steal (GTK_SOCKET (gtk_socket), #gst_util_get_int_arg (GTK_OBJECT(show), 'xid')); - GObject.connect(self.parse,'new_pad',self.mpegparse_newpad, self.pipeline) - GObject.connect(self.src,'eos',self.eof) - #GObject.connect(show,'have_size',self.mpegparse_have_size, self.pipeline) + self.parse.connect('new_pad',self.mpegparse_newpad, self.pipeline) + self.src.connect('eos',self.eof) + #show.connect('have_size',self.mpegparse_have_size, self.pipeline) - #GObject.connect(self.pipeline,'error',self.pipeline_error) - #GObject.connect(self.pipeline,'deep_notify',self.dnprint) + #self.pipeline.connect('error',self.pipeline_error) + #self.pipeline.connect('deep_notify',self.dnprint) return 0 diff --git a/examples/gst/f2f.py b/examples/gst/f2f.py index 69aec9e987..38778cea31 100755 --- a/examples/gst/f2f.py +++ b/examples/gst/f2f.py @@ -35,21 +35,21 @@ def main(): src = gst_element_factory_make('fakesrc', 'src') assert src - GObject.connect(src, 'handoff', handoff) + src.connect('handoff', handoff) src.set_property('silent', 1) src.set_property('num_buffers', 10) sink = gst_element_factory_make('fakesink', 'sink') assert sink - GObject.connect(sink, 'handoff', handoff) + sink.connect('handoff', handoff) src.set_property('silent', 1) # add objects to the main pipeline for e in (src, sink): bin.add(e) - # connect the elements - res = src.connect(sink) + # link the elements + res = src.link(sink) assert res # start playing diff --git a/examples/gst/identity.py b/examples/gst/identity.py index 035f77c4e9..a886e8511f 100755 --- a/examples/gst/identity.py +++ b/examples/gst/identity.py @@ -32,19 +32,19 @@ class Identity(Element): self.sinkpad = Pad('sink', PAD_SINK) self.add_pad(self.sinkpad) self.sinkpad.set_chain_function(self.chain) - self.sinkpad.set_connect_function(self.pad_connect) + self.sinkpad.set_link_function(self.pad_link) self.srcpad = Pad('src', PAD_SRC) self.add_pad(self.srcpad) - self.srcpad.set_connect_function(self.pad_connect) + self.srcpad.set_link_function(self.pad_link) def get_bufferpool(self, pad): print 'get_bufferpool:', self, pad return self.srcpad.get_bufferpool() - def pad_connect(self, pad, caps): - print 'pad_connect:', self, pad, caps - return PAD_CONNECT_OK + def pad_link(self, pad, caps): + print 'pad_link:', self, pad, caps + return PAD_LINK_OK def chain(self, pad, buf): self.srcpad.push(buf) diff --git a/examples/gst/ilat.py b/examples/gst/ilat.py index 90bbd41a63..a8c2e85292 100755 --- a/examples/gst/ilat.py +++ b/examples/gst/ilat.py @@ -48,11 +48,11 @@ def build(filters, b): for e in elements: bin.add(e) - # connect the elements + # link the elements previous = None for e in elements: if previous: - previous.connect(e) + previous.link(e) previous = e return bin diff --git a/examples/gst/lat.py b/examples/gst/lat.py index 6760c8bcd5..0721e431d6 100755 --- a/examples/gst/lat.py +++ b/examples/gst/lat.py @@ -67,7 +67,7 @@ def identity_add(pipeline, first, count): assert ident ident.set_property('silent', 1) pipeline.add(ident) - last.get_pad('src').connect(ident.get_pad('sink')) + last.get_pad('src').link(ident.get_pad('sink')) last = ident return last @@ -77,14 +77,14 @@ def fakesrc(): assert src src.set_property('silent', 1) src.set_property('num_buffers', iterations) - GObject.connect(src, 'handoff', handoff_src) + src.connect('handoff', handoff_src) return src def fakesink(): sink = gst_element_factory_make('fakesink','fakesink') assert sink sink.set_property('silent', 1) - GObject.connect(sink, 'handoff', handoff_sink) + sink.connect('handoff', handoff_sink) return sink def simple(argv): @@ -103,7 +103,7 @@ def simple(argv): last = identity_add(pipeline, src, idents) sink = fakesink() pipeline.add(sink) - last.get_pad('src').connect(sink.get_pad('sink')) + last.get_pad('src').link(sink.get_pad('sink')) return pipeline @@ -129,7 +129,7 @@ def queue(argv): src_q = gst_element_factory_make('queue','src_q') assert src_q src_thr.add(src_q) - src.get_pad('src').connect(src_q.get_pad('sink')) + src.get_pad('src').link(src_q.get_pad('sink')) pipeline.add(src_thr) @@ -138,7 +138,7 @@ def queue(argv): sink_q = gst_element_factory_make('queue','sink_q') assert sink_q pipeline.add(sink_q) - last.get_pad('src').connect(sink_q.get_pad('sink')) + last.get_pad('src').link(sink_q.get_pad('sink')) sink_thr = Thread('sink_thread') assert sink_thr @@ -150,7 +150,7 @@ def queue(argv): pipeline.add(sink_thr) - sink_q.get_pad('src').connect(sink.get_pad('sink')) + sink_q.get_pad('src').link(sink.get_pad('sink')) return pipeline diff --git a/examples/gst/oggplay.py b/examples/gst/oggplay.py index ee35fa247f..96a84694d3 100755 --- a/examples/gst/oggplay.py +++ b/examples/gst/oggplay.py @@ -58,11 +58,11 @@ def main(): for e in (filesrc, decoder, osssink): bin.add(e) - # connect the elements + # link the elements previous = None for e in (filesrc, decoder, osssink): if previous: - previous.connect(e) + previous.link(e) previous = e # start playing diff --git a/examples/gstreamer/cp.py b/examples/gstreamer/cp.py index 5119200350..f54d355393 100755 --- a/examples/gstreamer/cp.py +++ b/examples/gstreamer/cp.py @@ -55,11 +55,11 @@ def filter(filters): for e in elements: bin.add(e) - # connect the elements + # link the elements previous = None for e in elements: if previous: - previous.connect(e) + previous.link(e) previous = e # start playing @@ -84,7 +84,7 @@ def main(): stats.set_property('silent', 0) stats.set_property('buffer_update_freq', 1) stats.set_property('update_on_eos', 1) - #GObject.connect(stats, 'update', update) + #stats.connect('update', update) return filter([stats]) diff --git a/examples/gstreamer/dvdplay.py b/examples/gstreamer/dvdplay.py index 5ca5244078..0966a67199 100755 --- a/examples/gstreamer/dvdplay.py +++ b/examples/gstreamer/dvdplay.py @@ -46,13 +46,13 @@ class DVDPlayer(object): #gtk.threads_enter() print '***** a new pad %s was created' % pad.get_name() if pad.get_name()[:6] == 'video_': - pad.connect(self.v_queue.get_pad('sink')) + pad.link(self.v_queue.get_pad('sink')) self.pipeline.set_state(STATE_PAUSED) self.pipeline.add(self.v_thread) #self.v_thread.set_state(STATE_PLAYING) self.pipeline.set_state(STATE_PLAYING) elif pad.get_name() == 'private_stream_1.0': - pad.connect(self.a_queue.get_pad('sink')) + pad.link(self.a_queue.get_pad('sink')) self.pipeline.set_state(STATE_PAUSED) self.pipeline.add(self.a_thread) #self.a_thread.set_state(STATE_PLAYING); @@ -146,14 +146,14 @@ class DVDPlayer(object): for e in (self.v_queue, self.v_decode, self.color, self.efx, self.color2, self.deinterlace, self.show): self.v_thread.add(e) if last: - last.connect(e) + last.link(e) last = e - #self.v_queue.connect(self.v_decode) - #self.v_decode.connect(self.color) - #self.color.connect(self.efx) - #self.efx.connect(self.color2) - #self.color2.connect(self.show) + #self.v_queue.link(self.v_decode) + #self.v_decode.link(self.color) + #self.color.link(self.efx) + #self.efx.link(self.color2) + #self.color2.link(self.show) def build_audio_thread(self): # ***** pre-construct the audio thread ***** @@ -175,8 +175,8 @@ class DVDPlayer(object): for e in (self.a_queue, self.a_decode, self.osssink): self.a_thread.add(e) - self.a_queue.connect(self.a_decode) - self.a_decode.connect(self.osssink) + self.a_queue.link(self.a_decode) + self.a_decode.link(self.osssink) def build(self): # ***** construct the main pipeline ***** @@ -186,7 +186,7 @@ class DVDPlayer(object): self.src = gst_element_factory_make('dvdreadsrc','src'); assert self.src - GObject.connect(self.src,'deep_notify',self.dnprint) + self.src.connect('deep_notify',self.dnprint) self.src.set_property('location', self.location) self.src.set_property('title', self.title) self.src.set_property('chapter', self.chapter) @@ -199,7 +199,7 @@ class DVDPlayer(object): self.pipeline.add(self.src) self.pipeline.add(self.parse) - self.src.connect(self.parse) + self.src.link(self.parse) # pre-construct the audio/video threads self.build_video_thread() @@ -218,12 +218,12 @@ class DVDPlayer(object): #gtk_socket_steal (GTK_SOCKET (gtk_socket), #gst_util_get_int_arg (GTK_OBJECT(show), 'xid')); - GObject.connect(self.parse,'new_pad',self.mpegparse_newpad, self.pipeline) - GObject.connect(self.src,'eos',self.eof) - #GObject.connect(show,'have_size',self.mpegparse_have_size, self.pipeline) + self.parse.connect('new_pad',self.mpegparse_newpad, self.pipeline) + self.src.connect('eos',self.eof) + #show.connect('have_size',self.mpegparse_have_size, self.pipeline) - #GObject.connect(self.pipeline,'error',self.pipeline_error) - #GObject.connect(self.pipeline,'deep_notify',self.dnprint) + #self.pipeline.connect('error',self.pipeline_error) + #self.pipeline.connect('deep_notify',self.dnprint) return 0 diff --git a/examples/gstreamer/f2f.py b/examples/gstreamer/f2f.py index 69aec9e987..38778cea31 100755 --- a/examples/gstreamer/f2f.py +++ b/examples/gstreamer/f2f.py @@ -35,21 +35,21 @@ def main(): src = gst_element_factory_make('fakesrc', 'src') assert src - GObject.connect(src, 'handoff', handoff) + src.connect('handoff', handoff) src.set_property('silent', 1) src.set_property('num_buffers', 10) sink = gst_element_factory_make('fakesink', 'sink') assert sink - GObject.connect(sink, 'handoff', handoff) + sink.connect('handoff', handoff) src.set_property('silent', 1) # add objects to the main pipeline for e in (src, sink): bin.add(e) - # connect the elements - res = src.connect(sink) + # link the elements + res = src.link(sink) assert res # start playing diff --git a/examples/gstreamer/identity.py b/examples/gstreamer/identity.py index 035f77c4e9..a886e8511f 100755 --- a/examples/gstreamer/identity.py +++ b/examples/gstreamer/identity.py @@ -32,19 +32,19 @@ class Identity(Element): self.sinkpad = Pad('sink', PAD_SINK) self.add_pad(self.sinkpad) self.sinkpad.set_chain_function(self.chain) - self.sinkpad.set_connect_function(self.pad_connect) + self.sinkpad.set_link_function(self.pad_link) self.srcpad = Pad('src', PAD_SRC) self.add_pad(self.srcpad) - self.srcpad.set_connect_function(self.pad_connect) + self.srcpad.set_link_function(self.pad_link) def get_bufferpool(self, pad): print 'get_bufferpool:', self, pad return self.srcpad.get_bufferpool() - def pad_connect(self, pad, caps): - print 'pad_connect:', self, pad, caps - return PAD_CONNECT_OK + def pad_link(self, pad, caps): + print 'pad_link:', self, pad, caps + return PAD_LINK_OK def chain(self, pad, buf): self.srcpad.push(buf) diff --git a/examples/gstreamer/ilat.py b/examples/gstreamer/ilat.py index 90bbd41a63..a8c2e85292 100755 --- a/examples/gstreamer/ilat.py +++ b/examples/gstreamer/ilat.py @@ -48,11 +48,11 @@ def build(filters, b): for e in elements: bin.add(e) - # connect the elements + # link the elements previous = None for e in elements: if previous: - previous.connect(e) + previous.link(e) previous = e return bin diff --git a/examples/gstreamer/lat.py b/examples/gstreamer/lat.py index 6760c8bcd5..0721e431d6 100755 --- a/examples/gstreamer/lat.py +++ b/examples/gstreamer/lat.py @@ -67,7 +67,7 @@ def identity_add(pipeline, first, count): assert ident ident.set_property('silent', 1) pipeline.add(ident) - last.get_pad('src').connect(ident.get_pad('sink')) + last.get_pad('src').link(ident.get_pad('sink')) last = ident return last @@ -77,14 +77,14 @@ def fakesrc(): assert src src.set_property('silent', 1) src.set_property('num_buffers', iterations) - GObject.connect(src, 'handoff', handoff_src) + src.connect('handoff', handoff_src) return src def fakesink(): sink = gst_element_factory_make('fakesink','fakesink') assert sink sink.set_property('silent', 1) - GObject.connect(sink, 'handoff', handoff_sink) + sink.connect('handoff', handoff_sink) return sink def simple(argv): @@ -103,7 +103,7 @@ def simple(argv): last = identity_add(pipeline, src, idents) sink = fakesink() pipeline.add(sink) - last.get_pad('src').connect(sink.get_pad('sink')) + last.get_pad('src').link(sink.get_pad('sink')) return pipeline @@ -129,7 +129,7 @@ def queue(argv): src_q = gst_element_factory_make('queue','src_q') assert src_q src_thr.add(src_q) - src.get_pad('src').connect(src_q.get_pad('sink')) + src.get_pad('src').link(src_q.get_pad('sink')) pipeline.add(src_thr) @@ -138,7 +138,7 @@ def queue(argv): sink_q = gst_element_factory_make('queue','sink_q') assert sink_q pipeline.add(sink_q) - last.get_pad('src').connect(sink_q.get_pad('sink')) + last.get_pad('src').link(sink_q.get_pad('sink')) sink_thr = Thread('sink_thread') assert sink_thr @@ -150,7 +150,7 @@ def queue(argv): pipeline.add(sink_thr) - sink_q.get_pad('src').connect(sink.get_pad('sink')) + sink_q.get_pad('src').link(sink.get_pad('sink')) return pipeline diff --git a/examples/gstreamer/oggplay.py b/examples/gstreamer/oggplay.py index ee35fa247f..96a84694d3 100755 --- a/examples/gstreamer/oggplay.py +++ b/examples/gstreamer/oggplay.py @@ -58,11 +58,11 @@ def main(): for e in (filesrc, decoder, osssink): bin.add(e) - # connect the elements + # link the elements previous = None for e in (filesrc, decoder, osssink): if previous: - previous.connect(e) + previous.link(e) previous = e # start playing diff --git a/gst/gstreamer.override b/gst/gstreamer.override index a698aeee72..bda16f6b47 100644 --- a/gst/gstreamer.override +++ b/gst/gstreamer.override @@ -30,7 +30,7 @@ headers typedef struct { PyGObject *pad; - PyObject *connect_function; + PyObject *link_function; PyObject *chain_function; } PyGstPadPrivate; @@ -68,16 +68,16 @@ ignore-glob gstreamer_*init *_get_type %% -override gst_pad_set_connect_function kwargs +override gst_pad_set_link_function kwargs -static GstPadConnectReturn -call_connect_function (GstPad *pad, GstCaps *caps) +static GstPadLinkReturn +call_link_function (GstPad *pad, GstCaps *caps) { PyObject *function; PyObject *retval; - GstPadConnectReturn ret; + GstPadLinkReturn ret; - function = pad_private(pad)->connect_function; + function = pad_private(pad)->link_function; pyg_block_threads(); @@ -89,7 +89,7 @@ call_connect_function (GstPad *pad, GstCaps *caps) if (PyErr_Occurred ()) { PyErr_Print (); pyg_unblock_threads(); - return GST_PAD_CONNECT_REFUSED; + return GST_PAD_LINK_REFUSED; } ret = PyInt_AsLong(retval); @@ -100,30 +100,30 @@ call_connect_function (GstPad *pad, GstCaps *caps) } static PyObject* -_wrap_gst_pad_set_connect_function (PyGObject *self, +_wrap_gst_pad_set_link_function (PyGObject *self, PyObject *args, PyObject *kwargs) { - static char *kwlist[] = { "connect_function", NULL }; - PyObject *connect_function; + static char *kwlist[] = { "link_function", NULL }; + PyObject *link_function; GstPad *pad; if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "O:GstPad.set_connect_funcion", + "O:GstPad.set_link_funcion", kwlist, - &connect_function)) { + &link_function)) { return NULL; } - if (!PyCallable_Check(connect_function)) { - PyErr_SetString(PyExc_TypeError, "connect_function not callable"); + if (!PyCallable_Check(link_function)) { + PyErr_SetString(PyExc_TypeError, "link_function not callable"); return NULL; } - Py_INCREF(connect_function); - py_pad_private(self)->connect_function = connect_function; + Py_INCREF(link_function); + py_pad_private(self)->link_function = link_function; pad = (GstPad*)pygobject_get(self); - gst_pad_set_connect_function(pad, call_connect_function); + gst_pad_set_link_function(pad, call_link_function); Py_INCREF(Py_None); return Py_None; diff --git a/gstreamer/gstreamer.override b/gstreamer/gstreamer.override index a698aeee72..bda16f6b47 100644 --- a/gstreamer/gstreamer.override +++ b/gstreamer/gstreamer.override @@ -30,7 +30,7 @@ headers typedef struct { PyGObject *pad; - PyObject *connect_function; + PyObject *link_function; PyObject *chain_function; } PyGstPadPrivate; @@ -68,16 +68,16 @@ ignore-glob gstreamer_*init *_get_type %% -override gst_pad_set_connect_function kwargs +override gst_pad_set_link_function kwargs -static GstPadConnectReturn -call_connect_function (GstPad *pad, GstCaps *caps) +static GstPadLinkReturn +call_link_function (GstPad *pad, GstCaps *caps) { PyObject *function; PyObject *retval; - GstPadConnectReturn ret; + GstPadLinkReturn ret; - function = pad_private(pad)->connect_function; + function = pad_private(pad)->link_function; pyg_block_threads(); @@ -89,7 +89,7 @@ call_connect_function (GstPad *pad, GstCaps *caps) if (PyErr_Occurred ()) { PyErr_Print (); pyg_unblock_threads(); - return GST_PAD_CONNECT_REFUSED; + return GST_PAD_LINK_REFUSED; } ret = PyInt_AsLong(retval); @@ -100,30 +100,30 @@ call_connect_function (GstPad *pad, GstCaps *caps) } static PyObject* -_wrap_gst_pad_set_connect_function (PyGObject *self, +_wrap_gst_pad_set_link_function (PyGObject *self, PyObject *args, PyObject *kwargs) { - static char *kwlist[] = { "connect_function", NULL }; - PyObject *connect_function; + static char *kwlist[] = { "link_function", NULL }; + PyObject *link_function; GstPad *pad; if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "O:GstPad.set_connect_funcion", + "O:GstPad.set_link_funcion", kwlist, - &connect_function)) { + &link_function)) { return NULL; } - if (!PyCallable_Check(connect_function)) { - PyErr_SetString(PyExc_TypeError, "connect_function not callable"); + if (!PyCallable_Check(link_function)) { + PyErr_SetString(PyExc_TypeError, "link_function not callable"); return NULL; } - Py_INCREF(connect_function); - py_pad_private(self)->connect_function = connect_function; + Py_INCREF(link_function); + py_pad_private(self)->link_function = link_function; pad = (GstPad*)pygobject_get(self); - gst_pad_set_connect_function(pad, call_connect_function); + gst_pad_set_link_function(pad, call_link_function); Py_INCREF(Py_None); return Py_None;