你好,进行编码推流报错:
java.nio.BufferOverflowException
at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:264)
at java.nio.ByteBuffer.put(ByteBuffer.java:642)
at com.lisi.titan.TitanVideoEncoder.encodeByteBuffer(TitanVideoEncoder.java:276)
at com.lisi.titan.TitanVideoEncoder.encode(TitanVideoEncoder.java:226)
at com.lisi.titan.TitanCameraSession$3.onImageAvailable(TitanCameraSession.java:619)
at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:658)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.os.HandlerThread.run(HandlerThread.java:61)
你好,进行编码推流报错: java.nio.BufferOverflowException at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:264) at java.nio.ByteBuffer.put(ByteBuffer.java:642) at com.lisi.titan.TitanVideoEncoder.encodeByteBuffer(TitanVideoEncoder.java:276) at com.lisi.titan.TitanVideoEncoder.encode(TitanVideoEncoder.java:226) at com.lisi.titan.TitanCameraSession$3.onImageAvailable(TitanCameraSession.java:619) at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:658) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:163) at android.os.HandlerThread.run(HandlerThread.java:61)
ByteBuffer buffer; try { buffer = codec.getInputBuffer(index); } catch (IllegalStateException e) { Log.e(TAG, "getInputBuffers failed", e); return -1; }
是不是缓存太小的原因,要怎么修改呢?