I\'m trying to figure out how to use Android\'s MediaCodec class to decode H.264 video. To start, I\'m trying to manually parse the NAL units out of an H.264 file and feed them
As far as what I have experienced, the decoder will return -1 on dequeueOutputBuffer() as long as you don't feed it the sps/pps info. When you do that, the decoder should return with the INFO_OUTPUT_FORMAT_CHANGED flag (-2) on dequeueOutputBuffer(), and after that will properly return decoded frames.
If the decoder still returns -1, try adding the sps/pps info to the decoder with the flag BUFFER_FLAG_CODEC_CONFIG.