當前位置: 首頁>>代碼示例>>Java>>正文


Java Parameters.FLASH_MODE_OFF屬性代碼示例

本文整理匯總了Java中android.hardware.Camera.Parameters.FLASH_MODE_OFF屬性的典型用法代碼示例。如果您正苦於以下問題:Java Parameters.FLASH_MODE_OFF屬性的具體用法?Java Parameters.FLASH_MODE_OFF怎麽用?Java Parameters.FLASH_MODE_OFF使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.hardware.Camera.Parameters的用法示例。


在下文中一共展示了Parameters.FLASH_MODE_OFF屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: forceFlashOffIfSupported

private void forceFlashOffIfSupported(boolean forceOff) {
    String flashMode;
    if (!forceOff) {
        flashMode = mPreferences.getString(
                CameraSettings.KEY_VIDEOCAMERA_FLASH_MODE,
                mActivity.getString(R.string.pref_camera_video_flashmode_default));
    } else {
        flashMode = Parameters.FLASH_MODE_OFF;
    }
    List<String> supportedFlash = mParameters.getSupportedFlashModes();
    if (isSupported(flashMode, supportedFlash)) {
        mParameters.setFlashMode(flashMode);
    } else {
        flashMode = mParameters.getFlashMode();
        if (flashMode == null) {
            flashMode = mActivity.getString(
                    R.string.pref_camera_flashmode_no_flash);
        }
    }
}
 
開發者ID:asm-products,項目名稱:nexus-camera,代碼行數:20,代碼來源:VideoModule.java

示例2: init

/**
 * Resets per-recording state. This excludes {@link EglStateSaver},
 * which should be re-used across recordings made by this CameraEncoder instance.
 *
 * @param config the desired parameters for the next recording.
 */
private void init(@NonNull SessionConfig config) {
    mEncodedFirstFrame = false;
    mReadyForFrames = false;
    mRecording = false;
    mEosRequested = false;

    mCurrentCamera = -1;
    mDesiredCamera = Camera.CameraInfo.CAMERA_FACING_BACK;

    mCurrentFlash = Parameters.FLASH_MODE_OFF;
    mDesiredFlash = null;

    mCurrentFilter = -1;
    mNewFilter = Filters.FILTER_NONE;

    mThumbnailRequested = false;
    mThumbnailRequestedOnFrame = -1;

    mSessionConfig = config;
}
 
開發者ID:PerchLive,項目名稱:PerchBroadcast-Android-SDK,代碼行數:26,代碼來源:CameraEncoder.java

示例3: toggleFlashMode

/**
 * Toggle the flash mode between TORCH and OFF.
 * This will take effect immediately or as soon
 * as the camera preview becomes active.
 * <p/>
 * Called from UI thread
 */
public void toggleFlashMode() {
    String otherFlashMode = "";
    if (mCurrentFlash.equals(Parameters.FLASH_MODE_TORCH)) {
        otherFlashMode = Parameters.FLASH_MODE_OFF;
    } else {
        otherFlashMode = Parameters.FLASH_MODE_TORCH;
    }
    requestFlash(otherFlashMode);
}
 
開發者ID:PerchLive,項目名稱:PerchBroadcast-Android-SDK,代碼行數:16,代碼來源:CameraEncoder.java


注:本文中的android.hardware.Camera.Parameters.FLASH_MODE_OFF屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。