Android CamcorderProfile 和 Camera2
Android CamcorderProfile and Camera2
尝试使用 Camera2 API 确定设备支持的视频尺寸时,使用 CamcorderProfile.hasProfile
, or is StreamConfigurationMap.getOutputSizes(MediaRecorder.class)
是唯一的方法吗?
我感觉不支持CamcorderProfile
,因为它需要一个int
作为相机ID,而Camera2使用String
作为ID,但我认为没有问的害处。
Camera2 ID 是字符串。 http://developer.android.com/reference/android/hardware/camera2/CameraManager.html#getCameraIdList() 提到:
"Non-removable cameras use integers starting at 0 for their identifiers, while removable cameras have a unique identifier for each individual device, even if they are the same model"
因此(如果要信任 OEM),我们可以将相机 ID 转换为 int
,并将其与 CamcorderProfile
一起使用
尝试使用 Camera2 API 确定设备支持的视频尺寸时,使用 CamcorderProfile.hasProfile
, or is StreamConfigurationMap.getOutputSizes(MediaRecorder.class)
是唯一的方法吗?
我感觉不支持CamcorderProfile
,因为它需要一个int
作为相机ID,而Camera2使用String
作为ID,但我认为没有问的害处。
Camera2 ID 是字符串。 http://developer.android.com/reference/android/hardware/camera2/CameraManager.html#getCameraIdList() 提到:
"Non-removable cameras use integers starting at 0 for their identifiers, while removable cameras have a unique identifier for each individual device, even if they are the same model"
因此(如果要信任 OEM),我们可以将相机 ID 转换为 int
,并将其与 CamcorderProfile