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


Java CameraConfiguration類代碼示例

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


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

示例1: setFlashMode

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
private void setFlashMode(Camera camera, Camera.Parameters parameters, @CameraConfiguration.FlashMode int flashMode) {
    try {
        switch (flashMode) {
            case CameraConfiguration.FLASH_MODE_AUTO:
                parameters.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO);
                break;
            case CameraConfiguration.FLASH_MODE_ON:
                parameters.setFlashMode(Camera.Parameters.FLASH_MODE_ON);
                break;
            case CameraConfiguration.FLASH_MODE_OFF:
                parameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
                break;
            default:
                parameters.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO);
                break;
        }
        camera.setParameters(parameters);
    } catch (Exception ignore) {
    }
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:21,代碼來源:Camera1Manager.java

示例2: setCameraPhotoQuality

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
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,代碼行數:22,代碼來源:Camera1Manager.java

示例3: getPhotoOrientation

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
@Override
protected int getPhotoOrientation(@CameraConfiguration.SensorPosition int sensorPosition) {
    int rotate;
    if (currentCameraId.equals(faceFrontCameraId)) {
        rotate = (360 + faceFrontCameraOrientation + configurationProvider.getDegrees()) % 360;
    } else {
        rotate = (360 + faceBackCameraOrientation - configurationProvider.getDegrees()) % 360;
    }

    if (rotate == 0) {
        orientation = ExifInterface.ORIENTATION_NORMAL;
    } else if (rotate == 90) {
        orientation = ExifInterface.ORIENTATION_ROTATE_90;
    } else if (rotate == 180) {
        orientation = ExifInterface.ORIENTATION_ROTATE_180;
    } else if (rotate == 270) {
        orientation = ExifInterface.ORIENTATION_ROTATE_270;
    }

    return orientation;
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:22,代碼來源:Camera1Manager.java

示例4: getCamcorderProfile

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
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,代碼行數:25,代碼來源:CameraHelper.java

示例5: onFlashModeChanged

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
@Override
public void onFlashModeChanged(@FlashSwitchView.FlashMode int mode) {
    switch (mode) {
        case FlashSwitchView.FLASH_AUTO:
            flashMode = CameraConfiguration.FLASH_MODE_AUTO;
            getCameraController().setFlashMode(CameraConfiguration.FLASH_MODE_AUTO);
            break;
        case FlashSwitchView.FLASH_ON:
            flashMode = CameraConfiguration.FLASH_MODE_ON;
            getCameraController().setFlashMode(CameraConfiguration.FLASH_MODE_ON);
            break;
        case FlashSwitchView.FLASH_OFF:
            flashMode = CameraConfiguration.FLASH_MODE_OFF;
            getCameraController().setFlashMode(CameraConfiguration.FLASH_MODE_OFF);
            break;
    }
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:18,代碼來源:BaseSandriosActivity.java

示例6: setup

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
public void setup(int mediaAction) {
    this.mediaAction = mediaAction;

    if (CameraConfiguration.MEDIA_ACTION_VIDEO == mediaAction) {
        recordButton.setup(mediaAction, this);
        flashSwitchView.setVisibility(GONE);
    } else {
        recordButton.setup(CameraConfiguration.MEDIA_ACTION_PHOTO, this);
    }

    if (CameraConfiguration.MEDIA_ACTION_BOTH != mediaAction) {
        mediaActionSwitchView.setVisibility(GONE);
    }
    //這裏讓切換Icon消失
    else mediaActionSwitchView.setVisibility(GONE);
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:17,代碼來源:CameraControlPanel.java

示例7: onStopVideoRecord

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
public void onStopVideoRecord() {

        //Set Progress
        CircleAngleAnimation animation = new CircleAngleAnimation(circleProgressView, 0);
        animation.setDuration(0);
        circleProgressView.startAnimation(animation);

        if (fileObserver != null)
            fileObserver.stopWatching();
        countDownTimer.stop();
        //這裏讓recycleView消失
        //recyclerView.setVisibility(VISIBLE);
        recordSizeText.setVisibility(GONE);
        cameraSwitchView.setVisibility(View.VISIBLE);
        settingsButton.setVisibility(VISIBLE);

        if (CameraConfiguration.MEDIA_ACTION_BOTH != mediaAction) {
            mediaActionSwitchView.setVisibility(GONE);
        }
        //去掉Media Switch
        else mediaActionSwitchView.setVisibility(GONE);
        recordButton.setRecordState(RecordButton.READY_FOR_RECORD_STATE);
    }
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:24,代碼來源:CameraControlPanel.java

示例8: getVideoQualityOptions

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
@Override
protected CharSequence[] getVideoQualityOptions() {
    List<CharSequence> videoQualities = new ArrayList<>();

    if (getMinimumVideoDuration() > 0)
        videoQualities.add(new VideoQualityOption(CameraConfiguration.MEDIA_QUALITY_AUTO, CameraHelper.getCamcorderProfile(CameraConfiguration.MEDIA_QUALITY_AUTO, getCameraController().getCurrentCameraId()), getMinimumVideoDuration()));

    CamcorderProfile camcorderProfile = CameraHelper.getCamcorderProfile(CameraConfiguration.MEDIA_QUALITY_HIGH, getCameraController().getCurrentCameraId());
    double videoDuration = CameraHelper.calculateApproximateVideoDuration(camcorderProfile, getVideoFileSize());
    videoQualities.add(new VideoQualityOption(CameraConfiguration.MEDIA_QUALITY_HIGH, camcorderProfile, videoDuration));

    camcorderProfile = CameraHelper.getCamcorderProfile(CameraConfiguration.MEDIA_QUALITY_MEDIUM, getCameraController().getCurrentCameraId());
    videoDuration = CameraHelper.calculateApproximateVideoDuration(camcorderProfile, getVideoFileSize());
    videoQualities.add(new VideoQualityOption(CameraConfiguration.MEDIA_QUALITY_MEDIUM, camcorderProfile, videoDuration));

    camcorderProfile = CameraHelper.getCamcorderProfile(CameraConfiguration.MEDIA_QUALITY_LOW, getCameraController().getCurrentCameraId());
    videoDuration = CameraHelper.calculateApproximateVideoDuration(camcorderProfile, getVideoFileSize());
    videoQualities.add(new VideoQualityOption(CameraConfiguration.MEDIA_QUALITY_LOW, camcorderProfile, videoDuration));

    CharSequence[] array = new CharSequence[videoQualities.size()];
    videoQualities.toArray(array);

    return array;
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:25,代碼來源:Camera1Activity.java

示例9: setCameraPhotoQuality

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
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,代碼行數:19,代碼來源:Camera1Manager.java

示例10: launchIntent

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
private void launchIntent() {
    if (CameraHelper.hasCamera(mActivity)) {
        Intent cameraIntent;
        if (CameraHelper.hasCamera2(mActivity)) {
            cameraIntent = new Intent(mActivity, Camera2Activity.class);
        } else {
            cameraIntent = new Intent(mActivity, Camera1Activity.class);
        }
        cameraIntent.putExtra(CameraConfiguration.Arguments.SHOW_PICKER, showPicker);
        cameraIntent.putExtra(CameraConfiguration.Arguments.PICKER_TYPE, type);
        cameraIntent.putExtra(CameraConfiguration.Arguments.MEDIA_ACTION, mediaAction);
        cameraIntent.putExtra(CameraConfiguration.Arguments.ENABLE_CROP, enableImageCrop);
        cameraIntent.putExtra(CameraConfiguration.Arguments.AUTO_RECORD, autoRecord);

        if (videoSize > 0) {
            cameraIntent.putExtra(CameraConfiguration.Arguments.VIDEO_FILE_SIZE, videoSize * 1024 * 1024);
        }
        mActivity.startActivity(cameraIntent);
    }
}
 
開發者ID:sandrios,項目名稱:sandriosCamera,代碼行數:21,代碼來源:SandriosCamera.java

示例11: getOutputMediaFile

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
public static File getOutputMediaFile(Context context, @CameraConfiguration.MediaAction int mediaAction) {
    File mediaStorageDir = context.getFilesDir();

    if (!mediaStorageDir.exists()) {
        if (!mediaStorageDir.mkdirs()) {
            Log.d(TAG, "Failed to create directory.");
            return null;
        }
    }

    String timeStamp = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss", Locale.ENGLISH)
            .format(new Date());
    File mediaFile;
    if (mediaAction == CameraConfiguration.MEDIA_ACTION_PHOTO) {
        mediaFile = new File(mediaStorageDir.getPath() + File.separator +
                "IMG_" + timeStamp + ".jpg");
    } else if (mediaAction == CameraConfiguration.MEDIA_ACTION_VIDEO) {
        mediaFile = new File(mediaStorageDir.getPath() + File.separator +
                "VID_" + timeStamp + ".mp4");
    } else {
        return null;
    }

    return mediaFile;
}
 
開發者ID:sandrios,項目名稱:sandriosCamera,代碼行數:26,代碼來源:CameraHelper.java

示例12: getVideoQualityOptions

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
@Override
protected CharSequence[] getVideoQualityOptions() {
    List<CharSequence> videoQualities = new ArrayList<>();

    if (getMinimumVideoDuration() > 0)
        videoQualities.add(new VideoQualityOption(CameraConfiguration.MEDIA_QUALITY_AUTO, CameraHelper.getCamcorderProfile(CameraConfiguration.MEDIA_QUALITY_AUTO, getCameraController().getCurrentCameraId()), getMinimumVideoDuration()));


    CamcorderProfile camcorderProfile = CameraHelper.getCamcorderProfile(CameraConfiguration.MEDIA_QUALITY_HIGH, getCameraController().getCurrentCameraId());
    double videoDuration = CameraHelper.calculateApproximateVideoDuration(camcorderProfile, getVideoFileSize());
    videoQualities.add(new VideoQualityOption(CameraConfiguration.MEDIA_QUALITY_HIGH, camcorderProfile, videoDuration));

    camcorderProfile = CameraHelper.getCamcorderProfile(CameraConfiguration.MEDIA_QUALITY_MEDIUM, getCameraController().getCurrentCameraId());
    videoDuration = CameraHelper.calculateApproximateVideoDuration(camcorderProfile, getVideoFileSize());
    videoQualities.add(new VideoQualityOption(CameraConfiguration.MEDIA_QUALITY_MEDIUM, camcorderProfile, videoDuration));

    camcorderProfile = CameraHelper.getCamcorderProfile(CameraConfiguration.MEDIA_QUALITY_LOW, getCameraController().getCurrentCameraId());
    videoDuration = CameraHelper.calculateApproximateVideoDuration(camcorderProfile, getVideoFileSize());
    videoQualities.add(new VideoQualityOption(CameraConfiguration.MEDIA_QUALITY_LOW, camcorderProfile, videoDuration));

    CharSequence[] array = new CharSequence[videoQualities.size()];
    videoQualities.toArray(array);

    return array;
}
 
開發者ID:sandrios,項目名稱:sandriosCamera,代碼行數:26,代碼來源:Camera2Activity.java

示例13: onActivityResult

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == GET_PHOTO && resultCode == RESULT_OK) {
        Log.e("File", "" + data.getStringExtra(CameraConfiguration.Arguments.FILE_PATH));
        sendPhotoFirebase( data.getStringExtra(CameraConfiguration.Arguments.FILE_PATH) );
    }

}
 
開發者ID:AleBarreto,項目名稱:FeedFire,代碼行數:11,代碼來源:MainActivity.java

示例14: getPhoto

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
private void getPhoto(){
    new SandriosCamera(MainActivity.this, GET_PHOTO)
            .setShowPicker(false)
            .setMediaAction(CameraConfiguration.MEDIA_ACTION_PHOTO)
            .enableImageCropping(true)
            .launchCamera();
}
 
開發者ID:AleBarreto,項目名稱:FeedFire,代碼行數:8,代碼來源:MainActivity.java

示例15: launchCamera

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入依賴的package包/類
private void launchCamera(){
    new SandriosCamera(activity, CAPTURE_MEDIA)
            .setShowPicker(false)
            .setMediaAction(CameraConfiguration.MEDIA_ACTION_BOTH)
            .enableImageCropping(false)
            .launchCamera();
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:8,代碼來源:MainActivity.java


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