GStreamer error

Hi guys,

I have a problem regarding one of my projects. It’s a decision
based story - the audio version.

It stopped working and I can’t pinpoint the cause. The code is here: [1]

The error is this:

princ_audio.rb:34:in block (2 levels) in index': undefined methoduri=’ for nil:NilClass (NoMethodError)
from
/home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/slot.rb:30:in
initialize' from /home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/app.rb:69:innew’
from
/home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/app.rb:69:in
flow' from /home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/url.rb:8:inblock (3 levels) in url’
from princ_audio.rb:32:in block in index' from /home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/slot.rb:30:ininitialize’
from
/home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/app.rb:59:in
new' from /home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/app.rb:59:instack’
from
/home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/url.rb:8:in
block (3 levels) in url' from princ_audio.rb:27:inindex’
from
/home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/url.rb:11:in
block in url' from /home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/main.rb:94:incall’
from
/home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/main.rb:94:in
block in app' from /home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/main.rb:94:ininstance_eval’
from
/home/sebah/.rvm/gems/ruby-1.9.3-p392/gems/green_shoes-1.1.367/lib/shoes/main.rb:94:in
app' from princ_audio.rb:675:in

I haven’t changed the code in anyway but it’s been a while since my kids
played it. Now it appears to be broken. Has there been any changes to
GStreamer?

[1] https://github.com/sebastjan-hribar/princ/blob/master/princ_audio.rb

thank you and kind regards,
seba

Hi Seba,

Your error message says “undefined method ‘uri=’ for nil”.
So, I tried the following on my Windows 7.


C:\tmp>ruby -v
ruby 1.9.3p385 (2013-02-06) [i386-mingw32]

C:\tmp>gem list gstreamer

*** LOCAL GEMS ***

gstreamer (2.0.2 x86-mingw32)

C:\tmp>irb
irb(main):001:0> require ‘gst’
=> true
irb(main):002:0> Gst::ElementFactory.make(“playbin2”)
=> nil
irb(main):003:0> Gst::ElementFactory.make(“playbin”)
=> #<#Class:0x1a71c68:01D5EC18 ptr=01FD29E8>

Hi,

2013/9/13 ashbb [email protected]:

But I’m not sure why “playbin2” doesn’t work with the latest GStreamer…

Ruby/GStreamer uses GStreamer 1.0 since 2.0.0.
http://ruby-gnome2.sourceforge.jp/hiki.cgi?News_20130429_1

“playbin2” has been renamed to “playbin”, with similar API since
GStreamer 1.0.
http://cgit.freedesktop.org/gstreamer/gstreamer/plain/docs/random/porting-to-1.0.txt

Are you ok with this?

Masafumi Y. wrote in post #1121336:

Hi,

2013/9/13 ashbb [email protected]:

But I’m not sure why “playbin2” doesn’t work with the latest GStreamer…

Ruby/GStreamer uses GStreamer 1.0 since 2.0.0.
http://ruby-gnome2.sourceforge.jp/hiki.cgi?News_20130429_1

“playbin2” has been renamed to “playbin”, with similar API since
GStreamer 1.0.

http://cgit.freedesktop.org/gstreamer/gstreamer/plain/docs/random/porting-to-1.0.txt

Are you ok with this?

Thank you for your help. I’ve changed it to “playbin” and everything
works fine.

Kind regards,
seba

2013/9/13 Sebastjan H. [email protected]:

Thank you for your help. I’ve changed it to “playbin” and everything
works fine.

It’s my pleasure.

If you like, please refer to the new samples.
https://github.com/ruby-gnome2/ruby-gnome2/tree/master/gstreamer/sample

Thanks,

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs