# GStreamer and GLib::MainLoop

**URL:** <https://www.ruby-forum.com/t/gstreamer-and-glib-mainloop/151276>\
**Category:** Ruby-Gnome 2\
**Created:** [October 19, 2008, 3:34pm UTC](https://www.ruby-forum.com/t/gstreamer-and-glib-mainloop/151276 "2008-10-19T15:34:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcin\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/df788c/32.png) [@Marcin\_L](https://www.ruby-forum.com/u/Marcin_L)\
**Post date:** [October 19, 2008, 3:34pm UTC](https://www.ruby-forum.com/t/gstreamer-and-glib-mainloop/151276/1 "2008-10-19T15:34:29Z")

</div>

Hi,

I am building a system for audio processing. Web UI is based on Ruby on  
Rails, so I am considering using Ruby/GStreamer to build audio  
processing  
part - it will greatly integrate with rest of the software.

Unfortunately, documentation at project’s website seems to be outdated.

The very first problem that I’ve encountered is that Gst::Pipeline has  
no  
iterate method, as it is used at  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gst-helloworld](http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gst-helloworld) Even  
documentation in the hiki doesn’t show any method like that.

I tried to switch to GLib’s mainloop, by adding following code at the  
end  
of sample mentioned above:

(…)

# add objects to the main pipeline

pipeline.add(filesrc, decoder, audiosink)

# link elements

filesrc \>\> decoder \>\> audiosink

# start playing

pipeline.play

mainloop = GLib::MainLoop.new  
mainloop.run

but unfortunately, GStreamer plays nothing.

So what is the correct way to play simple stream? I don’t want to use  
Gtk.main.

Thanks in advance.

PS. If anyone would give me access to the hiki I can update  
Ruby/GStreamer  
documentation during my work.

m.

---

<div class="post-metadata">

**Author:** ![Marcin\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/df788c/32.png) [@Marcin\_L](https://www.ruby-forum.com/u/Marcin_L)\
**Post date:** [October 20, 2008, 1:20am UTC](https://www.ruby-forum.com/t/gstreamer-and-glib-mainloop/151276/2 "2008-10-20T01:20:56Z")

</div>

Hi,

2008/10/19 Marcin L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Gtk.main.  
> Did you see the example?  
> [Ruby-GNOME 2 download | SourceForge.net](http://ruby-gnome2.svn.sourceforge.net/viewvc/ruby-gnome2/ruby-gnome2/trunk/gstreamer/sample/audio-player.rb?view=markup)

> PS. If anyone would give me access to the hiki I can update Ruby/GStreamer  
> documentation during my work.

Great!  
I’ll send you an account for the Hiki.

## Thanks,

kou
