Unable to initialize MediaCodec for nexus 7

Hello,

I’m trying to use the MediaCodec class to decode H264 stream. My code wworks for Nexus 4, for Moto G but I always receive an error on Nexus 7 (Tegra 3):

02-15 19:25:08.935: D/Decoder(20007): sps: 00 00 00 01 67 64 00 20 AC B4 02 80 2D D0 80 00 00 03 00 80 00 00 32 32 30 01 86 A0 03 0D 71 69 40 3C 60 CA 80
02-15 19:25:08.935: D/Decoder(20007): pps: 00 00 00 01 68 EE 3C B0
02-15 19:25:17.565: E/OMXNodeInstance(125): OMX_SetParameter() failed for StoreMetaDataInBuffers: 0x80001006
02-15 19:25:17.565: E/ACodec(20007): [OMX.Nvidia.h264.decode] storeMetaDataInBuffers failed w/ err -2147483648
02-15 19:25:19.385: E/ACodec(20007): [OMX.Nvidia.h264.decode] setting nBufferCountActual to 5 failed: -1010
02-15 19:25:19.385: E/ACodec(20007): Failed to allocate buffers after transitioning to IDLE state (error 0xfffffc0e)
02-15 19:25:19.385: E/MediaCodec(20007): Codec reported an error. (omx error 0x80001001, internalError -1010)
02-15 19:25:22.255: W/System.err(20007): java.lang.IllegalStateException: start failed

my code is:
_mediaCodec = MediaCodec.createDecoderByType(“video/avc”);
_mediaFormat = new MediaFormat();
_mediaFormat = MediaFormat.createVideoFormat(“video/avc”, _width, _height);
// Set buffer size
_mediaFormat.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, 4 * _width * _height);
// Pass SPS and PPS in csd-0 and csd-1 keys
ByteBuffer csd0 = ByteBuffer.allocate(sps_len);
csd0.put(_videoExtraData, sps_start + 1, sps_len -1);
csd0.position(0);
_mediaFormat.setByteBuffer(“csd-0”, csd0);
ByteBuffer csd1 = ByteBuffer.allocate(pps_len);
csd1.put(_videoExtraData, pps_start + 1, pps_len -1);
csd1.position(0);
_mediaFormat.setByteBuffer(“csd-1”, csd1);

	_mediaCodec.configure(_mediaFormat, _surface, null, 0);
	_mediaCodec.start();
	Log.d(_logTag, "Codec started");
	_inputBuffers = _mediaCodec.getInputBuffers();
	_outputBuffers = _mediaCodec.getOutputBuffers();

Any idea why this does not work on a Nexus 7 but works on Nexus 4, MotoG…
I am on Android 4.4.2 on the nexus 7.

Thanks for your help !
Florent