当前位置: 首页>>代码示例>>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;未经允许,请勿转载。