diff options
author | mcasas@chromium.org <mcasas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-23 22:03:52 +0000 |
---|---|---|
committer | mcasas@chromium.org <mcasas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-23 22:03:52 +0000 |
commit | c8680d6ef7d3dd49752859cc95a1867214135bd7 (patch) | |
tree | bafad160d84ebb0f62ff627d129dfc7157b5cb4c /media | |
parent | b00e23415d3a57469e76469a96a5a7860d7eb802 (diff) | |
download | chromium_src-c8680d6ef7d3dd49752859cc95a1867214135bd7.zip chromium_src-c8680d6ef7d3dd49752859cc95a1867214135bd7.tar.gz chromium_src-c8680d6ef7d3dd49752859cc95a1867214135bd7.tar.bz2 |
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
Diffstat (limited to 'media')
-rw-r--r-- | media/base/android/java/src/org/chromium/media/VideoCapture.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/media/base/android/java/src/org/chromium/media/VideoCapture.java b/media/base/android/java/src/org/chromium/media/VideoCapture.java index 1bb2de5..fe1863f 100644 --- a/media/base/android/java/src/org/chromium/media/VideoCapture.java +++ b/media/base/android/java/src/org/chromium/media/VideoCapture.java @@ -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 +} |