[gstreamer-bugs] [Bug 510705] New: Core dump when calling add_singal_watch on a pipeline with gnonlin from within a function.

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Sat Jan 19 16:07:52 PST 2008


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=510705

  GStreamer | gnonlin | Ver: 0.10.0
           Summary: Core dump when calling add_singal_watch on a pipeline
                    with gnonlin from within a function.
           Product: GStreamer
           Version: 0.10.0
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gnonlin
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: dskippy at ccs.neu.edu
         QAContact: bilboed at bilboed.com
     GNOME version: Unspecified
   GNOME milestone: Unspecified


# To run this program, first call this command in another window
# gst-launch tcpserversrc host=127.0.0.1 port=3000 ! mad ! alsasink

# You will likely need to copy a file into the current working directory
# called file1.mp3. Next run this program with python. You should here
# the first few seconds of that mp3 files played streamed to the gst-launch
# command you ran earlier.

# The body of playStream and the else branch at the bottom are identical.
# Toggling the use_func flag will cause the program to use the function
# or the else clause as its stream. Set the flag to True and rerun the
# gst-launch command and also this program and you will see a core dump
# and the following message:
# play_stream.py:72: Warning: invalid unclassed pointer in cast to `GstBaseSrc'

# It is odd to me that this should work from the else clause but not
# from a function. Also I notice that if you comment out the call to
# bus.add_signal_watch() in the function body it works as well.

# I'm sorry the code is so long but I couldn't manage to reduce this anymore.
# It's really a pretty quirky bug.

import gobject
import pygst
pygst.require("0.10")
import gst

use_func = False

def playStream ():
        pipeline = gst.Pipeline()
        adder = gst.element_factory_make("adder")
        lame = gst.element_factory_make("lame")
        tcpclientsink = gst.element_factory_make("tcpclientsink")
        tcpclientsink.set_property("host", "127.0.0.1")
        tcpclientsink.set_property("port", 3000)
        pipeline.add(adder, lame, tcpclientsink)
        gst.element_link_many(adder, lame, tcpclientsink)
        comp = gst.element_factory_make("gnlcomposition")
        compconvert = gst.element_factory_make("audioconvert")
        pipeline.add(comp, compconvert)
        def OnPad (comp, pad):
                convpad = compconvert.get_compatible_pad(pad, pad.get_caps())
                pad.link(convpad)
        comp.connect("pad-added", OnPad)
        acsrcpad = compconvert.get_pad('src')
        addersinkpad = adder.get_request_pad('sink%d')
        acsrcpad.link(addersinkpad)
        audio = gst.element_factory_make("gnlfilesource") 
        comp.add(audio) 
        audio.set_property("location", "file1.mp3") 
        audio.set_property("start", 0 * gst.SECOND) 
        audio.set_property("duration", 3 * gst.SECOND) 
        audio.set_property("media-start", 0 * gst.SECOND) 
        audio.set_property("media-duration", 3 * gst.SECOND) 
        pipeline.set_state(gst.STATE_PLAYING)
        bus = pipeline.get_bus()
        bus.add_signal_watch()

if use_func:
        playStream()
else:
        pipeline = gst.Pipeline()
        adder = gst.element_factory_make("adder")
        lame = gst.element_factory_make("lame")
        tcpclientsink = gst.element_factory_make("tcpclientsink")
        tcpclientsink.set_property("host", "127.0.0.1")
        tcpclientsink.set_property("port", 3000)
        pipeline.add(adder, lame, tcpclientsink)
        gst.element_link_many(adder, lame, tcpclientsink)
        comp = gst.element_factory_make("gnlcomposition")
        compconvert = gst.element_factory_make("audioconvert")
        pipeline.add(comp, compconvert)
        def OnPad (comp, pad):
                convpad = compconvert.get_compatible_pad(pad, pad.get_caps())
                pad.link(convpad)
        comp.connect("pad-added", OnPad)
        acsrcpad = compconvert.get_pad('src')
        addersinkpad = adder.get_request_pad('sink%d')
        acsrcpad.link(addersinkpad)
        audio = gst.element_factory_make("gnlfilesource") 
        comp.add(audio) 
        audio.set_property("location", "file1.mp3") 
        audio.set_property("start", 0 * gst.SECOND) 
        audio.set_property("duration", 3 * gst.SECOND) 
        audio.set_property("media-start", 0 * gst.SECOND) 
        audio.set_property("media-duration", 3 * gst.SECOND) 
        pipeline.set_state(gst.STATE_PLAYING)
        bus = pipeline.get_bus()
        bus.add_signal_watch()

gobject.MainLoop().run()


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=510705.




More information about the Gstreamer-bugs mailing list