Ejemplo n.º 1
0
 public byte[] getJPEG() {
   if (isFake) {
     int length = fakeCamera.getJPEG(readBuffer, 4);
     System.arraycopy(
         getIntBytes(length), 0, readBuffer, 0, 4); // copy length to 4 first bytes in buffer
   } else {
     int length = realCamera.getJPEG(readBuffer, 4);
     System.arraycopy(
         getIntBytes(length), 0, readBuffer, 0, 4); // copy length to 4 first bytes in buffer
   }
   byte[] buffer = new byte[se.lth.cs.fakecamera.Axis211A.IMAGE_BUFFER_SIZE + 4];
   System.arraycopy(readBuffer, 0, buffer, 0, readBuffer.length);
   return buffer;
 }
Ejemplo n.º 2
0
 public void close() {
   if (isFake) fakeCamera.close();
   else realCamera.close();
 }
Ejemplo n.º 3
0
 public boolean connect() {
   if (isFake) return fakeCamera.connect();
   else return realCamera.connect();
 }