Skip to content

Commit

Permalink
Android VideoCapture: catch exception on Android.Camera.SetParameters.
Browse files Browse the repository at this point in the history
See [1].

[1] http://developer.android.com/reference/android/hardware/Camera.html#setParameters(android.hardware.Camera.Parameters)

BUG=b/16370110

Review URL: https://codereview.chromium.org/400933002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285050 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mcasas@chromium.org committed Jul 23, 2014
1 parent b00e234 commit c8680d6
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ boolean allocate(int width, int height, int frameRate) {
mCaptureFormat.mHeight);
parameters.setPreviewFpsRange(fpsMinMax[0], fpsMinMax[1]);
parameters.setPreviewFormat(mCaptureFormat.mPixelFormat);
mCamera.setParameters(parameters);
try {
mCamera.setParameters(parameters);
} catch (RuntimeException ex) {
Log.e(TAG, "setParameters: " + ex);
return false;
}

// Set SurfaceTexture. Android Capture needs a SurfaceTexture even if
// it is not going to be used.
Expand Down Expand Up @@ -373,4 +378,4 @@ private Camera.CameraInfo getCameraInfo(int id) {
}
return cameraInfo;
}
}
}

0 comments on commit c8680d6

Please sign in to comment.