# MultiMedia\_CameraConfig ## **Overview** Defines the **CameraConfig** class for operations on camera configurations. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Files

File Name

Description

camera_config.h

Declares functions in the CameraConfig class.

## Data Structures

Data Structure Name

Description

OHOS::Media::CameraConfig

Provides functions to configure camera parameters.

## Functions

Function Name

Description

OHOS::Media::CameraConfig::~CameraConfig ()

virtual 

A destructor used to delete the CameraAbility instance.

OHOS::Media::CameraConfig::CreateCameraConfig ()

static CameraConfig

Creates the CameraConfig instance of this singleton class to configure and read the required parameters.

OHOS::Media::CameraConfig::SetFrameStateCallback (FrameStateCallback *callback, EventHandler *handler)

virtual void 

Sets a frame state callback to responds to state changes.

OHOS::Media::CameraConfig::GetEventHandler () const

virtual EventHandler * 

Obtains the EventHandler object.

OHOS::Media::CameraConfig::GetFrameStateCb () const

virtual FrameStateCallback

Obtains a FrameStateCallback object.

OHOS::Media::CameraConfig::CameraConfig ()

 

A constructor used to create a CameraConfig instance.

## **Details** ## **Function Documentation** ## CameraConfig\(\) ``` OHOS::Media::CameraConfig::CameraConfig () ``` **Description:** A constructor used to create a **[CameraConfig](OHOS-Media-CameraConfig.md)** instance. ## CreateCameraConfig\(\) ``` static [CameraConfig](OHOS-Media-CameraConfig.md)* OHOS::Media::CameraConfig::CreateCameraConfig () ``` **Description:** Creates the **[CameraConfig](OHOS-Media-CameraConfig.md)** instance of this singleton class to configure and read the required parameters. **Returns:** Returns the **[CameraConfig](OHOS-Media-CameraConfig.md)** instance if created; returns **NULL** otherwise. ## GetEventHandler\(\) ``` virtual EventHandler* OHOS::Media::CameraConfig::GetEventHandler () const ``` **Description:** Obtains the **EventHandler** object. **Returns:** Returns the pointer to the **EventHandler** object if obtained; returns **NULL** otherwise. ## GetFrameStateCb\(\) ``` virtual [FrameStateCallback](OHOS-Media-FrameStateCallback.md)* OHOS::Media::CameraConfig::GetFrameStateCb () const ``` **Description:** Obtains a **[FrameStateCallback](OHOS-Media-FrameStateCallback.md)** object. **Returns:** Returns the pointer to the **[FrameStateCallback](OHOS-Media-FrameStateCallback.md)** object if obtained; returns **NULL** otherwise. ## SetFrameStateCallback\(\) ``` virtual void OHOS::Media::CameraConfig::SetFrameStateCallback ([FrameStateCallback](OHOS-Media-FrameStateCallback.md) * callback, EventHandler * handler ) ``` **Description:** Sets a frame state callback to responds to state changes. **Parameters:**

Name

Description

callback Indicates the frame state callback.
handler Indicates the event handler.
## \~CameraConfig\(\) ``` virtual OHOS::Media::CameraConfig::~CameraConfig () ``` **Description:** A destructor used to delete the **[CameraAbility](OHOS-Media-CameraAbility.md)** instance.