当前位置: 首页>>代码示例>>Java>>正文


Java CameraMetadata.LENS_FACING_FRONT属性代码示例

本文整理汇总了Java中android.hardware.camera2.CameraMetadata.LENS_FACING_FRONT属性的典型用法代码示例。如果您正苦于以下问题:Java CameraMetadata.LENS_FACING_FRONT属性的具体用法?Java CameraMetadata.LENS_FACING_FRONT怎么用?Java CameraMetadata.LENS_FACING_FRONT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.hardware.camera2.CameraMetadata的用法示例。


在下文中一共展示了CameraMetadata.LENS_FACING_FRONT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

private void start() {
  checkIsOnCameraThread();
  Logging.d(TAG, "start");

  try {
    cameraCharacteristics = cameraManager.getCameraCharacteristics(cameraId);
  } catch (final CameraAccessException e) {
    reportError("getCameraCharacteristics(): " + e.getMessage());
    return;
  }
  cameraOrientation = cameraCharacteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
  isCameraFrontFacing = cameraCharacteristics.get(CameraCharacteristics.LENS_FACING)
      == CameraMetadata.LENS_FACING_FRONT;

  findCaptureFormat();
  openCamera();
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:17,代码来源:Camera2Session.java

示例2: isFrontFacing

@Override
public boolean isFrontFacing(String deviceName) {
  CameraCharacteristics characteristics = getCameraCharacteristics(deviceName);

  return characteristics != null
      && characteristics.get(CameraCharacteristics.LENS_FACING)
      == CameraMetadata.LENS_FACING_FRONT;
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:8,代码来源:Camera2Enumerator.java

示例3: getJpegRotation

/**
 * Given the device orientation and Camera2 characteristics, this returns
 * the required JPEG rotation for this camera.
 *
 * @param deviceOrientationDegrees the device orientation in degrees.
 * @return The JPEG orientation in degrees.
 */
public static int getJpegRotation(int deviceOrientationDegrees,
        CameraCharacteristics characteristics) {
    if (deviceOrientationDegrees == OrientationEventListener.ORIENTATION_UNKNOWN) {
        return 0;
    }
    int facing = characteristics.get(CameraCharacteristics.LENS_FACING);
    int sensorOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
    if (facing == CameraMetadata.LENS_FACING_FRONT) {
        return (sensorOrientation + deviceOrientationDegrees) % 360;
    } else {
        return (sensorOrientation - deviceOrientationDegrees + 360) % 360;
    }
}
 
开发者ID:jameliu,项目名称:Camera2,代码行数:20,代码来源:CameraUtil.java

示例4: isFrontFacing

@Override
public boolean isFrontFacing() {
    return mCharacteristics.get(CameraCharacteristics.LENS_FACING)
            == CameraMetadata.LENS_FACING_FRONT;
}
 
开发者ID:jameliu,项目名称:Camera2,代码行数:5,代码来源:OneCameraZslImpl.java


注:本文中的android.hardware.camera2.CameraMetadata.LENS_FACING_FRONT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。