While testing pyclutter and gstreamer I got a problem: take a look on
the attached file, lines 26 and 27. If you try to comment line 27 and
decomment line 26 the sample will not work, still
$ gst-launch-0.10 souphttpsrc
location=http://www.warwick.ac.uk/newwebcam/cgi-bin/webcam.pl?dummy=garb
! multipartdemux ! jpegdec ! ffmpegcolorspace ! xvimagesink
this is working.
What am I doing wrong?
#!/usr/bin/env python
import sys
import clutter
import cluttergst
import gst
def main (args):
stage = clutter.Stage()
stage.set_size(1024, 768)
stage.set_color(clutter.color_parse('DarkSlateGrey'))
stage.connect('destroy', clutter.main_quit)
stage.connect('key-press-event', clutter.main_quit)
# Creates a gstreamer texture
video_texture = clutter.Texture()
video_texture.show()
pipeline = gst.Pipeline()
#src = gst.element_factory_make("audiotestsrc")
#goom = gst.element_factory_make("goom")
#colorspace = gst.element_factory_make("ffmpegcolorspace")
#start = gst.parse_bin_from_description("souphttpsrc location=http://www.warwick.ac.uk/newwebcam/cgi-bin/webcam.pl?dummy=garb ! multipartdemux ! jpegdec ! ffmpegcolorspace", True)
start = gst.parse_bin_from_description("videotestsrc ! ffmpegcolorspace" , True)
# Attaches the output texture to gstreamer sink
sink = cluttergst.VideoSink(video_texture)
#pipeline.add(src, goom, colorspace, sink)
pipeline.add(start, sink)
#gst.element_link_many(src, goom, colorspace, sink)
gst.element_link_many(start, sink)
pipeline.set_state(gst.STATE_PLAYING)
video_texture.set_size(640, 480)
stage.add(video_texture)
stage.show_all()
clutter.main()
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))