From: Radu B. R. <ru...@cs...> - 2007-11-14 05:15:47
|
fixed in SVN! thanks and sorry it took so long. Cheers, Radu. David Leonardo wrote: > Hi, I've been working in an application that uses CameraInterface.java and i > found a bug with the JPEG compressed images payload, it wasn't the same in > every package, obviously. So, when a package arrived, the first 32 (28+4) > bytes were decoded correctly, but when the image bytes were read, > apparently, didn't match with the imageCount previously obtained, so the > next frame never synchronized and there wasn't data ready. > > With the non-compressed images worked fine, because the length of the > imagecount was always the same. > > To fix it, i modified the readData method in the CameraInterface.java, > replacing the buffer's length with the header payload size less 32 (28+4) > bytes previously read, so it always matched, for compress and non-compress > images. > > // Buffer for reading image > > //buffer = new byte[PLAYER_CAMERA_IMAGE_SIZE]; > buffer = new byte[ header.getSize()-32]; > > //is.readFully (buffer, 0, imageCount); > is.readFully (buffer, 0, header.getSize()-32); > > pcdata.setImage (buffer); > > > It works fine, or like people say in my country, "al peluche". > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Java-player-developers mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-player-developers -- | Radu Bogdan Rusu | http://rbrusu.com/ | http://www9.cs.tum.edu/people/rusu/ | Intelligent Autonomous Systems | Technische Universitaet Muenchen |