# MultiMedia\_MediaCommon ## **Overview** Provides data types and media formats required for recording and playing audio and videos. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Files
Saves and sets media metadata, such as the media playback duration. |
|
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. |
|
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) |
|
OHOS::Media::FormatData::SetValue (double val) |
|
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 |
|
OHOS::Media::FormatData::GetDoubleValue (double &val) const |
|
OHOS::Media::FormatData::GetStringValue (std::string &val) const |
|
Default constructor of the Format instance. |
|
OHOS::Media::Format::PutIntValue (const std::string &key, int32_t value) |
|
OHOS::Media::Format::PutLongValue (const std::string &key, int64_t value) |
|
OHOS::Media::Format::PutFloatValue (const std::string &key, float value) |
|
OHOS::Media::Format::PutDoubleValue (const std::string &key, double value) |
|
OHOS::Media::Format::PutStringValue (const std::string &key, const std::string &value) |
|
OHOS::Media::Format::GetIntValue (const std::string &key, int32_t &value) const |
|
OHOS::Media::Format::GetLongValue (const std::string &key, int64_t &value) const |
|
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 |
|
OHOS::Media::Format::GetFormatMap () const |
const std::map< std::string, FormatData * > & |
OHOS::Media::Format::CopyFrom (const Format &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 |
|
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 |
|
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 |
|
OHOS::Media::Source::GetSourceStream () const |
const std::shared_ptr< StreamSource > & |
const Format & |
BIT_WIDTH_8 | |
BIT_WIDTH_16 | |
BIT_WIDTH_24 | |
BIT_WIDTH_BUTT |
AUDIO_DEFAULT | |
AAC_LC | |
AAC_HE_V1 | High-Efficiency Advanced Audio Coding (AAC-HE), previously known as AAC+ or aacPlus v1 |
AAC_HE_V2 | |
AAC_LD | |
AAC_ELD | |
FORMAT_BUTT |
TYPE_DEFAULT | |
TYPE_MEDIA | |
TYPE_VOICE_COMMUNICATION | |
TYPE_SYSTEM | |
TYPE_RING | |
TYPE_MUSIC | |
TYPE_ALARM | |
TYPE_NOTIFICATION | |
TYPE_BLUETOOTH_SCO | |
TYPE_ENFORCED_AUDIBLE | |
TYPE_DTMF | |
TYPE_TTS | |
TYPE_ACCESSIBILITY |
FORMAT_TYPE_NONE | |
FORMAT_TYPE_INT32 | |
FORMAT_TYPE_INT64 | |
FORMAT_TYPE_FLOAT | |
FORMAT_TYPE_DOUBLE | |
FORMAT_TYPE_STRING |
SOURCE_TYPE_URI | |
SOURCE_TYPE_FD | |
SOURCE_TYPE_STREAM | Stream data, such as Advanced Audio Coding (AAC) stream data |
VIDEO_DEFAULT | |
H264 | |
HEVC |
format | Indicates the format. For details, see Format. |
subsystem | Indicates the subsystem bit number. |
module | Indicates the module bit number. |
index | Indicates the index of the buffer memory block. |
key | Indicates the metadata key. |
value | Indicates the metadata value to obtain, which is a double-precision floating-point number. |
val | Indicates the double-precision floating-point number to obtain. |
key | Indicates the metadata key. |
value | Indicates the metadata value to obtain, which is a single-precision floating-point number. |
val | Indicates the single-precision floating-point number to obtain. |
val | Indicates the 32-bit integer to obtain. |
val | Indicates the long integer to obtain. |
key | Indicates the metadata key. |
value | Indicates the metadata value to obtain, which is a 32-bit integer. |
key | Indicates the metadata key. |
value | Indicates the metadata value to obtain, which is a 64-bit long integer. |
key | Indicates the metadata key. |
value | Indicates the metadata value to obtain, which is a string. |
val | Indicates the string to obtain. |
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. |
key | Indicates the metadata key. |
value | Indicates the metadata value, which is a double-precision floating-point number. |
key | Indicates the metadata key. |
value | Indicates the metadata value, which is a single-precision floating-point number. |
key | Indicates the metadata key. |
value | Indicates the metadata value, which is a 32-bit integer. |
key | Indicates the metadata key. |
value | Indicates the metadata value, which is a 64-bit integer. |
key | Indicates the metadata key. |
value | Indicates the metadata value, which is a string. |
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. |
params | Indicates the parameters for additional stream information. For details, see Format. |
callback | Indicates the StreamCallback function to set. |
val | Indicates the string to set. |
val | Indicates the double-precision floating-point number to set. |
val | Indicates the single-precision floating-point number to set. |
val | Indicates the 32-bit integer to set. |
val | Indicates the 64-bit long integer to set. |
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. |
uri | Indicates the media source URI, which can be a network URI or local file path. |
uri | Indicates the media source URI. |
header | Indicates the header. |