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