native_avqueueitem.h
Overview
Declares the definitions of audio and video queue items.
File to include: <multimedia/av_session/native_avqueueitem.h>
Library: libohavsession.so
System capability: SystemCapability.Multimedia.AVSession.Core
Since: 23
Related module: OHAVSession
Summary
Structs
| Name | typedef Keyword | Description |
|---|---|---|
| OH_AVSession_AVQueueItem | OH_AVSession_AVQueueItem | Defines a struct for the audio and video queue item. |
| OH_AVSession_AVMediaDescription | OH_AVSession_AVMediaDescription | Defines a struct for the AVMediaDescription. It is the audio and video media description instance set by the application for the current resource. |
| OH_AVSession_AVMediaDescriptionBuilder | OH_AVSession_AVMediaDescriptionBuilder | Defines a struct for the audio and video media description builder. The builder instance is used to create media description information. |
Functions
Function Description
OH_AVSession_AVMediaDescriptionBuilder_Create()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_Create(OH_AVSession_AVMediaDescriptionBuilder** builder)
Description
Creates an OH_AVSession_AVMediaDescriptionBuilder instance. When the instance is no longer used, call OH_AVSession_AVMediaDescriptionBuilder_Destroy to release the builder object.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder** builder | Double pointer to the builder object of the creation result. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: The builder parameter is nullptr. AVQUEUEITEM_ERROR_NO_MEMORY: Insufficient memory. |
OH_AVSession_AVMediaDescriptionBuilder_Destroy()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_Destroy(OH_AVSession_AVMediaDescriptionBuilder* builder)
Description
Destroys a builder.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: The builder parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetAssetId()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetAssetId(OH_AVSession_AVMediaDescriptionBuilder* builder, const char* assetId)
Description
Sets the current asset ID of the media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const char* assetId | Pointer to the current asset ID of the media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The assetId parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetTitle()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetTitle(OH_AVSession_AVMediaDescriptionBuilder* builder, const char* title)
Description
Sets the title of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const char* title | Pointer to the title of the media asset. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The title parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetSubTitle()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetSubTitle(OH_AVSession_AVMediaDescriptionBuilder* builder, const char* subtitle)
Description
Sets the subtitle of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const char* subtitle | Pointer to the subtitle of a media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The subtitle parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetArtist()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetArtist(OH_AVSession_AVMediaDescriptionBuilder* builder, const char* artist)
Description
Sets the artist information of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const char* artist | Pointer to the artist information of the media asset. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The artist parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetAlbumCoverUri()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetAlbumCoverUri(OH_AVSession_AVMediaDescriptionBuilder* builder, const char* albumCoverUri)
Description
Sets the media image URL of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const char* albumCoverUri | Pointer to the image URL of the resource displayed in the media center. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The albumCoverUri parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetMediaType()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetMediaType(OH_AVSession_AVMediaDescriptionBuilder* builder, const char* mediaType)
Description
Sets the media type of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const char* mediaType | Pointer to the media type of a media resource. For example, VIDEO or AUDIO. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The mediaType parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetLyricContent()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetLyricContent(OH_AVSession_AVMediaDescriptionBuilder* builder, const char* lyricContent)
Description
Sets the lyrics content of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const char* lyricContent | Pointer to the lyrics content of a media resource. The format is Lyric Reduced Codec (LRC). |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The lyricContent parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetDuration()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetDuration(OH_AVSession_AVMediaDescriptionBuilder* builder, const int32_t duration)
Description
Sets the duration of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const int32_t duration | Duration of a media resource. The unit is milliseconds. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The duration parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetMediaUri()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetMediaUri(OH_AVSession_AVMediaDescriptionBuilder* builder, const char* mediaUri)
Description
Sets the media URI of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const char* mediaUri | Pointer to the URI of the media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The mediaUri parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetStartPosition()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetStartPosition(OH_AVSession_AVMediaDescriptionBuilder* builder, const int32_t startPosition)
Description
Sets the start position of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const int32_t startPosition | Start position of a media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The startPosition parameter is invalid. |
OH_AVSession_AVMediaDescriptionBuilder_SetMediaSize()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetMediaSize(OH_AVSession_AVMediaDescriptionBuilder* builder, const int32_t mediaSize)
Description
Sets the size of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const int32_t mediaSize | Size of a media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The mediaSize parameter is invalid. |
OH_AVSession_AVMediaDescriptionBuilder_SetAlbumTitle()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetAlbumTitle(OH_AVSession_AVMediaDescriptionBuilder* builder, const char* albumTitle)
Description
Sets the album title of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const char* albumTitle | Pointer to the album title of a media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The albumTitle parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_SetAppName()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_SetAppName(OH_AVSession_AVMediaDescriptionBuilder* builder, const char* appName)
Description
Sets the name of the application that provides the media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| const char* appName | Pointer to the name of the application that provides the media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The appName parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetAssetId()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetAssetId(OH_AVSession_AVMediaDescription* description, char** assetId)
Description
Obtains the current asset ID of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| char** assetId | Double pointer to the current asset ID of the media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. assetId is nullptr. |
OH_AVSession_AVMediaDescription_GetTitle()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetTitle(OH_AVSession_AVMediaDescription* description, char** title)
Description
Obtains the title of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| char** title | Double pointer to the title of the current media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The title parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetSubtitle()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetSubtitle(OH_AVSession_AVMediaDescription* description, char** subtitle)
Description
Obtains the subtitle of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| char** subtitle | Double pointer to the subtitle of the current media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The subtitle parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetArtist()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetArtist(OH_AVSession_AVMediaDescription* description, char** artist)
Description
Obtains the artist information of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| char** artist | Double pointer to the artist information of the current media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The artist parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetAlbumCoverUri()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetAlbumCoverUri(OH_AVSession_AVMediaDescription* description, char** albumCoverUri)
Description
Obtains the media image URL of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| char** albumCoverUri | Double pointer to the media image URL of the resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The albumCoverUri parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetMediaType()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetMediaType(OH_AVSession_AVMediaDescription* description, char** mediaType)
Description
Obtains the media type information.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| char** mediaType | Double pointer to the current media type. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The mediaType parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetLyricContent()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetLyricContent(OH_AVSession_AVMediaDescription* description, char** lyricContent)
Description
Obtains the lyrics content of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| char** lyricContent | Double pointer to the current media lyrics content. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The lyricContent parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetDuration()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetDuration(OH_AVSession_AVMediaDescription* description, int32_t* duration)
Description
Obtains the duration of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| int32_t* duration | Pointer to the total duration of the current media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The duration parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetMediaUri()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetMediaUri(OH_AVSession_AVMediaDescription* description, char** mediaUri)
Description
Obtains the media URI of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| char** mediaUri | Double pointer to the media URI of the media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The mediaUri parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetStartPosition()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetStartPosition(OH_AVSession_AVMediaDescription* description, int32_t* startPosition)
Description
Obtains the start position of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| int32_t* startPosition | Pointer to the start position of the media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The startPosition parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetMediaSize()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetMediaSize(OH_AVSession_AVMediaDescription* description, int32_t* mediaSize)
Description
Obtains the media size of a resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| int32_t* mediaSize | Pointer to the size of the media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The mediaSize parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetAlbumTitle()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetAlbumTitle(OH_AVSession_AVMediaDescription* description, char** albumTitle)
Description
Obtains the album title of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| char** albumTitle | Double pointer to the album title of the current media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The albumTitle parameter is nullptr. |
OH_AVSession_AVMediaDescription_GetAppName()
AVQueueItem_Result OH_AVSession_AVMediaDescription_GetAppName(OH_AVSession_AVMediaDescription* description, char** appName)
Description
Obtains the application name of a media resource.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* description | Pointer to the audio and video media description instance. |
| char** appName | Double pointer to the application name of the media resource. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The description parameter is nullptr. 2. The appName parameter is nullptr. |
OH_AVSession_AVMediaDescriptionBuilder_GenerateAVMediaDescription()
AVQueueItem_Result OH_AVSession_AVMediaDescriptionBuilder_GenerateAVMediaDescription(OH_AVSession_AVMediaDescriptionBuilder* builder, OH_AVSession_AVMediaDescription** avMediaDescription)
Description
Creates an avMediaDescription object. When the object is no longer used, call OH_AVSession_AVMediaDescription_Destroy to release the avMediaDescription object.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescriptionBuilder* builder | Pointer to the builder instance of the audio and video media description. |
| OH_AVSession_AVMediaDescription** avMediaDescription | Double pointer to the avMediaDescription object. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_NO_MEMORY: Insufficient memory. AVQUEUEITEM_ERROR_INVALID_PARAM: 1. The builder parameter is nullptr. 2. The avMediaDescription parameter is nullptr. |
OH_AVSession_AVMediaDescription_Destroy()
AVQueueItem_Result OH_AVSession_AVMediaDescription_Destroy(OH_AVSession_AVMediaDescription* avMediaDescription)
Description
Releases an avMediaDescription object.
Since: 23
Parameters
| Name | Description |
|---|---|
| OH_AVSession_AVMediaDescription* avMediaDescription | Pointer to the avMediaDescription object. |
Return value
| Type | Description |
|---|---|
| AVQueueItem_Result | AVQUEUEITEM_SUCCESS: The function is executed successfully. AVQUEUEITEM_ERROR_INVALID_PARAM: The avMediaDescription parameter is nullptr. |