當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。