So you should call it something like (my JRuby is a bit rusty):
args = Gst.init('AudioPlayer', [ "" ].to_java(:String))
As for the PlayBin error, I think you have to import
org.gstreamer.elements.PlayBin as well (and all other gstreamer-java
classes you want to use)
e.g.
import Java::org.gstreamer.elements.PlayBin
player = PlayBin.new("my-playbin")
include Java
require 'gstreamer-java.jar'
import org.gstreamer.Gst
import org.gstreamer.ElementFactory
import org.gstreamer.Bin
Gst.init("foo", java.lang.String[0].new)
foo = ElementFactory.make("fakesrc", "foo")
elementAdded = Bin::ELEMENT_ADDED.impl { |bin, element|
puts "Element #{element} added to bin"
}
bin = Bin.new("foo-bin")
bin.connect(elementAdded)
bin.add(foo)
That should be a bit cleaner than the way you did it (which, I think,
was overriding the callback for all the listener instances)
On 27/03/2008, LeonB <le...@tim-online.nl> wrote:
>