native_deviceinfo.h
Overview
Declares the definitions of playback control device information.
File to include: <multimedia/av_session/native_deviceinfo.h>
Library: libohavsession.so
System capability: SystemCapability.Multimedia.AVSession.Core
Since: 23
Related module: OHAVSession
Summary
Structs
| Name | typedef Keyword | Description |
|---|---|---|
| AVSession_OutputDeviceInfo | - | Defines a struct for the target device information. |
| AVSession_DeviceInfo | AVSession_DeviceInfo | Defines a struct for the device information. This instance is used to obtain more device information and its detailed properties. |
Functions
| Name | Description |
|---|---|
| AVSession_ErrCode OH_DeviceInfo_GetAVCastCategory(AVSession_DeviceInfo *deviceInfo, AVSession_AVCastCategory *aVCastCategory) | Obtains the cast category of the target device. |
| AVSession_ErrCode OH_DeviceInfo_GetDeviceId(AVSession_DeviceInfo *deviceInfo, char **deviceId) | Obtains the device ID of the target device. |
| AVSession_ErrCode OH_DeviceInfo_GetDeviceName(AVSession_DeviceInfo *deviceInfo, char **deviceName) | Obtains the name of the target device. |
| AVSession_ErrCode OH_DeviceInfo_GetDeviceType(AVSession_DeviceInfo *deviceInfo, AVSession_DeviceType *deviceType) | Obtains the type of the target device. |
| AVSession_ErrCode OH_DeviceInfo_GetSupportedProtocols(AVSession_DeviceInfo *deviceInfo, uint32_t *deviceProtocolType) | Obtains the protocols supported by the target device. |
Function Description
OH_DeviceInfo_GetAVCastCategory()
AVSession_ErrCode OH_DeviceInfo_GetAVCastCategory(AVSession_DeviceInfo *deviceInfo, AVSession_AVCastCategory *aVCastCategory)
Description
Obtains the cast category of the target device.
Since: 23
Parameters
| Name | Description |
|---|---|
| AVSession_DeviceInfo *deviceInfo | Pointer to the device information instance. |
| AVSession_AVCastCategory *aVCastCategory | Pointer to the aVCastCategory value. |
Return value
| Type | Description |
|---|---|
| AVSession_ErrCode | AV_SESSION_ERR_SUCCESS: The function is executed successfully. AV_SESSION_ERR_INVALID_PARAMETER: 1. The deviceInfo parameter is nullptr. 2. The aVCastCategory parameter is nullptr. |
OH_DeviceInfo_GetDeviceId()
AVSession_ErrCode OH_DeviceInfo_GetDeviceId(AVSession_DeviceInfo *deviceInfo, char **deviceId)
Description
Obtains the device ID of the target device.
Since: 23
Parameters
| Name | Description |
|---|---|
| AVSession_DeviceInfo *deviceInfo | Pointer to the device information instance. |
| char **deviceId | Double pointer to the device ID. |
Return value
| Type | Description |
|---|---|
| AVSession_ErrCode | AV_SESSION_ERR_SUCCESS: The function is executed successfully. AV_SESSION_ERR_INVALID_PARAMETER: 1. The deviceInfo parameter is nullptr. 2. The deviceId parameter is nullptr. |
OH_DeviceInfo_GetDeviceName()
AVSession_ErrCode OH_DeviceInfo_GetDeviceName(AVSession_DeviceInfo *deviceInfo, char **deviceName)
Description
Obtains the name of the target device.
Since: 23
Parameters
| Name | Description |
|---|---|
| AVSession_DeviceInfo *deviceInfo | Pointer to the device information instance. |
| char **deviceName | Double pointer to the device name. |
Return value
| Type | Description |
|---|---|
| AVSession_ErrCode | AV_SESSION_ERR_SUCCESS: The function is executed successfully. AV_SESSION_ERR_INVALID_PARAMETER: 1. The deviceInfo parameter is nullptr. 2. The deviceName parameter is nullptr. |
OH_DeviceInfo_GetDeviceType()
AVSession_ErrCode OH_DeviceInfo_GetDeviceType(AVSession_DeviceInfo *deviceInfo, AVSession_DeviceType *deviceType)
Description
Obtains the type of the target device.
Since: 23
Parameters
| Name | Description |
|---|---|
| AVSession_DeviceInfo *deviceInfo | Pointer to the device information instance. |
| AVSession_DeviceType *deviceType | Double pointer to the device type. |
Return value
| Type | Description |
|---|---|
| AVSession_ErrCode | AV_SESSION_ERR_SUCCESS: The function is executed successfully. AV_SESSION_ERR_INVALID_PARAMETER: 1. The deviceInfo parameter is nullptr. 2. The deviceType parameter is nullptr. |
OH_DeviceInfo_GetSupportedProtocols()
AVSession_ErrCode OH_DeviceInfo_GetSupportedProtocols(AVSession_DeviceInfo *deviceInfo, uint32_t *deviceProtocolType)
Description
Obtains the protocols supported by the target device.
Since: 23
Parameters
| Name | Description |
|---|---|
| AVSession_DeviceInfo *deviceInfo | Pointer to the device information instance. |
| uint32_t *deviceProtocolType | Pointer to the protocol supported by the device. |
Return value
| Type | Description |
|---|---|
| AVSession_ErrCode | AV_SESSION_ERR_SUCCESS: The function is executed successfully. AV_SESSION_ERR_INVALID_PARAMETER: 1. The deviceInfo parameter is nullptr. 2. The deviceProtocolType parameter is nullptr. |