Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid and MJPEG with java.lang.IllegalArgumentException
    primarykey
    data
    text
    <p>I have implemented the demo from the post: <a href="https://stackoverflow.com/questions/3205191/android-and-mjpeg/3305276#3305276">Android and MJPEG</a></p> <p>But the application always occur error after a while later and I got the exception:</p> <pre><code>java.lang.IllegalArgumentException: Invalid Unicode sequence: illegal character </code></pre> <p>within the following code in class <code>MjpegViewThread</code>:</p> <pre> public void run() { start = System.currentTimeMillis(); PorterDuffXfermode mode = new PorterDuffXfermode(PorterDuff.Mode.DST_OVER); Bitmap bm; int width; int height; Rect destRect; Canvas c = null; Paint p = new Paint(); String fps = ""; while (mRun) { if(surfaceDone) { try { c = mSurfaceHolder.lockCanvas(); synchronized (mSurfaceHolder) { try { bm = mIn.readMjpegFrame(); destRect = destRect(bm.getWidth(),bm.getHeight()); c.drawColor(Color.BLACK); c.drawBitmap(bm, null, destRect, p); if(showFps) { p.setXfermode(mode); if(ovl != null) { height = ((ovlPos & 1) == 1) ? destRect.top : destRect.bottom-ovl.getHeight(); width = ((ovlPos & 8) == 8) ? destRect.left : destRect.right -ovl.getWidth(); c.drawBitmap(ovl, width, height, null); } p.setXfermode(null); frameCounter++; if((System.currentTimeMillis() - start) >= 1000) { fps = String.valueOf(frameCounter)+"fps"; frameCounter = 0; start = System.currentTimeMillis(); ovl = makeFpsOverlay(overlayPaint, fps); } } } catch (IOException e) { Log.i(TAG, "Error: "+e); } } } catch (Exception e) { Log.i(TAG, "Error: "+e); } finally { if (c != null) mSurfaceHolder.unlockCanvasAndPost(c); } } } } </pre> <p>I am not sure whether the following LogCat information is helpful.</p> <pre> 09-27 17:06:36.645: D/dalvikvm(10120): threadid=9: still suspended after undo (sc=1 dc=1) 09-27 17:06:46.745: D/dalvikvm(10120): GC_EXTERNAL_ALLOC freed 132K, 47% free 2998K/5575K, external 1625K/2137K, paused 44ms 09-27 17:06:46.825: D/dalvikvm(10120): GC_EXTERNAL_ALLOC freed 65K, 47% free 2997K/5639K, external 2227K/2779K, paused 27ms 09-27 17:06:46.955: D/dalvikvm(10120): GC_EXTERNAL_ALLOC freed 127K, 48% free 2997K/5703K, external 2827K/2827K, paused 40ms 09-27 17:06:47.385: D/dalvikvm(10120): GC_EXTERNAL_ALLOC freed 142K, 48% free 3000K/5703K, external 2827K/2827K, paused 31ms 09-27 17:06:47.515: D/dalvikvm(10120): GC_EXTERNAL_ALLOC freed 131K, 48% free 2997K/5703K, external 2827K/2827K, paused 27ms 09-27 17:06:47.615: D/dalvikvm(10120): GC_EXTERNAL_ALLOC freed 127K, 48% free 2997K/5703K, external 2827K/2827K, paused 31ms </pre> <p>Could anyone can give me some clues to solve this problem ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload