Ejemplo n.º 1
0
  // https://code.google.com/p/google-glass-api/issues/detail?id=232
  public void googleGlassXE10WorkAround(Camera mCamera) {
    Camera.Parameters params = mCamera.getParameters();
    params.setPreviewFpsRange(30000, 30000);
    params.setPreviewSize(640, 360);
    mCamera.setParameters(params);

    mCamera.setZoomChangeListener(this);
  }
Ejemplo n.º 2
0
 private void closeCamera() {
   if (mCameraDevice != null) {
     CameraHolder.instance().release();
     mCameraDevice.setZoomChangeListener(null);
     mCameraDevice = null;
     mPreviewing = false;
   }
 }
Ejemplo n.º 3
0
 @Override
 public synchronized void surfaceCreated(SurfaceHolder holder) {
   if (mCamera != null) {
     try {
       // CameraUtils.setCameraDisplayOrientation(mContext, 0,
       // mCamera);
       // onOrientationChanged(mCamera.getParameters(),
       // Configuration.ORIENTATION_LANDSCAPE);
       if (mCamera.getParameters().isZoomSupported()) {
         mCamera.setZoomChangeListener(this);
         zoomOffset = mCamera.getParameters().getMaxZoom() / 4;
       }
       mCamera.setPreviewDisplay(holder);
       mCamera.startPreview();
     } catch (IOException e) {
       Log.e("Error starting preview", e.getMessage());
     }
   }
 }
Ejemplo n.º 4
0
 @Override
 public void setZoomChangeListener(Camera.OnZoomChangeListener listener) {
   camera.setZoomChangeListener(listener);
 }