ManuraNirmal / gstreamer-java

Automatically exported from code.google.com/p/gstreamer-java
0 stars 0 forks source link

Playbin - Can anybody give me some advice? #68

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Sorry maybe stupid question but i dont know how control playbin i start 
gstremer playbin as thred and then i would like use method like .. get,set like 
... setvolume, play, stop ect.  But I don't know how ? Can anybody help me?
eg. if I stop thred ... gstremer still playing ... definitly I doing someting 
wrong but I don't know what.

here is my simple code?

public class AudioPlayer implements Runnable{

    Thread tr1 = null;

    public AudioPlayer() {
        tr1 = new Thread(this);
        tr1.start();
    }

    public void run(){
        Gst.init();
        String mp3 = System.getProperty("user.dir") + "/data/audio/music.mp3";
        PlayBin playbin = new PlayBin("AudioPlayer");
        playbin.setVideoSink(ElementFactory.make("fakesink", "videosink"));
        playbin.setInputFile(new File(mp3));
        playbin.setState(State.PLAYING);
        Gst.main();

    }
    public static void main(String[] args) {

        AudioPlayer pb = new AudioPlayer();

        Thread thread = Thread.currentThread();
        System.out.println(thread.getId()+" "+ thread.getName());

    }

}

Original issue reported on code.google.com by Michal.S...@gmail.com on 19 Dec 2010 at 10:26

GoogleCodeExporter commented 8 years ago
sorry stupid question ... I solved it and everything works fine

Original comment by Michal.S...@gmail.com on 19 Dec 2010 at 1:59

GoogleCodeExporter commented 8 years ago

Original comment by tsha...@gmail.com on 21 Dec 2010 at 10:37