OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.media; | 5 package org.chromium.media; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.graphics.SurfaceTexture; | 8 import android.graphics.SurfaceTexture; |
9 import android.opengl.GLES20; | 9 import android.opengl.GLES20; |
10 import android.util.Log; | 10 import android.util.Log; |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 parameters.setVideoStabilization(true); | 163 parameters.setVideoStabilization(true); |
164 } else { | 164 } else { |
165 Log.d(TAG, "Image stabilization not supported."); | 165 Log.d(TAG, "Image stabilization not supported."); |
166 } | 166 } |
167 | 167 |
168 setCaptureParameters(matchedWidth, matchedHeight, chosenFrameRate, param
eters); | 168 setCaptureParameters(matchedWidth, matchedHeight, chosenFrameRate, param
eters); |
169 parameters.setPictureSize(matchedWidth, matchedHeight); | 169 parameters.setPictureSize(matchedWidth, matchedHeight); |
170 parameters.setPreviewSize(matchedWidth, matchedHeight); | 170 parameters.setPreviewSize(matchedWidth, matchedHeight); |
171 parameters.setPreviewFpsRange(chosenFpsRange[0], chosenFpsRange[1]); | 171 parameters.setPreviewFpsRange(chosenFpsRange[0], chosenFpsRange[1]); |
172 parameters.setPreviewFormat(mCaptureFormat.mPixelFormat); | 172 parameters.setPreviewFormat(mCaptureFormat.mPixelFormat); |
| 173 parameters.setFocusMode(android.hardware.Camera.Parameters.FOCUS_MODE_CO
NTINUOUS_VIDEO); |
173 try { | 174 try { |
174 mCamera.setParameters(parameters); | 175 mCamera.setParameters(parameters); |
175 } catch (RuntimeException ex) { | 176 } catch (RuntimeException ex) { |
176 Log.e(TAG, "setParameters: " + ex); | 177 Log.e(TAG, "setParameters: " + ex); |
177 return false; | 178 return false; |
178 } | 179 } |
179 | 180 |
180 // Set SurfaceTexture. Android Capture needs a SurfaceTexture even if | 181 // Set SurfaceTexture. Android Capture needs a SurfaceTexture even if |
181 // it is not going to be used. | 182 // it is not going to be used. |
182 mGlTextures = new int[1]; | 183 mGlTextures = new int[1]; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 break; | 303 break; |
303 case Surface.ROTATION_0: | 304 case Surface.ROTATION_0: |
304 default: | 305 default: |
305 orientation = 0; | 306 orientation = 0; |
306 break; | 307 break; |
307 } | 308 } |
308 } | 309 } |
309 return orientation; | 310 return orientation; |
310 } | 311 } |
311 } | 312 } |
OLD | NEW |