CameraManagermanager=(CameraManager)getSystemService(Context.CAMERA_SERVICE);String[]cameraIdList=manager.getCameraIdList();for(StringcameraId:cameraIdList){CameraCharacteristicscharacteristics=manager.getCameraCharacteristics(cameraId);intlensFacing=characteristics.get(CameraCharacteristics.LENS_FACING);float[]foca...
mPreviewBuilder.set(CaptureRequest.JPEG_ORIENTATION, (mCameraType == CameraCharacteristics.LENS_FACING_FRONT) ? 90 : 270); // 创建一个相片捕获会话。此时预览画面显示在纹理视图上 mCameraDevice.createCaptureSession(Arrays.asList(surface, mImageReader.getSurface()), mSessionStateCallback, mHandler); }...
LENS_FACING 摄像头方向组 LENS_FACING_BACK LENS_FACING_EXTERNAL LENS_FACING_FRONT LENS 镜片组 FLASH 闪光灯组 NOISE_REDUCTION 降噪组 SENSOR 传感器组 STATISTICS_FACE 统计人脸组(人脸检测) TONEMAP 色调组 CONTROL_AE_ANTIBANDING_MODE_AUTO 赫兹自动 CONTROL_AE_ANTIBANDING_MODE_50HZ 赫兹50 CONTROL_AE_ANTIB...
Integer lensFacing = characteristics.get(CameraCharacteristics.LENS_FACING); Integer sensorOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION); Integer supportedHardwareLevel = characteristics.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL); if (lensFacing != null && lensFacing == ...
LENS_FACING:获取摄像头的方向。LENS_FACING_FRONT是前摄像头,LENS_FACING_BACK是后摄像头。 获取FPS的范围 获取大小 调用CameraManager .open()方法在回调中得到CameraDevice. Create Session 通过CameraDevice.createCaptureSession()在回调中获取CameraCaptureSession. ...
前置摄像头(LENS_FACING_FRONT)或 后置摄像头(LENS_FACING_BACK)CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL:获取当前设备支持的相机特性CameraCharacteristics.SENSOR_ORIENTATION:获取摄像头方向CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP:获取StreamConfigurationMap,它是管理摄像头支持的所有输出格式和尺寸...
例如,传入ACAMERA_SENSOR_ORIENTATION的TAG,可以获取Camera的旋转角度;ACAMERA_LENS_FACING,可以判断是前置(ACAMERA_LENS_FACING_FRONT)或后置(ACAMERA_LENS_FACING_BACK)摄像头;而ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,可以获得摄像头的分辨率。 其它TAG,可参照NdkCameraMetadataTags.h。
.requireLensFacing(CameraSelector.LENS_FACING_BACK) .build(); preview.setSurfaceProvider(mBinding.previewView.getSurfaceProvider()); cameraProvider.bindToLifecycle(this, cameraSelector, preview, mImageAnalysis); mRunning =true; } 要开启预览,通过Preview.Builder构建一个Preview。用CameraSelector来选择后置...
// 声明一个生命周期拥有者privateint mCameraType=CameraSelector.LENS_FACING_BACK;// 摄像头类型privateint mAspectRatio=AspectRatio.RATIO_16_9;// 宽高比例privateint mFlashMode=ImageCapture.FLASH_MODE_AUTO;// 闪光灯模式privateString mMediaDir;// 媒体保存目录publicCameraXView(Context context,...
LENS_FACING:获取摄像头方向。LENS_FACING_FRONT是前摄像头,LENS_FACING_BACK是后摄像头。 SENSOR_ORIENTATION:获取摄像头拍照的方向。 FLASH_INFO_AVAILABLE:获取是否支持闪光灯。 SCALER_AVAILABLE_MAX_DIGITAL_ZOOM:获取最大的数字调焦值,也就是zoom最大值。