当尝试使用Camera2 API来确定设备所支持的视频大小时,使用CamcorderProfile.hasProfile
是可以的还是StreamConfigurationMap.getOutputSizes(MediaRecorder.class)
是唯一的方法?
我有一种感觉,CamcorderProfile
不受支持,因为它使用int
作为相机ID,而Camera2使用String
s作为ID,但我认为询问没有坏处。
发布于 2016-01-17 11:32:02
Camera2 ID是字符串。http://developer.android.com/reference/android/hardware/camera2/CameraManager.html#getCameraIdList()提到:
非移动相机使用从0开始的整数作为标识符,而可移动照相机对每个设备都有唯一的标识符,即使它们是相同的型号
因此(如果要信任原始设备制造商),我们可以将相机ID转换为int
,并与CamcorderProfile
一起使用。
https://stackoverflow.com/questions/34807157
复制相似问题