Hi, i am using S60 3rd Edition FP1 sdk. I want to develop a streaming client in Java (midlet) that can play videos (3gpp and MP4) using rtsp protocol. For that i have setup Drawin Streaming Server as well and it is working fine ( i checked it with QuickTime Player, VLC player and Real Time player in emulator). Here is my code:
public void start() {
try {
player = Manager.createPlayer(url);
player.addPlayerListener(this);
if (player.getState() == player.UNREALIZED) {
player.realize();
// Grab the video control and set it to the current display.
}
control = (VideoControl) player.getControl("VideoControl");
if (control != null) {
control.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
control.setDisplaySize(176, 144);
int width = control.getSourceWidth();
int height = control.getSourceHeight();
status2 = "Before: SW=" + width + "-SH=" + height + "-DW=" + control.getDisplayWidth() + "-DH=" + control.getDisplayHeight();
}
if (player.getState() == player.REALIZED) {
player.start();
}
} catch (IOException e) {
Alert erro = new Alert("IO Exception :", e.getMessage(), null, AlertType.ERROR);
Display.getDisplay(midlet).setCurrent(erro);
} catch (MediaException me) {
Alert erro = new Alert("Media Exception :", me.getMessage(), null, AlertType.ERROR);
Display.getDisplay(midlet).setCurrent(erro);
} catch (SecurityException se) {
Alert erro = new Alert("Security Exception :", se.getMessage(), null, AlertType.ERROR);
Display.getDisplay(midlet).setCurrent(erro);
} catch (Exception e) {
Alert erro = new Alert("Erro", e.getMessage(), null, AlertType.ERROR);
Display.getDisplay(midlet).setCurrent(erro);
}
}
----------------------------------
if (mCanvas == null)
{
mCanvas = new VideoCanvas(this, "rtsp://localhost:554/sample_50kbit.3gp");
}
Display display = Display.getDisplay(this);
//display.setCurrent(form);
display.setCurrent(mCanvas);
Now, whenever i run this midlet it is giving me Exception of "realize error -7002". Note: I am also self signing the midlet.
Please help anyone.

Reply With Quote


