Is it possible to receive Gstreamer signals in Python?

sukirti kaw sukirtikaw at gmail.com
Wed Sep 7 05:47:17 PDT 2011


Hello,

I have to develop a framework for video conferencing using RTP in Python. To
start with I tried to use the examples under
http://blog.abourget.net/2009/6/14/gstreamer-rtp-and-live-streaming/ and
they work.

Now on the video receiver side I need to add the signal on_new_ssrc to
notify if a new SSRC has entered that session. I did not find any example
using this in gst python. Is it possible to receive Gstreamer signals in
python?

I tried using:
def on_new_ssrc(rtpbin,session,ssrc,user_data):
struct = gst.Structure('on_new_ssrc')
rtpbin.post_message(gst.message_new_application(rtpbin, struct))
print "new ssrc"
print " session", session
print " ssrc", ssrc
rtpbin = pipeline.get_by_name('rtpbin')
rtpbin.connect('on-new-ssrc', on_new_ssrc)

def application_message(bus, msg):
#Receive application messages from the bus.
bus = pipeline.get_bus()
bus.add_signal_watch()
bus.connect('message::application', application_message)
msgtype = msg.structure.get_name()
if msgtype == 'on_new_ssrc':
pipeline.set_state(gst.STATE_NULL)
elif msgtype == 'error':
pipeline.set_state(gst.STATE_PAUSED)
print "MESSAGE_ERROR"
err, debug = message.parse_error()
logger.error("ERROR: %s, %s" % (err, debug) )

But this does not work.

Is it possible to do so. Please provide with some examples.

Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110907/757b0db0/attachment.htm>


More information about the gstreamer-devel mailing list