本文整理汇总了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;
}
示例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;
}
示例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;
}