|
From: krike <kri...@gm...> - 2006-05-24 00:41:17
|
Hi, i'm new here and i'm working with javaclient2 and player 2.0.1. So far
I'm doing all right except for a little problem. The code works well, and I
get an image but when I try to get the second image, it is the same as the
first one. I don't know what's wrong. Anyone can help? Thanks.
/**************************************************************************************
int width, height, bpp, format, compr, isize;
PlayerCameraData CamData = null;
PlayerClient robot = null;
CameraInterface cam = null;
try {
robot = new PlayerClient (ip, port);
cam = robot.requestInterfaceCamera (IDCamera,
PlayerConstants.PLAYER_OPEN_MODE);
} catch (PlayerException e) {
System.err.println ("Camera module: -> ERROR: ");
System.err.println (" [ " + e.toString() + " ]");
System.exit (1);
}
robot.runThreaded (-1, -1);
//Wait connection.
while (!cam.isDataReady ())
{ try { Thread.sleep (100); } catch (Exception e) {} }
CamData = cam.getData();
width = CamData.getWidth ();
height = CamData.getHeight ();
bpp = CamData.getBpp ();
format = CamData.getFormat ();
compr = CamData.getCompression ();
isize = CamData.getImage_count (); //bpp*width*height
int countFrame = 0;
while (true)
{
imageData = CamData.getImage();
writeJPG(imageData, "frame_" + countFrame + ".jpg");
countFrame++;
}
--
View this message in context: http://www.nabble.com/Missing+data+in+images--t1286033.html#a4533431
Sent from the java-player-users forum at Nabble.com.
|