本文整理汇总了Java中com.google.zxing.client.android.camera.CameraConfigurationUtils.setVideoStabilization方法的典型用法代码示例。如果您正苦于以下问题:Java CameraConfigurationUtils.setVideoStabilization方法的具体用法?Java CameraConfigurationUtils.setVideoStabilization怎么用?Java CameraConfigurationUtils.setVideoStabilization使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.zxing.client.android.camera.CameraConfigurationUtils
的用法示例。
在下文中一共展示了CameraConfigurationUtils.setVideoStabilization方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openCamera
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private Camera openCamera() {
Camera.CameraInfo info = new Camera.CameraInfo();
int id = chooseBackFacingCamera(info);
Camera camera = Camera.open(id);
Point screenResolution = new Point();
camera.setDisplayOrientation((info.orientation - getDisplayInfo(screenResolution) + 360) % 360);
Camera.Parameters parameters = camera.getParameters();
CameraConfigurationUtils.setFocus(parameters, true, true, false);
CameraConfigurationUtils.setBarcodeSceneMode(parameters);
CameraConfigurationUtils.setVideoStabilization(parameters);
CameraConfigurationUtils.setFocusArea(parameters);
CameraConfigurationUtils.setMetering(parameters);
mCaptureSize = CameraConfigurationUtils.findBestPreviewSizeValue(parameters, screenResolution);
Log.d(TAG, "Screen resolution: " + screenResolution.x + "x" + screenResolution.y);
Log.d(TAG, "Preview size: " + mCaptureSize.x + "x" + mCaptureSize.y);
parameters.setPreviewSize(mCaptureSize.x, mCaptureSize.y);
camera.setParameters(parameters);
return camera;
}
示例2: setDesiredCameraParameters
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
void setDesiredCameraParameters(Camera camera, boolean safeMode) {
Camera.Parameters parameters = camera.getParameters();
if (parameters == null) {
Log.w(TAG, "Device error: no camera parameters are available. Proceeding without configuration.");
return;
}
initializeTorch(parameters, safeMode);
CameraConfigurationUtils.setFocus(
parameters,
true,
true,
safeMode);
if (!safeMode) {
CameraConfigurationUtils.setBarcodeSceneMode(parameters);
CameraConfigurationUtils.setVideoStabilization(parameters);
CameraConfigurationUtils.setFocusArea(parameters);
CameraConfigurationUtils.setMetering(parameters);
}
parameters.setPreviewSize(cameraResolution.x, cameraResolution.y);
Log.i(TAG, "Final camera parameters: " + parameters.flatten());
camera.setParameters(parameters);
Camera.Parameters afterParameters = camera.getParameters();
Camera.Size afterSize = afterParameters.getPreviewSize();
if (afterSize != null && (cameraResolution.x != afterSize.width || cameraResolution.y != afterSize.height)) {
Log.w(TAG, "Camera said it supported preview size " + cameraResolution.x + 'x' + cameraResolution.y +
", but after setting it, preview size is " + afterSize.width + 'x' + afterSize.height);
cameraResolution.x = afterSize.width;
cameraResolution.y = afterSize.height;
}
camera.setDisplayOrientation(90);
}
示例3: configureAdvanced
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private static void configureAdvanced(Camera.Parameters parameters) {
CameraConfigurationUtils.setBestPreviewFPS(parameters);
CameraConfigurationUtils.setBarcodeSceneMode(parameters);
CameraConfigurationUtils.setVideoStabilization(parameters);
CameraConfigurationUtils.setMetering(parameters);
CameraConfigurationUtils.setZoom(parameters, ZOOM);
}
示例4: optimizeParameters
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
public static void optimizeParameters(@NonNull Camera.Parameters parameters) {
CameraConfigurationUtils.setBestPreviewFPS(parameters);
CameraConfigurationUtils.setBarcodeSceneMode(parameters);
CameraConfigurationUtils.setVideoStabilization(parameters);
parameters.setPreviewFormat(ImageFormat.NV21);
}
示例5: setDesiredCameraParameters
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
void setDesiredCameraParameters(OpenCamera camera, boolean safeMode) {
Camera theCamera = camera.getCamera();
Camera.Parameters parameters = theCamera.getParameters();
if (parameters == null) {
Log.w(TAG, "Device error: no camera parameters are available. Proceeding without configuration.");
return;
}
Log.i(TAG, "Initial camera parameters: " + parameters.flatten());
if (safeMode) {
Log.w(TAG, "In camera config safe mode -- most settings will not be honored");
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
initializeTorch(parameters, prefs, safeMode);
CameraConfigurationUtils.setFocus(
parameters,
prefs.getBoolean(PreferencesActivity.KEY_AUTO_FOCUS, true),
prefs.getBoolean(PreferencesActivity.KEY_DISABLE_CONTINUOUS_FOCUS, true),
safeMode);
if (!safeMode) {
if (prefs.getBoolean(PreferencesActivity.KEY_INVERT_SCAN, false)) {
CameraConfigurationUtils.setInvertColor(parameters);
}
if (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_BARCODE_SCENE_MODE, true)) {
CameraConfigurationUtils.setBarcodeSceneMode(parameters);
}
if (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_METERING, true)) {
CameraConfigurationUtils.setVideoStabilization(parameters);
CameraConfigurationUtils.setFocusArea(parameters);
CameraConfigurationUtils.setMetering(parameters);
}
}
parameters.setPreviewSize(bestPreviewSize.x, bestPreviewSize.y);
theCamera.setParameters(parameters);
theCamera.setDisplayOrientation(cwRotationFromDisplayToCamera);
Camera.Parameters afterParameters = theCamera.getParameters();
Camera.Size afterSize = afterParameters.getPreviewSize();
if (afterSize != null && (bestPreviewSize.x != afterSize.width || bestPreviewSize.y != afterSize.height)) {
Log.w(TAG, "Camera said it supported preview size " + bestPreviewSize.x + 'x' + bestPreviewSize.y +
", but after setting it, preview size is " + afterSize.width + 'x' + afterSize.height);
bestPreviewSize.x = afterSize.width;
bestPreviewSize.y = afterSize.height;
}
}
示例6: setDesiredCameraParameters
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
void setDesiredCameraParameters(Camera camera, boolean safeMode) {
Camera.Parameters parameters = camera.getParameters();
if (parameters == null) {
Log.w(TAG, "Device error: no camera parameters are available. Proceeding without configuration.");
return;
}
Log.i(TAG, "Initial camera parameters: " + parameters.flatten());
if (safeMode) {
Log.w(TAG, "In camera config safe mode -- most settings will not be honored");
}
initializeTorch(parameters, safeMode);
CameraConfigurationUtils.setFocus(
parameters,
mZXingConfiguration.getBoolean(ZXingConfiguration.KEY_AUTO_FOCUS, true),
mZXingConfiguration.getBoolean(ZXingConfiguration.KEY_DISABLE_CONTINUOUS_FOCUS, true),
safeMode);
if (!safeMode) {
if (mZXingConfiguration.getBoolean(ZXingConfiguration.KEY_INVERT_SCAN, false)) {
CameraConfigurationUtils.setInvertColor(parameters);
}
if (!mZXingConfiguration.getBoolean(ZXingConfiguration.KEY_DISABLE_BARCODE_SCENE_MODE, true)) {
CameraConfigurationUtils.setBarcodeSceneMode(parameters);
}
if (!mZXingConfiguration.getBoolean(ZXingConfiguration.KEY_DISABLE_METERING, true)) {
CameraConfigurationUtils.setVideoStabilization(parameters);
CameraConfigurationUtils.setFocusArea(parameters);
CameraConfigurationUtils.setMetering(parameters);
}
}
parameters.setPreviewSize(cameraResolution.x, cameraResolution.y);
Log.i(TAG, "Final camera parameters: " + parameters.flatten());
camera.setParameters(parameters);
Camera.Parameters afterParameters = camera.getParameters();
Camera.Size afterSize = afterParameters.getPreviewSize();
if (afterSize != null && (cameraResolution.x != afterSize.width || cameraResolution.y != afterSize.height)) {
Log.w(TAG, "Camera said it supported preview size " + cameraResolution.x + 'x' + cameraResolution.y +
", but after setting it, preview size is " + afterSize.width + 'x' + afterSize.height);
cameraResolution.x = afterSize.width;
cameraResolution.y = afterSize.height;
}
}
示例7: setDesiredCameraParameters
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
void setDesiredCameraParameters(OpenCamera camera, boolean safeMode) {
Camera theCamera = camera.getCamera();
Camera.Parameters parameters = theCamera.getParameters();
if (parameters == null) {
Log.w(TAG, "Device error: no camera parameters are available. Proceeding without configuration.");
return;
}
Log.i(TAG, "Initial camera parameters: " + parameters.flatten());
if (safeMode) {
Log.w(TAG, "In camera config safe mode -- most settings will not be honored");
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
initializeTorch(parameters, prefs, safeMode);
CameraConfigurationUtils.setBestPreviewFPS(parameters);
CameraConfigurationUtils.setFocus(
parameters,
prefs.getBoolean(PreferencesActivity.KEY_AUTO_FOCUS, true),
prefs.getBoolean(PreferencesActivity.KEY_DISABLE_CONTINUOUS_FOCUS, true),
safeMode);
if (!safeMode) {
if (prefs.getBoolean(PreferencesActivity.KEY_INVERT_SCAN, false)) {
CameraConfigurationUtils.setInvertColor(parameters);
}
if (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_BARCODE_SCENE_MODE, true)) {
CameraConfigurationUtils.setBarcodeSceneMode(parameters);
}
if (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_METERING, true)) {
CameraConfigurationUtils.setVideoStabilization(parameters);
CameraConfigurationUtils.setFocusArea(parameters);
CameraConfigurationUtils.setMetering(parameters);
}
}
parameters.setPreviewSize(bestPreviewSize.x, bestPreviewSize.y);
theCamera.setParameters(parameters);
theCamera.setDisplayOrientation(cwRotationFromDisplayToCamera);
Camera.Parameters afterParameters = theCamera.getParameters();
Camera.Size afterSize = afterParameters.getPreviewSize();
if (afterSize != null && (bestPreviewSize.x != afterSize.width || bestPreviewSize.y != afterSize.height)) {
Log.w(TAG, "Camera said it supported preview size " + bestPreviewSize.x + 'x' + bestPreviewSize.y +
", but after setting it, preview size is " + afterSize.width + 'x' + afterSize.height);
bestPreviewSize.x = afterSize.width;
bestPreviewSize.y = afterSize.height;
}
}
示例8: setDesiredCameraParameters
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
void setDesiredCameraParameters(Camera camera, boolean safeMode) {
Camera.Parameters parameters = camera.getParameters();
Log.i(TAG, "Initial camera parameters: " + parameters.flatten());
if (safeMode) {
Log.w(TAG, "In camera config safe mode -- most settings will not be honored");
}
initializeTorch(parameters, safeMode);
CameraConfigurationUtils.setFocus(
parameters,
CapturePreferences.getBoolean(CapturePreferences.KEY_AUTO_FOCUS),
CapturePreferences.getBoolean(CapturePreferences.KEY_DISABLE_CONTINUOUS_FOCUS),
safeMode);
if (!safeMode) {
if (CapturePreferences.getBoolean(CapturePreferences.KEY_INVERT_SCAN)) {
CameraConfigurationUtils.setInvertColor(parameters);
}
if (!CapturePreferences.getBoolean(CapturePreferences.KEY_DISABLE_BARCODE_SCENE_MODE)) {
CameraConfigurationUtils.setBarcodeSceneMode(parameters);
}
if (!CapturePreferences.getBoolean(CapturePreferences.KEY_DISABLE_METERING)) {
CameraConfigurationUtils.setVideoStabilization(parameters);
CameraConfigurationUtils.setFocusArea(parameters);
CameraConfigurationUtils.setMetering(parameters);
}
}
parameters.setPreviewSize(cameraResolution.x, cameraResolution.y);
camera.setParameters(parameters);
Camera.Parameters afterParameters = camera.getParameters();
Camera.Size afterSize = afterParameters.getPreviewSize();
if (afterSize != null && (cameraResolution.x != afterSize.width || cameraResolution.y != afterSize.height)) {
Log.w(TAG,
"Camera said it supported preview size " + cameraResolution.x + 'x' + cameraResolution.y +
", but after setting it, preview size is " + afterSize.width + 'x' + afterSize.height
);
cameraResolution.x = afterSize.width;
cameraResolution.y = afterSize.height;
}
}