Forum: Ruby GStreamer error

Ccd9be37f5bd322e9d3968f767328928?d=identicon&s=25 Sebastjan H. (sebastjan_h)
on 2013-09-12 19:32
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 method
`uri=' 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:in
`new'
      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:in
`block (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:in
`initialize'
      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:in
`stack'
      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:in `index'
      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:in
`call'
      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:in
`instance_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 `<main>'


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/mas...

thank you and kind regards,
seba
689dae2a2a14404ed27048633f472147?d=identicon&s=25 ashbb shoeser (satoshi_a)
on 2013-09-12 22:57
(Received via mailing list)
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>
394f372e936f867e4e43bfd1315a0a4e?d=identicon&s=25 Masafumi Yokoyama (Guest)
on 2013-09-13 02:14
(Received via mailing list)
Hi,

2013/9/13 ashbb <ashbbb@gmail.com>:
> 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/pl...

Are you ok with this?
Ccd9be37f5bd322e9d3968f767328928?d=identicon&s=25 Sebastjan H. (sebastjan_h)
on 2013-09-13 06:52
Masafumi Yokoyama wrote in post #1121336:
> Hi,
>
> 2013/9/13 ashbb <ashbbb@gmail.com>:
>> 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/pl...
>
> Are you ok with this?

Thank you for your help. I've changed it to "playbin" and everything
works fine.

Kind regards,
seba
394f372e936f867e4e43bfd1315a0a4e?d=identicon&s=25 Masafumi Yokoyama (Guest)
on 2013-09-13 07:25
(Received via mailing list)
2013/9/13 Sebastjan H. <lists@ruby-forum.com>:
> 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/ma...


Thanks,
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.