本文整理匯總了Java中android.hardware.Camera.Parameters.getSupportedVideoSizes方法的典型用法代碼示例。如果您正苦於以下問題:Java Parameters.getSupportedVideoSizes方法的具體用法?Java Parameters.getSupportedVideoSizes怎麽用?Java Parameters.getSupportedVideoSizes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.hardware.Camera.Parameters
的用法示例。
在下文中一共展示了Parameters.getSupportedVideoSizes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSupportedVideoSizes
import android.hardware.Camera.Parameters; //導入方法依賴的package包/類
@TargetApi(VERSION_CODES.HONEYCOMB)
protected List<Size> getSupportedVideoSizes(int currentSdkInt) {
Parameters params = mNativeCamera.getNativeCameraParameters();
List<Size> supportedVideoSizes;
if (currentSdkInt < Build.VERSION_CODES.HONEYCOMB) {
CLog.e(CLog.CAMERA, "Using supportedPreviewSizes iso supportedVideoSizes due to API restriction");
supportedVideoSizes = params.getSupportedPreviewSizes();
} else if (params.getSupportedVideoSizes() == null) {
CLog.e(CLog.CAMERA, "Using supportedPreviewSizes because supportedVideoSizes is null");
supportedVideoSizes = params.getSupportedPreviewSizes();
} else {
supportedVideoSizes = params.getSupportedVideoSizes();
}
return supportedVideoSizes;
}
示例2: run
import android.hardware.Camera.Parameters; //導入方法依賴的package包/類
@Override
public void run() {
if (mCamera == null) {
return;
}
mCamera.stopPreview();
Parameters params = mCamera.getParameters();
zoomRatios = params.getZoomRatios();
zoomIndex = minZoomIndex = 0;
maxZoomIndex = params.getMaxZoom();
List<Camera.Size> sizes = params.getSupportedPreviewSizes();
List<Camera.Size> vSize = params.getSupportedVideoSizes();
Camera.Size size = CameraHelper.getOptimalPreviewSize(sizes, vSize);
if(size != null)
{
params.setPreviewSize(size.width, size.height);
mCamera.setParameters(params);
resolutionSize = size;
}else {
resolutionSize = null;
}
try {
mCamera.setPreviewDisplay(mHolder);
cameraDisplayOrientation = CameraHelper.getCameraDisplayOrientation(
(Activity)mContext, currentCamera);
mCamera.setDisplayOrientation(cameraDisplayOrientation);
mCamera.startPreview();
} catch (Exception e) {
e.printStackTrace();
}
}