I am trying to use the MediaCodec API to decoding H264 stream with Android client. sample code:
int decoderStatus = decoder.dequeueOutputBuffer(mBufferInfo, TIMEOUT_USEC);
When the remote H264 stream resolution size is bigger (eg: 1600*1200), this function will always return -1(MediaCodec.INFO_TRY_AGAIN_LATER)
, so the decode will failed but can not catch any exception. if the resolution is lower (eg 1920*1080, 1280*720), the decode machanism works OK.
this only happens on some Samsung devices: Galaxy S3, Note2, and note.
I also check these machines that supported H264 profile Level, and they are all Level 4 devices and can support maximum resolution size 2048*1024 theoretically (https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels).
Does someone meet this problem? I try to modify the parameters when queueInputBuffer
and dequeueOutputBuffer
but failed to fix it.