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


Java CameraConfiguration.MEDIA_QUALITY_MEDIUM屬性代碼示例

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


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

示例1: setCameraPhotoQuality

private void setCameraPhotoQuality(Camera camera) {
    Camera.Parameters parameters = camera.getParameters();

    parameters.setPictureFormat(PixelFormat.JPEG);

    if (configurationProvider.getMediaQuality() == CameraConfiguration.MEDIA_QUALITY_LOW) {
        parameters.setJpegQuality(50);
    } else if (configurationProvider.getMediaQuality() == CameraConfiguration.MEDIA_QUALITY_MEDIUM) {
        parameters.setJpegQuality(75);
    } else if (configurationProvider.getMediaQuality() == CameraConfiguration.MEDIA_QUALITY_HIGH) {
        parameters.setJpegQuality(100);
    } else if (configurationProvider.getMediaQuality() == CameraConfiguration.MEDIA_QUALITY_HIGHEST) {
        parameters.setJpegQuality(100);
    }

    //
    parameters.setJpegQuality(50);
    parameters.setPictureSize(photoSize.getWidth(), photoSize.getHeight());

    camera.setParameters(parameters);
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:21,代碼來源:Camera1Manager.java

示例2: getCamcorderProfile

public static CamcorderProfile getCamcorderProfile(int currentCameraId, long maximumFileSize, int minimumDurationInSeconds) {
    if (maximumFileSize <= 0)
        return CamcorderProfile.get(currentCameraId, CameraConfiguration.MEDIA_QUALITY_HIGHEST);

    int[] qualities = new int[]{CameraConfiguration.MEDIA_QUALITY_HIGHEST,
            CameraConfiguration.MEDIA_QUALITY_HIGH, CameraConfiguration.MEDIA_QUALITY_MEDIUM,
            CameraConfiguration.MEDIA_QUALITY_LOW, CameraConfiguration.MEDIA_QUALITY_LOWEST};

    CamcorderProfile camcorderProfile;
    for (int i = 0; i < qualities.length; ++i) {
        camcorderProfile = CameraHelper.getCamcorderProfile(qualities[i], currentCameraId);
        double fileSize = CameraHelper.calculateApproximateVideoSize(camcorderProfile, minimumDurationInSeconds);

        if (fileSize > maximumFileSize) {
            long minimumRequiredBitRate = calculateMinimumRequiredBitRate(camcorderProfile, maximumFileSize, minimumDurationInSeconds);

            if (minimumRequiredBitRate >= camcorderProfile.videoBitRate / 4 && minimumRequiredBitRate <= camcorderProfile.videoBitRate) {
                camcorderProfile.videoBitRate = (int) minimumRequiredBitRate;
                return camcorderProfile;
            }
        } else return camcorderProfile;
    }
    return CameraHelper.getCamcorderProfile(CameraConfiguration.MEDIA_QUALITY_LOWEST, currentCameraId);
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:24,代碼來源:CameraHelper.java

示例3: setCameraPhotoQuality

private void setCameraPhotoQuality(Camera camera) {
    Camera.Parameters parameters = camera.getParameters();

    parameters.setPictureFormat(PixelFormat.JPEG);

    if (configurationProvider.getMediaQuality() == CameraConfiguration.MEDIA_QUALITY_LOW) {
        parameters.setJpegQuality(50);
    } else if (configurationProvider.getMediaQuality() == CameraConfiguration.MEDIA_QUALITY_MEDIUM) {
        parameters.setJpegQuality(75);
    } else if (configurationProvider.getMediaQuality() == CameraConfiguration.MEDIA_QUALITY_HIGH) {
        parameters.setJpegQuality(100);
    } else if (configurationProvider.getMediaQuality() == CameraConfiguration.MEDIA_QUALITY_HIGHEST) {
        parameters.setJpegQuality(100);
    }
    parameters.setPictureSize(photoSize.getWidth(), photoSize.getHeight());

    camera.setParameters(parameters);
}
 
開發者ID:sandrios,項目名稱:sandriosCamera,代碼行數:18,代碼來源:Camera1Manager.java

示例4: getVideoOptionCheckedIndex

protected int getVideoOptionCheckedIndex() {
    int checkedIndex = -1;
    if (mediaQuality == CameraConfiguration.MEDIA_QUALITY_AUTO) checkedIndex = 0;
    else if (mediaQuality == CameraConfiguration.MEDIA_QUALITY_HIGH) checkedIndex = 1;
    else if (mediaQuality == CameraConfiguration.MEDIA_QUALITY_MEDIUM) checkedIndex = 2;
    else if (mediaQuality == CameraConfiguration.MEDIA_QUALITY_LOW) checkedIndex = 3;

    if (passedMediaQuality != CameraConfiguration.MEDIA_QUALITY_AUTO) checkedIndex--;

    return checkedIndex;
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:11,代碼來源:BaseSandriosActivity.java

示例5: getPhotoOptionCheckedIndex

protected int getPhotoOptionCheckedIndex() {
    int checkedIndex = -1;
    if (mediaQuality == CameraConfiguration.MEDIA_QUALITY_HIGHEST) checkedIndex = 0;
    else if (mediaQuality == CameraConfiguration.MEDIA_QUALITY_HIGH) checkedIndex = 1;
    else if (mediaQuality == CameraConfiguration.MEDIA_QUALITY_MEDIUM) checkedIndex = 2;
    else if (mediaQuality == CameraConfiguration.MEDIA_QUALITY_LOWEST) checkedIndex = 3;
    return checkedIndex;
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:8,代碼來源:BaseSandriosActivity.java

示例6: extractConfiguration

private void extractConfiguration(Bundle bundle) {
    if (bundle != null) {
        if (bundle.containsKey(CameraConfiguration.Arguments.REQUEST_CODE))
            requestCode = bundle.getInt(CameraConfiguration.Arguments.REQUEST_CODE);

        if (bundle.containsKey(CameraConfiguration.Arguments.MEDIA_ACTION)) {
            switch (bundle.getInt(CameraConfiguration.Arguments.MEDIA_ACTION)) {
                case CameraConfiguration.MEDIA_ACTION_PHOTO:
                    mediaAction = CameraConfiguration.MEDIA_ACTION_PHOTO;
                    break;
                case CameraConfiguration.MEDIA_ACTION_VIDEO:
                    mediaAction = CameraConfiguration.MEDIA_ACTION_VIDEO;
                    break;
                default:
                    mediaAction = CameraConfiguration.MEDIA_ACTION_BOTH;
                    break;
            }
        }

        if (bundle.containsKey(CameraConfiguration.Arguments.MEDIA_QUALITY)) {
            switch (bundle.getInt(CameraConfiguration.Arguments.MEDIA_QUALITY)) {
                case CameraConfiguration.MEDIA_QUALITY_AUTO:
                    mediaQuality = CameraConfiguration.MEDIA_QUALITY_AUTO;
                    break;
                case CameraConfiguration.MEDIA_QUALITY_HIGHEST:
                    mediaQuality = CameraConfiguration.MEDIA_QUALITY_HIGHEST;
                    break;
                case CameraConfiguration.MEDIA_QUALITY_HIGH:
                    mediaQuality = CameraConfiguration.MEDIA_QUALITY_HIGH;
                    break;
                case CameraConfiguration.MEDIA_QUALITY_MEDIUM:
                    mediaQuality = CameraConfiguration.MEDIA_QUALITY_MEDIUM;
                    break;
                case CameraConfiguration.MEDIA_QUALITY_LOW:
                    mediaQuality = CameraConfiguration.MEDIA_QUALITY_LOW;
                    break;
                case CameraConfiguration.MEDIA_QUALITY_LOWEST:
                    mediaQuality = CameraConfiguration.MEDIA_QUALITY_LOWEST;
                    break;
                default:
                    mediaQuality = CameraConfiguration.MEDIA_QUALITY_MEDIUM;
                    break;
            }
            passedMediaQuality = mediaQuality;
        }

        if (bundle.containsKey(CameraConfiguration.Arguments.VIDEO_DURATION))
            videoDuration = bundle.getInt(CameraConfiguration.Arguments.VIDEO_DURATION);

        if (bundle.containsKey(CameraConfiguration.Arguments.VIDEO_FILE_SIZE))
            videoFileSize = bundle.getLong(CameraConfiguration.Arguments.VIDEO_FILE_SIZE);

        if (bundle.containsKey(CameraConfiguration.Arguments.MINIMUM_VIDEO_DURATION))
            minimumVideoDuration = bundle.getInt(CameraConfiguration.Arguments.MINIMUM_VIDEO_DURATION);

        if (bundle.containsKey(CameraConfiguration.Arguments.SHOW_PICKER))
            showPicker = bundle.getBoolean(CameraConfiguration.Arguments.SHOW_PICKER);

        if (bundle.containsKey(CameraConfiguration.Arguments.ENABLE_CROP))
            enableImageCrop = bundle.getBoolean(CameraConfiguration.Arguments.ENABLE_CROP);

        if (bundle.containsKey(CameraConfiguration.Arguments.FLASH_MODE))
            switch (bundle.getInt(CameraConfiguration.Arguments.FLASH_MODE)) {
                case CameraConfiguration.FLASH_MODE_AUTO:
                    flashMode = CameraConfiguration.FLASH_MODE_AUTO;
                    break;
                case CameraConfiguration.FLASH_MODE_ON:
                    flashMode = CameraConfiguration.FLASH_MODE_ON;
                    break;
                case CameraConfiguration.FLASH_MODE_OFF:
                    flashMode = CameraConfiguration.FLASH_MODE_OFF;
                    break;
                default:
                    flashMode = CameraConfiguration.FLASH_MODE_AUTO;
                    break;
            }
    }
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:78,代碼來源:BaseSandriosActivity.java


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