android Programming Glossary: getendofseqeunce
Android ICS and MJPEG using AsyncTask http://stackoverflow.com/questions/10550139/android-ics-and-mjpeg-using-asynctask mContentLength 1 public MjpegInputStream InputStream in super new BufferedInputStream in FRAME_MAX_LENGTH private int getEndOfSeqeunce DataInputStream in byte sequence throws IOException int seqIndex 0 byte c for int i 0 i FRAME_MAX_LENGTH i c byte in.readUnsignedByte.. else seqIndex 0 return 1 private int getStartOfSequence DataInputStream in byte sequence throws IOException int end getEndOfSeqeunce in sequence return end 0 1 end sequence.length private int parseContentLength byte headerBytes throws IOException NumberFormatException.. catch NumberFormatException nfe nfe.getStackTrace Log.d TAG catch NumberFormatException hit nfe mContentLength getEndOfSeqeunce this EOF_MARKER reset byte frameData new byte mContentLength skipBytes headerLen readFully frameData return BitmapFactory.decodeStream..
Android and MJPEG http://stackoverflow.com/questions/3205191/android-and-mjpeg e return null public MjpegInputStream InputStream in super new BufferedInputStream in FRAME_MAX_LENGTH private int getEndOfSeqeunce DataInputStream in byte sequence throws IOException int seqIndex 0 byte c for int i 0 i FRAME_MAX_LENGTH i c byte in.readUnsignedByte.. else seqIndex 0 return 1 private int getStartOfSequence DataInputStream in byte sequence throws IOException int end getEndOfSeqeunce in sequence return end 0 1 end sequence.length private int parseContentLength byte headerBytes throws IOException NumberFormatException.. readFully header try mContentLength parseContentLength header catch NumberFormatException nfe mContentLength getEndOfSeqeunce this EOF_MARKER reset byte frameData new byte mContentLength skipBytes headerLen readFully frameData return BitmapFactory.decodeStream..
|