# MultiMedia\_CameraAbility - [Overview](#section59896362165625) - [Summary](#section1342120614165625) - [Files](#files) - [Data Structures](#nested-classes) - [Functions](#func-members) - [Details](#section1351292470165625) - [Function](#section23304000165625) - [CameraAbility\(\)](#ga7f1b94b32f7c7b121ea14b3147788497) - [GetParameterRange\(\)](#ga3fb9142cc5bbeafef3201ecaaf50c737) - [GetSupportedSizes\(\)](#ga840850d531b96cc5a829b257ade3c7e6) - [SetParameterRange\(\)](#ga23410306b850fe7edcb736f50fe8048d) - [\~CameraAbility\(\)](#ga797435bcd10278e33fb7b6f4951f0d7f) ## **Overview** **Description:** Defines the camera capability set for applications to achieve and access the capabilities. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Files

File Name

Description

camera_ability.h

Declares functions of the CameraAbility class.

## Data Structures

Data Structure Name

Description

OHOS::Media::CameraAbility

Declares functions of the CameraAbility class.

## Functions

Function

Description

OHOS::Media::CameraAbility::CameraAbility ()

A constructor used to create a CameraAbility instance.

OHOS::Media::CameraAbility::~CameraAbility ()

virtual

A destructor used to delete the CameraAbility instance.

OHOS::Media::CameraAbility::GetSupportedSizes (int format) const

std::list< CameraPicSize >

Obtains the supported image sizes for a specified image format.

OHOS::Media::CameraAbility::SetParameterRange (uint32_t key, std::list< T > rangeList)

template<typename T > int32_t

Sets value ranges for a specified parameter.

OHOS::Media::CameraAbility::GetParameterRange (uint32_t key) const

template<typename T > std::list< T >

Obtains the parameter value range based on a specified parameter key.

## **Details** ## **Function ** ## CameraAbility\(\) ``` OHOS::Media::CameraAbility::CameraAbility () ``` **Description:** A constructor used to create a **[CameraAbility](OHOS-Media-CameraAbility.md)** instance. ## GetParameterRange\(\) ``` std::list OHOS::Media::CameraAbility::GetParameterRange (uint32_t key) const ``` **Description:** Obtains the parameter value range based on a specified parameter key. **Parameters:**

Name

Description

key Indicates the parameter key.
**Returns:** Returns the parameter value range if obtained; returns **NULL** otherwise. ## GetSupportedSizes\(\) ``` std::list OHOS::Media::CameraAbility::GetSupportedSizes (int format) const ``` **Description:** Obtains the supported image sizes for a specified image format. **Parameters:**

Name

Description

format Indicates the image format, which can be YUV, H.265, or H.264.
**Returns:** Returns the image size list if obtained; returns **NULL** otherwise. ## SetParameterRange\(\) ``` int32_t OHOS::Media::CameraAbility::SetParameterRange (uint32_t key, std::list< T > rangeList ) ``` **Description:** Sets value ranges for a specified parameter. **Parameters:**

Name

Description

key Indicates the parameter key.
rangeList Indicates the list of parameter value ranges.
**Returns:** Returns **SUCCESS** if the setting is successful; returns **FAIL** otherwise. ## \~CameraAbility\(\) ``` virtual OHOS::Media::CameraAbility::~CameraAbility () ``` **Description:** A destructor used to delete the **[CameraAbility](OHOS-Media-CameraAbility.md)** instance.