## **Overview**
Provides data types and media formats required for recording and playing audio and videos.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Files
## Data Structures
Saves and sets media metadata, such as the media playback duration. | |
Defines the audio Device Descriptor. | |
Provides functions to obtain the address of a buffer memory and write the filled buffers into the playback queue. You need to implement the StreamCallback functions in a player object. | |
Provides functions related to the stream source for upper-layer applications. | |
Provides functions to implement source-related operations. |
## Enumerations
## Functions
OHOS::Media::FormatData::GetType () const | |
OHOS::Media::FormatData::SetValue (int32_t val) | |
OHOS::Media::FormatData::SetValue (int64_t val) | |
OHOS::Media::FormatData::SetValue (float val) | Sets a single-precision floating-point number. |
OHOS::Media::FormatData::SetValue (double val) | Sets a double-precision floating-point number. |
OHOS::Media::FormatData::SetValue (const std::string &val) | |
OHOS::Media::FormatData::GetInt32Value (int32_t &val) const | |
OHOS::Media::FormatData::GetInt64Value (int64_t &val) const | |
OHOS::Media::FormatData::GetFloatValue (float &val) const | Obtains a single-precision floating-point number. |
OHOS::Media::FormatData::GetDoubleValue (double &val) const | Obtains a double-precision floating-point number. |
OHOS::Media::FormatData::GetStringValue (std::string &val) const | |
OHOS::Media::Format::Format () | Default constructor of the Format instance. |
OHOS::Media::Format::PutIntValue (const std::string &key, int32_t value) | Sets metadata of the integer type. |
OHOS::Media::Format::PutLongValue (const std::string &key, int64_t value) | Sets metadata of the long integer type. |
OHOS::Media::Format::PutFloatValue (const std::string &key, float value) | Sets metadata of the single-precision floating-point type. |
OHOS::Media::Format::PutDoubleValue (const std::string &key, double value) | Sets metadata of the double-precision floating-point type. |
OHOS::Media::Format::PutStringValue (const std::string &key, const std::string &value) | Sets metadata of the string type. |
OHOS::Media::Format::GetIntValue (const std::string &key, int32_t &value) const | Obtains the metadata value of the integer type. |
OHOS::Media::Format::GetLongValue (const std::string &key, int64_t &value) const | Obtains the metadata value of the long integer type. |
OHOS::Media::Format::GetFloatValue (const std::string &key, float &value) const | Obtains the metadata value of the single-precision floating-point type. |
OHOS::Media::Format::GetDoubleValue (const std::string &key, double &value) const | Obtains the metadata value of the double-precision floating-point type. |
OHOS::Media::Format::GetStringValue (const std::string &key, std::string &value) const | Obtains the metadata value of the string type. |
OHOS::Media::Format::GetFormatMap () const | const std::map< std::string, FormatData * > & |
OHOS::Media::Format::CopyFrom (const Format &format) | Sets all metadata to a specified format. |
OHOS::Media::ErrCodeOffset (unsigned int subsystem, unsigned int module=0) | Generates a start error code with a unique identifier based on specified subsystem and module bit numbers. |
OHOS::Media::StreamCallback::GetBuffer (size_t index)=0 | Obtains the virtual address of a buffer memory block based on its index. |
OHOS::Media::StreamCallback::QueueBuffer (size_t index, size_t offset, size_t size, int64_t timestampUs, uint32_t flags)=0 | Writes the filled buffer memory block into the player memory. |
OHOS::Media::StreamCallback::SetParameters (const Format ¶ms)=0 | Sets additional information about a stream. |
OHOS::Media::StreamSource::OnBufferAvailable (size_t index, size_t offset, size_t size)=0 | Notifies your application of the information about the buffer memory block that can be filled with data. |
OHOS::Media::StreamSource::SetStreamCallback (const std::shared_ptr< StreamCallback > &callback)=0 | Sets a callback function for your application. |
OHOS::Media::Source::Source (const std::string &uri) | A constructor used to create a Source instance based on a specified URI. |
OHOS::Media::Source::Source (const std::string &uri, const std::map< std::string, std::string > &header) | A constructor used to create a Source instance based on a specified URI and header. |
OHOS::Media::Source::Source (const std::shared_ptr< StreamSource > &stream, const Format &formats) | A constructor used to create a Source instance based on the stream source and format information. |
OHOS::Media::Source::GetSourceType () const | |
OHOS::Media::Source::GetSourceUri () const | |
OHOS::Media::Source::GetSourceHeader () const | const std::map< std::string, std::string > & Obtains the HTTP header for the media source. |
OHOS::Media::Source::GetSourceStream () const | const std::shared_ptr< StreamSource > & Obtains information about the media source stream. |
OHOS::Media::Source::GetSourceStreamFormat () const | const Format & Obtains the media source stream format. |
## **Details**
## **Enumeration Type Documentation**
## AudioBitWidth
```
enum [AudioBitWidth](MultiMedia_MediaCommon.md#gae3e35ee2a2222a667fdebbc5b793ca7c)
```
**Description:**
Enumerates audio bit widths.
BIT_WIDTH_8 | |
BIT_WIDTH_16 | |
BIT_WIDTH_24 | |
BIT_WIDTH_BUTT |
## AudioCodecFormat
```
enum [AudioCodecFormat](MultiMedia_MediaCommon.md#gaa4ea6f314644ed287e0704be26c768b7)
```
**Description:**
Enumerates audio codec formats.
## AudioSourceType
```
enum [AudioSourceType](MultiMedia_MediaCommon.md#gadc3158e093b995ca7b9b6aa32388ccdd)
```
**Description:**
Enumerates audio source types.
## AudioStreamType
```
enum [AudioStreamType](MultiMedia_MediaCommon.md#gae7077e4211e48131ae544adb20fc494a)
```
**Description:**
Enumerates audio stream types.
## BufferFlags
```
enum [OHOS::Media::StreamCallback::BufferFlags](MultiMedia_MediaCommon.md#ga6f4847f443de5cdf3641386011335e21) : uint32_t
```
**Description:**
Enumerates buffer types of stream sources.
## FormatDataType
```
enum [OHOS::Media::FormatDataType](MultiMedia_MediaCommon.md#gaa3bfacc6563d8ec8bc870f4b216b4f46) : uint32_t
```
**Description:**
Enumerates formats.
FORMAT_TYPE_NONE | |
FORMAT_TYPE_INT32 | |
FORMAT_TYPE_INT64 | |
FORMAT_TYPE_FLOAT | |
FORMAT_TYPE_DOUBLE | |
FORMAT_TYPE_STRING |
## SourceType
```
enum [OHOS::Media::SourceType](MultiMedia_MediaCommon.md#ga4052b7b55dfd94f1d07678e79d80b507) : int32_t
```
**Description:**
Enumerates media source types.
SOURCE_TYPE_URI | Local file path or network address |
SOURCE_TYPE_FD | |
SOURCE_TYPE_STREAM | Stream data, such as Advanced Audio Coding (AAC) stream data |
## VideoCodecFormat
```
enum [VideoCodecFormat](MultiMedia_MediaCommon.md#ga797e6c5e38e23e730eff5bcc41427d7e)
```
**Description:**
Enumerates video codec formats.
VIDEO_DEFAULT | |
H264 | |
HEVC | High Efficiency Video Coding (HEVC) |
## **Function Documentation**
## CopyFrom\(\)
```
bool OHOS::Media::Format::CopyFrom (const [Format](OHOS-Media-Format.md) & format)
```
**Description:**
Sets all metadata to a specified format.
**Parameters:**
format | Indicates the format. For details, see Format. |
**Returns:**
Returns **true** if the setting is successful; returns **false** otherwise.
## ErrCodeOffset\(\)
```
constexpr ErrCode OHOS::Media::ErrCodeOffset (unsigned int subsystem, unsigned int module = [/topic/body/section/screen/code
{""}) 0 (code] )
```
**Description:**
Generates a start error code with a unique identifier based on specified subsystem and module bit numbers.
**Parameters:**
subsystem | Indicates the subsystem bit number. |
module | Indicates the module bit number. |
**Returns:**
## Format\(\)
```
OHOS::Media::Format::Format ()
```
**Description:**
Default constructor of the [Format](OHOS-Media-Format.md) instance.
## GetBuffer\(\)
```
virtual uint8_t* OHOS::Media::StreamCallback::GetBuffer (size_t index)
```
**Description:**
Obtains the virtual address of a buffer memory block based on its index.
**Parameters:**
index | Indicates the index of the buffer memory block. |
**Returns:**
Returns the pointer to the virtual address of the buffer memory block.
## GetDoubleValue\(\) \[1/2\]
```
bool OHOS::Media::Format::GetDoubleValue (const std::string & key, double & value ) const
```
**Description:**
Obtains the metadata value of the double-precision floating-point type.
**Parameters:**
key | Indicates the metadata key. |
value | Indicates the metadata value to obtain, which is a double-precision floating-point number. |
**Returns:**
Returns **true** if the double-precision number is successfully obtained; returns **false** otherwise.
## GetDoubleValue\(\) \[2/2\]
```
bool OHOS::Media::FormatData::GetDoubleValue (double & val) const
```
**Description:**
Obtains a double-precision floating-point number.
**Parameters:**
val | Indicates the double-precision floating-point number to obtain. |
**Returns:**
Returns **true** if the double-precision number is successfully obtained; returns **false** otherwise.
## GetFloatValue\(\) \[1/2\]
```
bool OHOS::Media::Format::GetFloatValue (const std::string & key, float & value ) const
```
**Description:**
Obtains the metadata value of the single-precision floating-point type.
**Parameters:**
key | Indicates the metadata key. |
value | Indicates the metadata value to obtain, which is a single-precision floating-point number. |
**Returns:**
Returns **true** if the single-precision number is successfully obtained; returns **false** otherwise.
## GetFloatValue\(\) \[2/2\]
```
bool OHOS::Media::FormatData::GetFloatValue (float & val) const
```
**Description:**
Obtains a single-precision floating-point number.
**Parameters:**
val | Indicates the single-precision floating-point number to obtain. |
**Returns:**
Returns **true** if the single-precision number is successfully obtained; returns **false** otherwise.
## GetFormatMap\(\)
```
const std::map
```
**Description:**
Obtains the metadata map.
**Returns:**
Returns the map object.
## GetInt32Value\(\)
```
bool OHOS::Media::FormatData::GetInt32Value (int32_t & val) const
```
**Description:**
Obtains a 32-bit integer.
**Parameters:**
val | Indicates the 32-bit integer to obtain. |
**Returns:**
Returns **true** if the integer is successfully obtained; returns **false** otherwise.
## GetInt64Value\(\)
```
bool OHOS::Media::FormatData::GetInt64Value (int64_t & val) const
```
**Description:**
Obtains a long integer.
**Parameters:**
val | Indicates the long integer to obtain. |
**Returns:**
Returns **true** if the integer is successfully obtained; returns **false** otherwise.
## GetIntValue\(\)
```
bool OHOS::Media::Format::GetIntValue (const std::string & key, int32_t & value ) const
```
**Description:**
Obtains the metadata value of the integer type.
**Parameters:**
key | Indicates the metadata key. |
value | Indicates the metadata value to obtain, which is a 32-bit integer. |
**Returns:**
Returns **true** if the integer is successfully obtained; returns **false** otherwise.
## GetLongValue\(\)
```
bool OHOS::Media::Format::GetLongValue (const std::string & key, int64_t & value ) const
```
**Description:**
Obtains the metadata value of the long integer type.
**Parameters:**
key | Indicates the metadata key. |
value | Indicates the metadata value to obtain, which is a 64-bit long integer. |
**Returns:**
Returns **true** if the integer is successfully obtained; returns **false** otherwise.
## GetSourceHeader\(\)
```
const std::map
```
**Description:**
Obtains the HTTP header for the media source.
This function is called only when the [SourceType](Format.md#ga3ae727773c367ac1041d72ac770a0ab1) is [SOURCE\_TYPE\_URI](Format.md#gga3ae727773c367ac1041d72ac770a0ab1a70d32ea5aeaa325764508722ba31403c).
**Returns:**
Returns the media source header.
## GetSourceStream\(\)
```
const std::shared_ptr<[StreamSource](OHOS-Media-StreamSource.md)>& OHOS::Media::Source::GetSourceStream () const
```
**Description:**
Obtains information about the media source stream.
This function is called only when the [SourceType](Format.md#ga3ae727773c367ac1041d72ac770a0ab1) is [SOURCE\_TYPE\_STREAM](Format.md#gga3ae727773c367ac1041d72ac770a0ab1a7f632a791d8f6dfbe5940b5648d29e6c).
**Returns:**
Returns information about the media source stream. For details, see [StreamSource](OHOS-Media-StreamSource.md).
## GetSourceStreamFormat\(\)
```
const [Format](OHOS-Media-Format.md)& OHOS::Media::Source::GetSourceStreamFormat () const
```
**Description:**
Obtains the media source stream format.
**Returns:**
Returns the media source stream format. For details, see [Format](OHOS-Media-Format.md).
## GetSourceType\(\)
```
[SourceType](MultiMedia_MediaCommon.md#ga4052b7b55dfd94f1d07678e79d80b507) OHOS::Media::Source::GetSourceType () const
```
**Description:**
Obtains the source type.
**Returns:**
Returns the source type. For details, see [SourceType](Format.md#ga3ae727773c367ac1041d72ac770a0ab1).
## GetSourceUri\(\)
```
const std::string& OHOS::Media::Source::GetSourceUri () const
```
**Description:**
Obtains the media source URI.
This function is called only when the [SourceType](Format.md#ga3ae727773c367ac1041d72ac770a0ab1) is [SOURCE\_TYPE\_URI](Format.md#gga3ae727773c367ac1041d72ac770a0ab1a70d32ea5aeaa325764508722ba31403c).
**Returns:**
Returns the media source URI.
## GetStringValue\(\) \[1/2\]
```
bool OHOS::Media::Format::GetStringValue (const std::string & key, std::string & value ) const
```
**Description:**
Obtains the metadata value of the string type.
**Parameters:**
key | Indicates the metadata key. |
value | Indicates the metadata value to obtain, which is a string. |
**Returns:**
Returns **true** if the string is successfully obtained; returns **false** otherwise.
## GetStringValue\(\) \[2/2\]
```
bool OHOS::Media::FormatData::GetStringValue (std::string & val) const
```
**Description:**
Obtains a string.
**Parameters:**
val | Indicates the string to obtain. |
**Returns:**
Returns **true** if the string is successfully obtained; returns **false** otherwise.
## GetType\(\)
```
[FormatDataType](MultiMedia_MediaCommon.md#gaa3bfacc6563d8ec8bc870f4b216b4f46) OHOS::Media::FormatData::GetType () const
```
**Description:**
Obtains the format type.
**Returns:**
Returns the format type. For details, see **OHOS::Media::FormatDataType**.
## OnBufferAvailable\(\)
```
virtual void OHOS::Media::StreamSource::OnBufferAvailable (size_t index, size_t offset, size_t size )
```
**Description:**
Notifies your application of the information about the buffer memory block that can be filled with data.
**Parameters:**
index | Indicates the index of the buffer memory block. |
offset | Indicates the start offset into which the data will be written. |
size | Indicates the size of data that the buffer memory block can store. |
## PutDoubleValue\(\)
```
bool OHOS::Media::Format::PutDoubleValue (const std::string & key, double value )
```
**Description:**
Sets metadata of the double-precision floating-point type.
**Parameters:**
key | Indicates the metadata key. |
value | Indicates the metadata value, which is a double-precision floating-point number. |
**Returns:**
Returns **true** if the setting is successful; returns **false** otherwise.
## PutFloatValue\(\)
```
bool OHOS::Media::Format::PutFloatValue (const std::string & key, float value )
```
**Description:**
Sets metadata of the single-precision floating-point type.
**Parameters:**
key | Indicates the metadata key. |
value | Indicates the metadata value, which is a single-precision floating-point number. |
**Returns:**
Returns **true** if the metadata is successfully set; returns **false** otherwise.
## PutIntValue\(\)
```
bool OHOS::Media::Format::PutIntValue (const std::string & key, int32_t value )
```
**Description:**
Sets metadata of the integer type.
**Parameters:**
key | Indicates the metadata key. |
value | Indicates the metadata value, which is a 32-bit integer. |
**Returns:**
Returns **true** if the setting is successful; returns **false** otherwise.
## PutLongValue\(\)
```
bool OHOS::Media::Format::PutLongValue (const std::string & key, int64_t value )
```
**Description:**
Sets metadata of the long integer type.
**Parameters:**
key | Indicates the metadata key. |
value | Indicates the metadata value, which is a 64-bit integer. |
**Returns:**
Returns **true** if the setting is successful; returns **false** otherwise.
## PutStringValue\(\)
```
bool OHOS::Media::Format::PutStringValue (const std::string & key, const std::string & value )
```
**Description:**
Sets metadata of the string type.
**Parameters:**
key | Indicates the metadata key. |
value | Indicates the metadata value, which is a string. |
**Returns:**
Returns **true** if the metadata is successfully set; returns **false** otherwise.
## QueueBuffer\(\)
```
virtual void OHOS::Media::StreamCallback::QueueBuffer (size_t index, size_t offset, size_t size, int64_t timestampUs, uint32_t flags )
```
**Description:**
Writes the filled buffer memory block into the player memory.
**Parameters:**
index | Indicates the index of the buffer memory block. |
offset | Indicates the start offset into which the buffer memory block will be written. |
size | Indicates the size of the data filled in the buffer memory block. |
timestampUs | Indicates the timestamp of the frame filled in the buffer memory block. As data in AAC streams can be filled not on a frame basis, set this parameter to 0 for AAC streams. |
flags | Indicates the type of the current buffer memory block. For details, see BufferFlags. |
## SetParameters\(\)
```
virtual void OHOS::Media::StreamCallback::SetParameters (const [Format](OHOS-Media-Format.md) & params)
```
**Description:**
Sets additional information about a stream.
**Parameters:**
params | Indicates the parameters for additional stream information. For details, see Format. |
## SetStreamCallback\(\)
```
virtual void OHOS::Media::StreamSource::SetStreamCallback (const std::shared_ptr< [StreamCallback](OHOS-Media-StreamCallback.md) > & callback)
```
**Description:**
Sets a callback function for your application.
**Parameters:**
callback | Indicates the StreamCallback function to set. |
## SetValue\(\) \[1/5\]
```
bool OHOS::Media::FormatData::SetValue (const std::string & val)
```
**Description:**
Sets a string.
**Parameters:**
val | Indicates the string to set. |
**Returns:**
Returns **true** if the setting is successful; returns **false** otherwise.
## SetValue\(\) \[2/5\]
```
bool OHOS::Media::FormatData::SetValue (double val)
```
**Description:**
Sets a double-precision floating-point number.
**Parameters:**
val | Indicates the double-precision floating-point number to set. |
**Returns:**
Returns **true** if the double-precision floating-point number is successfully set; returns **false** otherwise.
## SetValue\(\) \[3/5\]
```
bool OHOS::Media::FormatData::SetValue (float val)
```
**Description:**
Sets a single-precision floating-point number.
**Parameters:**
val | Indicates the single-precision floating-point number to set. |
**Returns:**
Returns **true** if the setting is successful; returns **false** otherwise.
## SetValue\(\) \[4/5\]
```
bool OHOS::Media::FormatData::SetValue (int32_t val)
```
**Description:**
Sets a 32-bit integer.
**Parameters:**
val | Indicates the 32-bit integer to set. |
**Returns:**
Returns **true** if the setting is successful; returns **false** otherwise.
## SetValue\(\) \[5/5\]
```
bool OHOS::Media::FormatData::SetValue (int64_t val)
```
**Description:**
Sets a 64-bit long integer.
**Parameters:**
val | Indicates the 64-bit long integer to set. |
**Returns:**
Returns **true** if the setting is successful; returns **false** otherwise.
## Source\(\) \[1/3\]
```
OHOS::Media::Source::Source (const std::shared_ptr< [StreamSource](OHOS-Media-StreamSource.md) > & stream, const [Format](OHOS-Media-Format.md) & formats )
```
**Description:**
A constructor used to create a [Source](OHOS-Media-Source.md) instance based on the stream source and format information.
**Parameters:**
stream | Indicates the media source stream. For details, see StreamSource. |
formats | Indicates stream data information, which is subject to the stream type. For example, the key is CODEC_MIME, and the value is MIME_AUDIO_AAC. For details, see Format. This parameter can be null if no information needs to be passed. |
## Source\(\) \[2/3\]
```
OHOS::Media::Source::Source (const std::string & uri)
```
**Description:**
A constructor used to create a [Source](OHOS-Media-Source.md) instance based on a specified URI.
**Parameters:**
uri | Indicates the media source URI, which can be a network URI or local file path. |
## Source\(\) \[3/3\]
```
OHOS::Media::Source::Source (const std::string & uri, const std::map< std::string, std::string > & header )
```
**Description:**
A constructor used to create a [Source](OHOS-Media-Source.md) instance based on a specified URI and header.
If the HTTP URL header does not carry valid information for network playback, this function is equivalent to [Source\(const std::string& uri\)](MultiMedia_MediaCommon.md#gab9bfa209ae382e3ba5d5242e8dfe5b20).
**Parameters:**
uri | Indicates the media source URI. |
header | Indicates the header. |
## **Variable Documentation**
## BITRATE\_MODE\_CBR
```
const int BITRATE_MODE_CBR = 2
```
**Description:**
Indicates the constant bit rate mode. In this mode, the codec keeps the output bit rate as constant as possible.
## BITRATE\_MODE\_CQ
```
const int BITRATE_MODE_CQ = 0
```
**Description:**
Indicates the constant quality mode. In this mode, the bit rate is not limited to guarantee the image quality to the largest extent.
## BITRATE\_MODE\_VBR
```
const int BITRATE_MODE_VBR = 1
```
**Description:**
Indicates the variable bit rate mode. In this mode, the codec dynamically adjusts the output bit rate based on the image complexity. The codec increases the bit rate if the image is complex and decreases the bit rate if the image is simple.
## CODEC\_MIME
```
const char* OHOS::Media::CODEC_MIME
```
**Description:**
Indicates the key representing the codec type.
## COLOR\_FORMAT\_ARGB8888\_32BIT
```
const int32_t COLOR_FORMAT_ARGB8888_32BIT = 16
```
**Description:**
Indicates the ARGB8888 color format.
## COLOR\_FORMAT\_YUV420SP
```
const int32_t COLOR_FORMAT_YUV420SP = 21
```
**Description:**
Indicates the YUV420SP color format.
## deviceId
```
uint32_t AudioDeviceDesc::deviceId
```
**Description:**
Bits 31-24: reserved bits; bits 23-16: mode ID; bits 15-8: device ID; bits 7-0: channel ID
## deviceName
```
std::string AudioDeviceDesc::deviceName
```
**Description:**
Device name
## ERR\_EARLY\_PREPARE
```
const int32_t OHOS::Media::ERR_EARLY_PREPARE = BASE_MEDIA_ERR_OFFSET + 3
```
**Description:**
Early media preparation
## ERR\_ILLEGAL\_STATE
```
const int32_t OHOS::Media::ERR_ILLEGAL_STATE = BASE_MEDIA_ERR_OFFSET + 1
```
**Description:**
Status error
## ERR\_INVALID\_OPERATION
```
const int32_t OHOS::Media::ERR_INVALID_OPERATION = BASE_MEDIA_ERR_OFFSET + 5
```
**Description:**
Invalid operation
## ERR\_INVALID\_PARAM
```
const int32_t OHOS::Media::ERR_INVALID_PARAM = BASE_MEDIA_ERR_OFFSET + 2
```
**Description:**
Invalid parameter
## ERR\_INVALID\_READ
```
const int32_t OHOS::Media::ERR_INVALID_READ = -1
```
**Description:**
Invalid data size that has been read
## ERR\_NOFREE\_CHANNEL
```
const int32_t OHOS::Media::ERR_NOFREE_CHANNEL = BASE_MEDIA_ERR_OFFSET + 6
```
**Description:**
No idle channel
## ERR\_NOT\_STARTED
```
const int32_t OHOS::Media::ERR_NOT_STARTED = BASE_MEDIA_ERR_OFFSET + 8
```
**Description:**
Device not started
## ERR\_READ\_BUFFER
```
const int32_t OHOS::Media::ERR_READ_BUFFER = BASE_MEDIA_ERR_OFFSET + 7
```
**Description:**
Buffer reading failed
## ERR\_SOURCE\_NOT\_SET
```
const int32_t OHOS::Media::ERR_SOURCE_NOT_SET = BASE_MEDIA_ERR_OFFSET + 4
```
**Description:**
No media source
## ERR\_UNKNOWN
```
const int32_t OHOS::Media::ERR_UNKNOWN = BASE_MEDIA_ERR_OFFSET + 200
```
**Description:**
Unknown error
## ERROR
```
const int32_t OHOS::Media::ERROR = BASE_MEDIA_ERR_OFFSET
```
**Description:**
Fail
## inputSourceType
```
[AudioSourceType](MultiMedia_MediaCommon.md#gadc3158e093b995ca7b9b6aa32388ccdd) AudioDeviceDesc::inputSourceType
```
**Description:**
Type of the audio input source
## KEY\_IS\_SYNC\_FRAME
```
const std::string KEY_IS_SYNC_FRAME = "is-sync-frame"
```
**Description:**
Indicates that the current frame is an Instantaneous Decoder Refresh \(IDR\) frame.
## KEY\_TIME\_US
```
const std::string KEY_TIME_US = "timeUs"
```
**Description:**
Indicates the frame timestamp.
## MIME\_AUDIO\_AAC
```
const char* OHOS::Media::MIME_AUDIO_AAC
```
**Description:**
Indicates the codec for Advanced Audio Coding \(AAC\) streams, which is a value of the codec type key.
## MIME\_AUDIO\_RAW
```
const char* OHOS::Media::MIME_AUDIO_RAW
```
**Description:**
Indicates the codec for RAW audios \(not supported yet\), which is a value of the codec type key.
## SUCCESS
```
const int32_t OHOS::Media::SUCCESS = 0
```
**Description:**
Success