# MEDIA\_UTILS\_LITE
- [Introduction](#section11660541593)
- [Directory Structure](#section8685144625320)
- [Usage](#section1648194512427)
- [Constraints](#section161941989596)
- [Repositories Involved](#section105062051111614)
## Introduction
This repository defines common information such as media error codes and data types required for audio and video recording and playback.
Data types
- **SourceType**: type of the media source to play
- **BufferFlags**: flags of the data carried in the buffer
- **AudioSourceType**: enumeration of audio input source types
- **AudioCodecFormat**: enumeration of audio data formats
- **AudioStreamType**: enumeration of audio stream types
- **AudioBitWidth**: enumeration of sampling bit width
The following table lists the error codes.
Code
|
Macro
|
Description
|
0xffffffff
|
ERR_INVALID_READ
|
Data reading failed.
|
0x0
|
SUCCESS
|
Operation succeeded.
|
0x3c10000
|
ERROR
|
Operation failed.
|
0x3c10001
|
ERR_ILLEGAL_STATE
|
Invalid status.
|
0x2A05
|
ERR_INVALID_PARAM
|
Invalid parameter.
|
0x3c10003
|
ERR_EARLY_PREPARE
|
Early start.
|
0x3c10004
|
ERR_SOURCE_NOT_SET
|
Media source not set.
|
0x3c10005
|
ERR_INVALID_OPERATION
|
Invalid operation.
|
0x2A09
|
ERR_NOFREE_CHANNEL
|
No free channel.
|
0x3c10007
|
ERR_READ_BUFFER
|
Error occurred during buffer reading.
|
0x3c10008
|
ERR_NOT_STARTED
|
Device not started.
|
0x3c100c8
|
ERR_UNKNOWN
|
Unknown error.
|
**Figure 1** Position of this repository \(in the dotted blue box\) in the multimedia subsystem
-in-the-multimedia-subsystem.png "position-of-this-repository-(in-the-dotted-blue-box)-in-the-multimedia-subsystem")
## Directory Structure
```
foundation/multimedia/utils/lite
├── interfaces # Header file of the data types and media formats
└── hals # HAL adaptation APIs
└── src # Implementation of the data types and media formats
```
## Usage
Build a single repository in the root directory.
```
# Select the development board.
hb set
# Build this repository.
hb build media_service
```
## Constraints
C++ 11 or later
## Repositories Involved
[Multimedia subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/multimedia.md)
[camera\_lite](https://gitee.com/openharmony/multimedia_camera_lite/blob/master/README.md)
[camera\_sample\_lite](https://gitee.com/openharmony/applications_sample_camera/blob/master/README.md)
[audio\_lite](https://gitee.com/openharmony/multimedia_audio_lite/blob/master/README.md)
[media\_lite](https://gitee.com/openharmony/multimedia_media_lite/blob/master/README.md)
**media\_utils\_lite**