boolean checkCameraSize(CameraOptions cameraId){
  boolean sizeAvailable=false;
  Camera camera=null;
  Method method=getCameraOpenMethod();
  if (method != null) {
    try {
      camera=(Camera)method.invoke(camera,new Object[]{cameraId.getValue()});
    }
 catch (    Exception e) {
      camera=Camera.open();
    }
  }
 else {
    camera=Camera.open();
  }
  if (camera == null) {
    return false;
  }
  Parameters param=camera.getParameters();
  List<Camera.Size> sizes=param.getSupportedPreviewSizes();
  for (  Camera.Size size : sizes) {
    if ((size.width == H264Config.QVGA_WIDTH && size.height == H264Config.QVGA_HEIGHT) || (size.width == H264Config.CIF_WIDTH && size.height == H264Config.CIF_HEIGHT) || (size.width == H264Config.VGA_WIDTH && size.height == H264Config.VGA_HEIGHT)) {
      sizeAvailable=true;
      break;
    }
  }
  camera.release();
  return sizeAvailable;
}

boolean checkCameraSize ( CameraOptions cameraId ) { boolean sizeAvailable = false ; Camera camera = null ; Method method = getCameraOpenMethod ( ) ; if ( method != null ) { try { camera = ( Camera ) method . invoke ( camera , new Object [ ] { cameraId . getValue ( ) } ) ; } catch ( Exception e ) { camera = Camera . open ( ) ; } } else { camera = Camera . open ( ) ; } if ( camera == null ) { return false ; } Parameters param = camera . getParameters ( ) ; List < Camera . Size > sizes = param . getSupportedPreviewSizes ( ) ; for ( Camera . Size size : sizes ) { if ( ( size . width == H264Config . QVGA_WIDTH && size . height == H264Config . QVGA_HEIGHT ) || ( size . width == H264Config . CIF_WIDTH && size . height == H264Config . CIF_HEIGHT ) || ( size . width == H264Config . VGA_WIDTH && size . height == H264Config . VGA_HEIGHT ) ) { sizeAvailable = true ; break ; } } camera . release ( ) ; return sizeAvailable ; }
check if good camera sizes are available for encoder . must be used only before open camera .
