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