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


Java CamcorderProfile.QUALITY_LOW屬性代碼示例

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


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

示例1: selectRecVideoProfile

@SuppressLint("InlinedApi")
private int selectRecVideoProfile() {
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
		if (checkRecProfile(CamcorderProfile.QUALITY_1080P)
				&& frameHeight == 1080)
			return CamcorderProfile.QUALITY_1080P;
		if (checkRecProfile(CamcorderProfile.QUALITY_720P)
				&& frameHeight == 720)
			return CamcorderProfile.QUALITY_720P;
		if (checkRecProfile(CamcorderProfile.QUALITY_480P)
				&& frameHeight == 480)
			return CamcorderProfile.QUALITY_480P;
	}

	if (checkRecProfile(CamcorderProfile.QUALITY_HIGH)
			&& frameHeight >= 480)
		return CamcorderProfile.QUALITY_HIGH;

	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1
			&& checkRecProfile(CamcorderProfile.QUALITY_QVGA)
			&& frameHeight == 240)
		return CamcorderProfile.QUALITY_QVGA;

	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB
			&& checkRecProfile(CamcorderProfile.QUALITY_QCIF)
			&& frameHeight == 144)
		return CamcorderProfile.QUALITY_QCIF;

	if (checkRecProfile(CamcorderProfile.QUALITY_LOW))
		return CamcorderProfile.QUALITY_LOW;

	return CamcorderProfile.QUALITY_HIGH;
}
 
開發者ID:zeitgeist87,項目名稱:SpartanTimeLapseRecorder,代碼行數:33,代碼來源:RecSettings.java

示例2: readVideoPreferences

private void readVideoPreferences() {
    // The preference stores values from ListPreference and is thus string type for all values.
    // We need to convert it to int manually.
    SettingsManager settingsManager = mActivity.getSettingsManager();
    String videoQualityKey = isCameraFrontFacing() ? Keys.KEY_VIDEO_QUALITY_FRONT
        : Keys.KEY_VIDEO_QUALITY_BACK;
    String videoQuality = settingsManager
            .getString(SettingsManager.SCOPE_GLOBAL, videoQualityKey);
    int quality = SettingsUtil.getVideoQuality(videoQuality, mCameraId);
    Log.d(TAG, "Selected video quality for '" + videoQuality + "' is " + quality);

    // Set video quality.
    Intent intent = mActivity.getIntent();
    if (intent.hasExtra(MediaStore.EXTRA_VIDEO_QUALITY)) {
        int extraVideoQuality =
                intent.getIntExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);
        if (extraVideoQuality > 0) {
            quality = CamcorderProfile.QUALITY_HIGH;
        } else {  // 0 is mms.
            quality = CamcorderProfile.QUALITY_LOW;
        }
    }

    // Set video duration limit. The limit is read from the preference,
    // unless it is specified in the intent.
    if (intent.hasExtra(MediaStore.EXTRA_DURATION_LIMIT)) {
        int seconds =
                intent.getIntExtra(MediaStore.EXTRA_DURATION_LIMIT, 0);
        mMaxVideoDurationInMs = 1000 * seconds;
    } else {
        mMaxVideoDurationInMs = SettingsUtil.getMaxVideoDuration(mActivity
                .getAndroidContext());
    }

    // If quality is not supported, request QUALITY_HIGH which is always supported.
    if (CamcorderProfile.hasProfile(mCameraId, quality) == false) {
        quality = CamcorderProfile.QUALITY_HIGH;
    }
    mProfile = CamcorderProfile.get(mCameraId, quality);
    mPreferenceRead = true;
}
 
開發者ID:jameliu,項目名稱:Camera2,代碼行數:41,代碼來源:VideoModule.java

示例3: readVideoPreferences

private void readVideoPreferences() {
    // The preference stores values from ListPreference and is thus string type for all values.
    // We need to convert it to int manually.
    String videoQuality = mPreferences.getString(CameraSettings.KEY_VIDEO_QUALITY,
                    null);
    if (videoQuality == null) {
        // check for highest quality before setting default value
        videoQuality = CameraSettings.getSupportedHighestVideoQuality(mCameraId,
                mActivity.getResources().getString(R.string.pref_video_quality_default));
        mPreferences.edit().putString(CameraSettings.KEY_VIDEO_QUALITY, videoQuality);
    }
    int quality = Integer.valueOf(videoQuality);

    // Set video quality.
    Intent intent = mActivity.getIntent();
    if (intent.hasExtra(MediaStore.EXTRA_VIDEO_QUALITY)) {
        int extraVideoQuality =
                intent.getIntExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);
        if (extraVideoQuality > 0) {
            quality = CamcorderProfile.QUALITY_HIGH;
        } else {  // 0 is mms.
            quality = CamcorderProfile.QUALITY_LOW;
        }
    }

    // Set video duration limit. The limit is read from the preference,
    // unless it is specified in the intent.
    if (intent.hasExtra(MediaStore.EXTRA_DURATION_LIMIT)) {
        int seconds =
                intent.getIntExtra(MediaStore.EXTRA_DURATION_LIMIT, 0);
        mMaxVideoDurationInMs = 1000 * seconds;
    } else {
        mMaxVideoDurationInMs = CameraSettings.getMaxVideoDuration(mActivity);
    }

    // Read time lapse recording interval.
    String frameIntervalStr = mPreferences.getString(
            CameraSettings.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL,
            mActivity.getString(R.string.pref_video_time_lapse_frame_interval_default));
    mTimeBetweenTimeLapseFrameCaptureMs = Integer.parseInt(frameIntervalStr);
    mCaptureTimeLapse = (mTimeBetweenTimeLapseFrameCaptureMs != 0);
    // TODO: This should be checked instead directly +1000.
    if (mCaptureTimeLapse) quality += 1000;
    mProfile = CamcorderProfile.get(mCameraId, quality);
    getDesiredPreviewSize();
    mPreferenceRead = true;
}
 
開發者ID:asm-products,項目名稱:nexus-camera,代碼行數:47,代碼來源:VideoModule.java


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