void initForRgbFrame(int width,int height){
  this.width=width;
  this.height=height;
  int minimumRgbSize=width * height * 2;
  if (data == null || data.capacity() < minimumRgbSize) {
    data=ByteBuffer.allocateDirect(minimumRgbSize);
    yuvPlanes=null;
  }
  data.position(0);
  data.limit(minimumRgbSize);
}

void initForRgbFrame ( int width , int height ) { this . width = width ; this . height = height ; int minimumRgbSize = width * height * 2 ; if ( data == null || data . capacity ( ) < minimumRgbSize ) { data = ByteBuffer . allocateDirect ( minimumRgbSize ) ; yuvPlanes = null ; } data . position ( 0 ) ; data . limit ( minimumRgbSize ) ; }
resizes the buffer based on the given dimensions . called via jni after decoding completes .
