private void configureDecoder() throws IOException {
		byte[] prefix = new byte[] {0x00,0x00,0x00,0x01};

		ByteBuffer csd0 = ByteBuffer.allocate(4+mSPS.length+4+mPPS.length);
		csd0.put(new byte[] {0x00,0x00,0x00,0x01});
		csd0.put(mSPS);
		csd0.put(new byte[] {0x00,0x00,0x00,0x01});
		csd0.put(mPPS);

		mDecoder = MediaCodec.createByCodecName(mDecoderName);
		MediaFormat mediaFormat = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);
		mediaFormat.setByteBuffer("csd-0", csd0);
		mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, mDecoderColorFormat);
		mDecoder.configure(mediaFormat, null, null, 0);
		mDecoder.start();

		ByteBuffer[] decInputBuffers = mDecoder.getInputBuffers();

		int decInputIndex = mDecoder.dequeueInputBuffer(1000000/FRAMERATE);
		if (decInputIndex>=0) {
			decInputBuffers[decInputIndex].clear();
			decInputBuffers[decInputIndex].put(prefix);
			decInputBuffers[decInputIndex].put(mSPS);
			mDecoder.queueInputBuffer(decInputIndex, 0, decInputBuffers[decInputIndex].position(), timestamp(), 0);
		} else {
			if (VERBOSE) Log.e(TAG,"No buffer available !");
		}

		decInputIndex = mDecoder.dequeueInputBuffer(1000000/FRAMERATE);
		if (decInputIndex>=0) {
			decInputBuffers[decInputIndex].clear();
			decInputBuffers[decInputIndex].put(prefix);
			decInputBuffers[decInputIndex].put(mPPS);
			mDecoder.queueInputBuffer(decInputIndex, 0, decInputBuffers[decInputIndex].position(), timestamp(), 0);
		} else {
			if (VERBOSE) Log.e(TAG,"No buffer available !");
		}


	}
Instantiates and starts the decoder.
@throws IOException The decoder cannot be configured
src/net/majorkernelpanic/streaming/hw/EncoderDebugger.java