MultiMedia_CameraKit

Overview

Defines the CameraKit class for using camera functionalities.

Since:

1.0

Version:

1.0

Summary

Files

File Name

Description

camera_kit.h

Declares functions in the CameraKit class.

Data Structures

Data Structure Name

Description

OHOS::Media::CameraKit

Provides functions in the CameraKit class.

Functions

Function Name

Description

OHOS::Media::CameraKit::~CameraKit ()

 

A destructor used to delete the CameraKit instance.

OHOS::Media::CameraKit::GetInstance ()

static CameraKit 

Obtains a single instance of the CameraKit.

OHOS::Media::CameraKit::GetCameraIds ()

std::list< std::string > 

Obtains IDs of cameras that are currently available.

OHOS::Media::CameraKit::GetCameraAbility (std::string cameraId)

const CameraAbility  

Obtains the camera capability, including the resolutions and frame rates.

OHOS::Media::CameraKit::RegisterCameraDeviceCallback (CameraDeviceCallback &callback, EventHandler &handler)

void 

Registers a camera callback for camera status changes and an event callback to respond to a triggered event.

OHOS::Media::CameraKit::UnregisterCameraDeviceCallback (CameraDeviceCallback &callback)

void 

Unregisters a camera callback.

OHOS::Media::CameraKit::CreateCamera (const std::string &cameraId, CameraStateCallback &callback, EventHandler &handler)

void 

Creates a camera object.

Details

Function Documentation

CreateCamera()

  1. void OHOS::Media::CameraKit::CreateCamera(const std::string& cameraId,[CameraStateCallback]($api-api-SmartVision-Devices-OHOS-Media-CameraStateCallback.md)& callback,EventHandler& handler )

Description:

Creates a camera object.

Parameters:

Name

Description

cameraIdIndicates the camera ID.
callbackIndicates the camera callback.
handlerIndicates the event callback to register.

GetCameraAbility()

  1. const[CameraAbility]($api-api-SmartVision-Devices-OHOS-Media-CameraAbility.md)* OHOS::Media::CameraKit::GetCameraAbility(std::string cameraId)

Description:

Obtains the camera capability, including the resolutions and frame rates.

Parameters:

Name

Description

cameraIdIndicates the camera ID.

Returns:

Returns the CameraAbility object.

GetCameraIds()

  1. std::list<std::string> OHOS::Media::CameraKit::GetCameraIds()

Description:

Obtains IDs of cameras that are currently available.

Returns:

Returns the camera IDs if obtained; returns NULL otherwise.

GetInstance()

  1. static[CameraKit]($api-api-SmartVision-Devices-OHOS-Media-CameraKit.md)* OHOS::Media::CameraKit::GetInstance()

Description:

Obtains a single instance of the CameraKit.

Returns:

Returns the CameraKit instance if obtained; returns NULL otherwise.

RegisterCameraDeviceCallback()

  1. void OHOS::Media::CameraKit::RegisterCameraDeviceCallback([CameraDeviceCallback]($api-api-SmartVision-Devices-OHOS-Media-CameraDeviceCallback.md)& callback,EventHandler& handler )

Description:

Registers a camera callback for camera status changes and an event callback to respond to a triggered event.

Parameters:

Name

Description

callbackIndicates the camera callback to register.
handlerIndicates the event callback to register.

UnregisterCameraDeviceCallback()

  1. void OHOS::Media::CameraKit::UnregisterCameraDeviceCallback([CameraDeviceCallback]($api-api-SmartVision-Devices-OHOS-Media-CameraDeviceCallback.md)& callback)

Description:

Unregisters a camera callback.

Parameters:

Name

Description

callbackIndicates the camera callback to unregister.

~CameraKit()

  1. OHOS::Media::CameraKit::~CameraKit()

Description:

A destructor used to delete the CameraKit instance.