title: With MediaCodec API, i'm getting OutputBufferIndex as -1 everytime. Any possible solution?
body: <pre><code>mediacodec init:
  mediaCodec = MediaCodec.createDecoderByType("video/avc");
  mediaFormat = MediaFormat.createVideoFormat("video/avc", width, height);
  mediaFormat.setInteger("color-format", 19);
  mediaCodec.configure(mediaFormat, paramSurface, null, 0);
  int i = mediaCodec.dequeueOutputBuffer(this.bufferInfo, 0L);
  
      if (i &gt;= 0)
      {
          int j = i;             
  
          mediaCodec.releaseOutputBuffer(j, true);
  
          if ((this.bufferInfo.flags &amp; 0x4) != 0)
              Log.d(TAG, "BUFFER_FLAG_END_OF_STREAM");
  
          return ;
  
      }
      else if (i == -3)
      {
          Log.d(TAG, "INFO_OUTPUT_BUFFERS_CHANGED");
          outputBuffers = mediaCodec.getOutputBuffers();
      }
      else if (i == -2)
      {
          MediaFormat localMediaFormat = mediaCodec.getOutputFormat();
          Log.d(TAG, "Output format has changed to " + localMediaFormat);
          Log.d(TAG, "Output format width:" + localMediaFormat.getInteger("width"));
          Log.d(TAG, "Output format height:" + localMediaFormat.getInteger("height"));                    
      }
      else if(i==-1){         
          Log.d(TAG, "dequeueOutputBuffer timeout pts is " + pts);        
      }
  </code></pre>