Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: media/base/android/java/src/org/chromium/media/VideoCaptureCamera.java

Issue 744193002: Android video capture: Set camera parameters continuous focus mode on, where supported (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 Log.d(TAG, "allocate: matched (" + matchedWidth + "x" + matchedHeight + ")"); 158 Log.d(TAG, "allocate: matched (" + matchedWidth + "x" + matchedHeight + ")");
159 159
160 if (parameters.isVideoStabilizationSupported()) { 160 if (parameters.isVideoStabilizationSupported()) {
161 Log.d(TAG, "Image stabilization supported, currently: " 161 Log.d(TAG, "Image stabilization supported, currently: "
162 + parameters.getVideoStabilization() + ", setting it."); 162 + parameters.getVideoStabilization() + ", setting it.");
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 if (parameters.getSupportedFocusModes().contains(
169 android.hardware.Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {
170 parameters.setFocusMode(android.hardware.Camera.Parameters.FOCUS_MOD E_CONTINUOUS_VIDEO);
171 } else {
172 Log.d(TAG, "Continuous focus mode not supported.");
173 }
174
168 setCaptureParameters(matchedWidth, matchedHeight, chosenFrameRate, param eters); 175 setCaptureParameters(matchedWidth, matchedHeight, chosenFrameRate, param eters);
169 parameters.setPictureSize(matchedWidth, matchedHeight); 176 parameters.setPictureSize(matchedWidth, matchedHeight);
170 parameters.setPreviewSize(matchedWidth, matchedHeight); 177 parameters.setPreviewSize(matchedWidth, matchedHeight);
171 parameters.setPreviewFpsRange(chosenFpsRange[0], chosenFpsRange[1]); 178 parameters.setPreviewFpsRange(chosenFpsRange[0], chosenFpsRange[1]);
172 parameters.setPreviewFormat(mCaptureFormat.mPixelFormat); 179 parameters.setPreviewFormat(mCaptureFormat.mPixelFormat);
173 try { 180 try {
174 mCamera.setParameters(parameters); 181 mCamera.setParameters(parameters);
175 } catch (RuntimeException ex) { 182 } catch (RuntimeException ex) {
176 Log.e(TAG, "setParameters: " + ex); 183 Log.e(TAG, "setParameters: " + ex);
177 return false; 184 return false;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 break; 309 break;
303 case Surface.ROTATION_0: 310 case Surface.ROTATION_0:
304 default: 311 default:
305 orientation = 0; 312 orientation = 0;
306 break; 313 break;
307 } 314 }
308 } 315 }
309 return orientation; 316 return orientation;
310 } 317 }
311 } 318 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698