# MultiMedia\_FrameConfig - [Overview](#section1826838220165625) - [Summary](#section2063584699165625) - [Files](#files) - [Data Structures](#nested-classes) - [Functions](#func-members) - [Details](#section562581684165625) - [Function](#section1303191587165625) - [AddSurface\(\)](#ga16760311713db03bf06ea0a6d6622013) - [FrameConfig\(\) \[1/2\]](#ga043537d52f5db46d981f9e89848b0fba) - [FrameConfig\(\) \[2/2\]](#gac8f74ff3689605a59a17997bdeaec1fc) - [GetFrameConfigType\(\)](#ga382977445a583ed0424c5ccf581e824c) - [GetParameter\(\)](#ga05147491c6e25df54d75d5ed0c201d65) - [GetSurfaces\(\)](#ga955d04df96c009e4699ea6ed46d9e758) - [RemoveSurface\(\)](#ga9ac4bc5e52840ee579482a3836774762) - [SetParameter\(\)](#ga6b4ee39d1c1bf219e4a84df470f6007a) - [\~FrameConfig\(\)](#gaa2e58c2ce602d9263b76596374823616) ## **Overview** **Description:** Defines the **FrameConfig** class for operations related to frame configurations. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Files

File Name

Description

frame_config.h

Declares APIs of the FrameConfig class.

## Data Structures

Data Structure Name

Description

OHOS::Media::FrameConfig

Provides functions to configure frames.

## Functions

Function

Description

OHOS::Media::FrameConfig::FrameConfig ()=delete

A constructor used to create a FrameConfig instance.

OHOS::Media::FrameConfig::FrameConfig (int32_t type)

A constructor used to create a FrameConfig instance based on the configuration mode.

OHOS::Media::FrameConfig::~FrameConfig ()

A destructor used to delete the FrameConfig instance.

OHOS::Media::FrameConfig::GetFrameConfigType ()

int32_t

Obtains the frame configuration type.

OHOS::Media::FrameConfig::GetSurfaces ()

std::list< Surface * >

Obtains a list of shared memories (surface objects).

OHOS::Media::FrameConfig::AddSurface (Surface &surface)

void

Adds a surface (an object of shared memory).

OHOS::Media::FrameConfig::RemoveSurface (Surface &surface)

void

Removes a surface (an object of shared memory). You can call this function to release the surface when your application does not need to obtain data.

OHOS::Media::FrameConfig::SetParameter (uint32_t key, const T value)

template<typename T > void

Sets the common parameter.

OHOS::Media::FrameConfig::GetParameter (uint32_t key, T &value)

template<typename T > void

Obtains the value of a common parameter based on its key. For details, see CAMERA_FUC_KEY.

## **Details** ## **Function ** ## AddSurface\(\) ``` void OHOS::Media::FrameConfig::AddSurface ([Surface](OHOS-Surface.md) & surface) ``` **Description:** Adds a surface \(an object of shared memory\). **Parameters:**

Name

Description

surface Indicates the surface to add.
## FrameConfig\(\) \[1/2\] ``` OHOS::Media::FrameConfig::FrameConfig () ``` **Description:** A constructor used to create a **[FrameConfig](OHOS-Media-FrameConfig.md)** instance. ## FrameConfig\(\) \[2/2\] ``` OHOS::Media::FrameConfig::FrameConfig (int32_t type) ``` **Description:** A constructor used to create a **[FrameConfig](OHOS-Media-FrameConfig.md)** instance based on the configuration mode. **Parameters:**

Name

Description

type Indicates the frame configuration mode, which can be FRAME_CONFIG_PREVIEW, <b>FRAME_CONFIG_RECORD, or FRAME_CONFIG_CAPTURE.
## GetFrameConfigType\(\) ``` int32_t OHOS::Media::FrameConfig::GetFrameConfigType () ``` **Description:** Obtains the frame configuration type. **Returns:** Returns the frame configuration type if obtained; returns **-1** otherwise. ## GetParameter\(\) ``` void OHOS::Media::FrameConfig::GetParameter (uint32_t key, T & value ) ``` **Description:** Obtains the value of a common parameter based on its key. For details, see **CAMERA\_FUC\_KEY**. **Parameters:**

Name

Description

key Indicates the common parameter key.
## GetSurfaces\(\) ``` std::list<[Surface](OHOS-Surface.md) *> OHOS::Media::FrameConfig::GetSurfaces () ``` **Description:** Obtains a list of shared memories \(surface objects\). **Returns:** Returns the list of shared memories if obtained; returns **NULL** otherwise. ## RemoveSurface\(\) ``` void OHOS::Media::FrameConfig::RemoveSurface ([Surface](OHOS-Surface.md) & surface) ``` **Description:** Removes a surface \(an object of shared memory\). You can call this function to release the surface when your application does not need to obtain data. **Parameters:**

Name

Description

surface Indicates the surface to remove.
## SetParameter\(\) ``` void OHOS::Media::FrameConfig::SetParameter (uint32_t key, const T value ) ``` **Description:** Sets the common parameter. **Parameters:**

Name

Description

key Indicates the common parameter key to set.
value Indicates the common parameter value to set.
## \~FrameConfig\(\) ``` OHOS::Media::FrameConfig::~FrameConfig () ``` **Description:** A destructor used to delete the **[FrameConfig](OHOS-Media-FrameConfig.md)** instance.