rtsp-client-android
rtsp-client-android copied to clipboard
Android MediaCodec dequeueOutputBuffer returns illegal buffer index using gstreamer server
Hi, I am using your library to decode an rtsp URL streamed using gstreamer server but i am getting green glitches with a log 'Cannot add frame, queue is full' in some device and in some device app crashes with error
when (val outIndex = decoder.dequeueOutputBuffer(bufferInfo, 10000L)) {
MediaCodec.INFO_OUTPUT_FORMAT_CHANGED -> Log.d(TAG, "Decoder format changed: ${decoder.outputFormat}")
MediaCodec.INFO_TRY_AGAIN_LATER -> if (DEBUG) Log.d(TAG, "No output from decoder available")
else -> {
if (outIndex >= 0) {
val byteBuffer: ByteBuffer? = decoder.getOutputBuffer(outIndex)
val chunk = ByteArray(bufferInfo.size)
byteBuffer?.get(chunk)
byteBuffer?.clear()
if (chunk.isNotEmpty()) {
audioTrack.write(chunk, 0, chunk.size)
}
decoder.releaseOutputBuffer(outIndex, false)
}
}
}
Can u also provide the email address so that i can share the Gstreamer server code.
facing same problem. if you found any solution then let me know.
i have same problem
the same problem. Did anybody find solution?