Android MediaCodec decoder configure error

I am trying to write a simple test application that takes camera input, encodes it and then decodes and displays the output.



In a function that does configuration, I do this:



mSurfaceManager = new SurfaceManager();
outputSurface = new Surface(mSurfaceManager.getSurfaceTexture());
outputSurface.eglMakeCurrent();

mCodec = MediaCodec.createDecoderByType(type);
mCodec.configure(format, outputSurface, null, 0);
mCodec.start();


When I run the code, in the logs, I see the following:



I/DecodeTest   (14319): [DecodeTestThread] CameraPipe19.java::start(): start camera (API 19 version) 960x540
I/DecodeTest (14319): [Thread-3212] Cam.java::prepareCamera(): 15000 15000
I/DecodeTest (14319): [Thread-3212] Cam.java::prepareCamera(): 15000 30000
I/DecodeTest (14319): [Thread-3212] Cam.java::prepareCamera(): no suitable FPS range found
I/DecodeTest (14319): [Thread-3212] Cam.java::prepareCamera(): picked FPS range 15000..15000
I/DecodeTest (14319): camera 0 size changed 960x540
I/DecodeTest (14319): [Thread-3212] Cam.java::prepareEncoder(): format: {frame-rate=12, bitrate=1000000, height=540, mime=video/avc, color-format=2130708361, i-frame-interval=600, width=960}
I/DecodeTest (14319): [Thread-3212] SurfaceManager.java::<init>(): texture is 1
I/DecodeTest (14319): [Thread-3212] SurfaceManager.java::getSurfaceTexture(): getSurfaceTexture: 1
I/DecodeTest (14319): [Thread-3212] SurfaceManager.java::getSurfaceTexture(): getSurfaceTexture: 1
I/DecodeTest (14319): [Thread-3212] Cam.java::drainEncoder(): encoder output format changed: {csd-1=java.nio.ByteArrayBuffer[position=0,limit=8,capacity=8], height=540, mime=video/avc, csd-0=java.nio.ByteArrayBuffer[position=0,limit=15,capacity=15], what=1869968451, width=960}
I/DecodeTest (14319): [Thread-3212] Cam.java::drainEncoder(): got codec config data
I/DecodeTest (14319): Encoder produced an I-frame
I/DecodeTest (14319): [Thread-3212] Cam.java::drainEncoder(): requesting an I-frame...
I/DecodeTest (14319): thread attached to JVM
I/DecodeTest (14319): [DecodeTestThread] Decoder.java::configure(): configure decoder type=video/avc
I/DecodeTest (14319): [DecodeTestThread] Render.java::loadShader(): Could not compile shader 35633:
I/DecodeTest (14319): [DecodeTestThread] Render.java::loadShader():
I/DecodeTest (14319): Encoder produced an I-frame
I/DecodeTest (14319): [DecodeTestThread] Decoder.java::decode(): decode exception: java.lang.NullPointerException


The particular text of significance is,




Render.java::loadShader(): Could not compile shader 35633:




I searched through some of the previous reports of the error message, but didn't get much clue. The display related parts are mostly cut and paste from here (thank you fadden). Any help in understanding the above error message?