Android MediaCodec decode h264 raw frame
I am using Android MediaCodec API to decode h264 frames. I could decode and render the frames on the view. My problem is the decoder miss lots of frames,especially the first some frames. DecodeMediaCodec.dequeueOutputBuffer() return -1. aAbout 150 h264 frames,just decoded 43 frames. I can not find where the problem is. Here is my codes. /** * init decoder */ private void initDecodeMediaCodec() { mDecodeMediaCodec = MediaCodec.createDecoderByType(MIME_TYPE); MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, VIDEO_WIDTH_640, VIDEO_HEIGHT_480); mDecodeMediaCodec.configure(format, new