Android MediaCodec dequeueOutputBuffer returns illegal buffer index -
i compiled https://github.com/dpolishuk/simple-mediaplayer-android is.
presumably worked somewhere on nexus 7 (version 1) kitkat, outindex returned 5 while videooutputbuffers 5 long, leading indexoutofboundsexception?
the main relevant loop is:
int outindex = videodecoder.dequeueoutputbuffer(info, 10000); switch (outindex) { case mediacodec.info_output_buffers_changed: log.d(const.tag, "info_output_buffers_changed"); videooutputbuffers = videodecoder.getoutputbuffers(); break; case mediacodec.info_output_format_changed: log.d(const.tag, "new format " + videodecoder.getoutputformat()); break; case mediacodec.info_try_again_later: log.d(const.tag, "dequeueoutputbuffer timed out!"); break; default: bytebuffer buffer = videooutputbuffers[outindex]; while (audioptsus > 0 && (info.presentationtimeus / 1000.0 - getaudioptsms()) > 40.0) { try { log.d(const.tag, "wait video " + info.presentationtimeus / 1000.0 + " audio " + audioptsus / 1000.0); thread.sleep(10); } catch (interruptedexception e) { e.printstacktrace(); break; } } if ((info.presentationtimeus / 1000.0 - getaudioptsms()) < -40.0) { log.d(const.tag, "need skip video frame video " + info.presentationtimeus / 1000.0 + " audio " + getaudioptsms()); } videodecoder.releaseoutputbuffer(outindex, true); break; }
with output:
06-03 00:53:11.965: d/openglrenderer(32252): enabling debug mode 0 06-03 00:53:13.495: i/omxclient(32252): using client-side omx mux. 06-03 00:53:13.495: d/nvosdebugprintf(126): nvxliteh264decoderinit : opening tvmr h264 block 06-03 00:53:13.505: e/omxnodeinstance(126): omx_setparameter() failed storemetadatainbuffers: 0x80001006 06-03 00:53:13.505: e/acodec(32252): [omx.nvidia.h264.decode] storemetadatainbuffers failed w/ err -2147483648 06-03 00:53:13.515: i/omxclient(32252): using client-side omx mux. 06-03 00:53:13.605: d/nvosdebugprintf(126): nvmmliteopen : block : blocktype = 261 06-03 00:53:13.605: d/nvosdebugprintf(126): ++++++ nvavpopen +++++++ 06-03 00:53:13.605: i/choreographer(32252): skipped 105 frames! application may doing work on main thread. 06-03 00:53:13.625: d/nvosdebugprintf(126): nvmmliteblockcreate : block : blocktype = 261 06-03 00:53:13.625: d/nvosdebugprintf(126): ++++++++++++ tvmrframedelivery +++++++++++++++ 06-03 00:53:13.635: d/mymediaplayer(32252): dequeueoutputbuffer timed out! 06-03 00:53:13.635: i/softaac2(32252): reconfiguring decoder: 0->44100 hz, 0->2 channels 06-03 00:53:13.635: d/nvosdebugprintf(126): beginsequence 1280x720 06-03 00:53:13.635: d/nvosdebugprintf(126): pnvsi->ndecodebuffers = 2 06-03 00:53:13.645: d/mymediaplayer(32252): dequeueoutputbuffer timed out! 06-03 00:53:13.645: d/mymediaplayer(32252): dequeueoutputbuffer timed out! 06-03 00:53:13.655: d/mymediaplayer(32252): info_output_buffers_changed 06-03 00:53:13.655: d/nvosdebugprintf(126): display resolution : (1280x720) 06-03 00:53:13.655: d/nvosdebugprintf(126): display aspect ratio : (1280x720) 06-03 00:53:13.655: d/nvosdebugprintf(126): cbbeginsequence@448: surfacelayout = 2 06-03 00:53:13.655: d/nvosdebugprintf(126): pstreaminfo->numofsurfaces = 6, maxdpb = 24, interacestream = 0, interlaceenabled = 0 06-03 00:53:13.655: d/nvosdebugprintf(126): allocating new output: 1280x720 (x 8) 06-03 00:53:13.665: d/mymediaplayer(32252): new format {sample-rate=44100, channel-count=2, what=1869968451, mime=audio/raw} 06-03 00:53:13.665: d/mymediaplayer(32252): dequeueoutputbuffer timed out! 06-03 00:53:13.675: d/mymediaplayer(32252): dequeueoutputbuffer timed out! 06-03 00:53:13.705: i/activitymanager(505): displayed io.dp.media.player/.mainactivity: +2s169ms 06-03 00:53:13.725: d/mymediaplayer(32252): info_output_buffers_changed 06-03 00:53:13.735: d/mymediaplayer(32252): new format {height=720, what=1869968451, color-format=256, slice-height=0, crop-left=0, width=1280, crop-bottom=719, crop-top=0, mime=video/raw, stride=1280, crop-right=1279} 06-03 00:53:13.775: d/mymediaplayer(32252): need skip video frame video 0.0 audio 46.439909297052154 06-03 00:53:13.835: i/hwcomposer(123): setting interactive mode: off 06-03 00:53:13.865: w/dalvikvm(32252): threadid=12: thread exiting uncaught exception (group=0x419b6ba8) 06-03 00:53:13.875: e/androidruntime(32252): fatal exception: thread-1887 06-03 00:53:13.875: e/androidruntime(32252): process: io.dp.media.player, pid: 32252 06-03 00:53:13.875: e/androidruntime(32252): java.lang.arrayindexoutofboundsexception: length=5; index=5 06-03 00:53:13.875: e/androidruntime(32252): @ io.dp.media.player.player.processvideo(player.java:154) 06-03 00:53:13.875: e/androidruntime(32252): @ io.dp.media.player.player.access$500(player.java:34) 06-03 00:53:13.875: e/androidruntime(32252): @ io.dp.media.player.player$videothread.run(player.java:276) 06-03 00:53:13.885: w/activitymanager(505): force finishing activity io.dp.media.player/.mainactivity
Comments
Post a Comment