本文整理匯總了Java中android.media.CamcorderProfile.QUALITY_HIGH屬性的典型用法代碼示例。如果您正苦於以下問題:Java CamcorderProfile.QUALITY_HIGH屬性的具體用法?Java CamcorderProfile.QUALITY_HIGH怎麽用?Java CamcorderProfile.QUALITY_HIGH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.media.CamcorderProfile
的用法示例。
在下文中一共展示了CamcorderProfile.QUALITY_HIGH屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getHigh
private int getHigh() {
CameraConstraints constraints=CameraConstraints.get();
if (constraints!=null) {
return(constraints.getHighCamcorderProfile());
}
return(CamcorderProfile.QUALITY_HIGH);
}
示例2: 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;
}
示例3: getHigh
private int getHigh() {
if ("LGE".equals(Build.MANUFACTURER) && "g3_tmo_us".equals(Build.PRODUCT)) {
return CamcorderProfile.QUALITY_480P;
}
return CamcorderProfile.QUALITY_HIGH;
}
示例4: 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;
}
示例5: 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;
}
示例6: getCamcorderProfileDescription
String getCamcorderProfileDescription(String quality) {
CamcorderProfile profile = getCamcorderProfile(quality);
String highest = "";
if (profile.quality == CamcorderProfile.QUALITY_HIGH) {
highest = "Highest: ";
}
String type = "";
if (profile.videoFrameWidth == 3840 && profile.videoFrameHeight == 2160) {
type = "4K Ultra HD ";
} else if (profile.videoFrameWidth == 1920
&& profile.videoFrameHeight == 1080) {
type = "Full HD ";
} else if (profile.videoFrameWidth == 1280
&& profile.videoFrameHeight == 720) {
type = "HD ";
} else if (profile.videoFrameWidth == 720
&& profile.videoFrameHeight == 480) {
type = "SD ";
} else if (profile.videoFrameWidth == 640
&& profile.videoFrameHeight == 480) {
type = "VGA ";
} else if (profile.videoFrameWidth == 352
&& profile.videoFrameHeight == 288) {
type = "CIF ";
} else if (profile.videoFrameWidth == 320
&& profile.videoFrameHeight == 240) {
type = "QVGA ";
} else if (profile.videoFrameWidth == 176
&& profile.videoFrameHeight == 144) {
type = "QCIF ";
}
String desc = highest
+ type
+ profile.videoFrameWidth
+ "x"
+ profile.videoFrameHeight
+ " "
+ getAspectRatioMPString(profile.videoFrameWidth,
profile.videoFrameHeight);
return desc;
}