# MultiMedia\_FrameStateCallback - [Overview](#section594449935165625) - [Summary](#section1998256790165625) - [Files](#files) - [Data Structures](#nested-classes) - [Functions](#func-members) - [Details](#section1902417098165625) - [Function](#section543315877165625) - [FrameStateCallback\(\)](#gab2557f65a2744911b66361a895450d67) - [OnFrameError\(\)](#ga8692c0a7433e0a98b6a6e364081c3b6a) - [OnFrameFinished\(\)](#gaad7c0bd2d27255a8b63d0f5fb75f3b1e) - [\~FrameStateCallback\(\)](#gad9ee33e328b523316313b79979b93abb) ## **Overview** **Description:** Provides callbacks for frame state changes, in which you can implement operations to response to the changes. **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::FrameStateCallback

Provides functions to listen for frame states and response to the state changes.

## Functions

Function

Description

OHOS::Media::FrameStateCallback::FrameStateCallback ()=default

A constructor used to create a FrameStateCallback instance.

OHOS::Media::FrameStateCallback::~FrameStateCallback ()=default

A destructor used to delete the FrameStateCallback instance.

OHOS::Media::FrameStateCallback::OnFrameFinished (Camera &camera, FrameConfig &frameConfig, FrameResult &frameResult)

virtual void

Called when the frame capture is finished.

OHOS::Media::FrameStateCallback::OnFrameError (Camera &camera, FrameConfig &frameConfig, int32_t errorCode, FrameResult &frameResult)

virtual void

Called when the frame capture fails.

## **Details** ## **Function ** ## FrameStateCallback\(\) ``` OHOS::Media::FrameStateCallback::FrameStateCallback () ``` **Description:** A constructor used to create a **[FrameStateCallback](OHOS-Media-FrameStateCallback.md)** instance. ## OnFrameError\(\) ``` virtual void OHOS::Media::FrameStateCallback::OnFrameError ([Camera](OHOS-Media-Camera.md) & camera, [FrameConfig](OHOS-Media-FrameConfig.md) & frameConfig, int32_t errorCode, FrameResult & frameResult ) ``` **Description:** Called when the frame capture fails. **Parameters:**

Name

Description

camera Indicates the camera.
frameConfig Indicates the frame configuration.
errorCode Indicates the error code.
frameResult Indicates the capture results.
## OnFrameFinished\(\) ``` virtual void OHOS::Media::FrameStateCallback::OnFrameFinished ([Camera](OHOS-Media-Camera.md) & camera, [FrameConfig](OHOS-Media-FrameConfig.md) & frameConfig, FrameResult & frameResult ) ``` **Description:** Called when the frame capture is finished. **Parameters:**

Name

Description

camera Indicates the camera.
frameConfig Indicates the frame configuration.
frameResult Indicates the capture results.
## \~FrameStateCallback\(\) ``` OHOS::Media::FrameStateCallback::~FrameStateCallback () ``` **Description:** A destructor used to delete the **[FrameStateCallback](OHOS-Media-FrameStateCallback.md)** instance.