views:

50

answers:

0

hi guys i'm implementing RTSP protocol for a project in school.

i can't use any ready Managers like the 1 that comes with jmf.

i've tried using custom datasources and i just can't seem to get it working.

got the custom datasource example from here

http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/LiveData.html

now my main looks something like this:

    FileInputStream m = new FileInputStream(namee);
    BufferedInputStream bi = new BufferedInputStream(m);

    byte[] b = new byte[m.available()];

    Buffer bu = new Buffer();
    bu.setData(b);

    LiveStream l = new LiveStream();
    l.read(bu);

    DataSource ds = new DataSource();

    ds.stream = new LiveStream();

    ds.connect();
    ds.start();
    p = Manager.createPlayer(ds);
    p.addControllerListener((ControllerListener) this);
    p.realize();

there are some other checks and GUI stuff after that, this approach works if i use a MediaLocater and pass it to the player but doesn't work with this datasource and all i get is a blue band moving upwards.

any ideas? thnx