Commit c8680d6e authored by mcasas@chromium.org's avatar mcasas@chromium.org

Android VideoCapture: catch exception on Android.Camera.SetParameters.

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
parent b00e2341
......@@ -177,7 +177,12 @@ public abstract class VideoCapture implements PreviewCallback {
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.
......@@ -373,4 +378,4 @@ public abstract class VideoCapture implements PreviewCallback {
}
return cameraInfo;
}
}
\ No newline at end of file
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment