CameraDeviceSelector Class

Description

用于在Android上选择Camera API(camera1或camera2)。camera1兼容性较好,但缺乏一些必要的信息,如时间戳。camera2在部分设备上存在兼容性问题。

不同选项会根据用途选择camera1或camera2。

getAndroidCameraApiType

以指定选项获取推荐的Android Camera API类型。

C

easyar_AndroidCameraApiType easyar_CameraDeviceSelector_getAndroidCameraApiType(easyar_CameraDevicePreference preference)

C++17

static AndroidCameraApiType getAndroidCameraApiType(CameraDevicePreference preference)

C++03

static AndroidCameraApiType getAndroidCameraApiType(CameraDevicePreference preference)

Java

public static int getAndroidCameraApiType(int preference)

Kotlin

companion object fun getAndroidCameraApiType(preference: Int): Int

Objective-C

+ (easyar_AndroidCameraApiType)getAndroidCameraApiType:(easyar_CameraDevicePreference)preference

Swift

public static func getAndroidCameraApiType(_ preference: CameraDevicePreference) -> AndroidCameraApiType

C#

public static AndroidCameraApiType getAndroidCameraApiType(CameraDevicePreference preference)

createCameraDevice

以指定选项创建 CameraDevice

C

void easyar_CameraDeviceSelector_createCameraDevice(easyar_CameraDevicePreference preference, easyar_CameraDevice * * Return)

C++17

static std::shared_ptr<CameraDevice> createCameraDevice(CameraDevicePreference preference)

C++03

static void createCameraDevice(CameraDevicePreference preference, CameraDevice * * Return)

Java

public static @Nonnull CameraDevice createCameraDevice(int preference)

Kotlin

companion object fun createCameraDevice(preference: Int): CameraDevice

Objective-C

+ (easyar_CameraDevice *)createCameraDevice:(easyar_CameraDevicePreference)preference

Swift

public static func createCameraDevice(_ preference: CameraDevicePreference) -> CameraDevice

C#

public static CameraDevice createCameraDevice(CameraDevicePreference preference)