|
|
|
|
/*
|
|
|
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2012-2019. All rights reserved.
|
|
|
|
|
* Description: uapi_rm.h
|
|
|
|
|
* Author: Hisilicon
|
|
|
|
|
* Create: 2015/12/01
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef UAPI_RM_H
|
|
|
|
|
#define UAPI_RM_H
|
|
|
|
|
|
|
|
|
|
#include "td_type.h"
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
#if __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Type of the event callback function
|
|
|
|
|
* CNcomment: 事件回调函数类型
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
UAPI_RM_EVENT_WIN_LACK = 0x1, /* <The window lack event><CNcomment: 窗口缺乏事件> */
|
|
|
|
|
UAPI_RM_EVENT_WIN_CREATED = 0x2, /* <The window be created event><CNcomment: 窗口创建事件> */
|
|
|
|
|
UAPI_RM_EVENT_WIN_DESTROYED = 0x4, /* <The window be destroyed event><CNcomment: 窗口销毁事件> */
|
|
|
|
|
UAPI_RM_EVENT_MAX,
|
|
|
|
|
} uapi_rm_event;
|
|
|
|
|
|
|
|
|
|
/* Type of the resource
|
|
|
|
|
* CNcomment: 资源类型
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
UAPI_RM_RESOURCE_TYPE_ALL = 0x0, /* <The all resource><CNcomment: 所有资源> */
|
|
|
|
|
UAPI_RM_RESOURCE_TYPE_WIN, /* <The resource of video window><CNcomment: 视频窗口资源> */
|
|
|
|
|
UAPI_RM_RESOURCE_TYPE_TRACK, /* <The resource of audio track><CNcomment: 音频通道资源> */
|
|
|
|
|
UAPI_RM_RESOURCE_TYPE_VDEC, /* <The resource of vdec><CNcomment: 视频解码器资源> */
|
|
|
|
|
UAPI_RM_RESOURCE_TYPE_ADEC, /* <The resource of adec><CNcomment: 音频解码器资源> */
|
|
|
|
|
UAPI_RM_RESOURCE_MAX,
|
|
|
|
|
} uapi_rm_resource_type;
|
|
|
|
|
|
|
|
|
|
/* Defines the type of the event callback function
|
|
|
|
|
* CNcomment: 定义事件回调函数枚举类型
|
|
|
|
|
*/
|
|
|
|
|
typedef td_s32 (*uapi_rm_event_cb_fn)(td_void *client, uapi_rm_event event, td_u32 event_para);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* brief Initializes the RM module. CNcomment:初始化RM模块 CNend
|
|
|
|
|
* attention
|
|
|
|
|
* param N/A
|
|
|
|
|
* retval: TD_SUCCESS Success CNcomment:成功 CNend
|
|
|
|
|
* retval: TD_FAILURE Failure CNcomment:失败 CNend
|
|
|
|
|
*/
|
|
|
|
|
td_s32 uapi_rm_init(td_void);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* brief Deinitializes the RM module. CNcomment:去初始化RM模块 CNend
|
|
|
|
|
* attention \n
|
|
|
|
|
* param N/A
|
|
|
|
|
* retval: TD_SUCCESS Success CNcomment:成功 CNend
|
|
|
|
|
* retval: TD_FAILURE Failure CNcomment:失败 CNend
|
|
|
|
|
*/
|
|
|
|
|
td_s32 uapi_rm_deinit(td_void);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* brief Registers an event. CNcomment:注册事件 CNend
|
|
|
|
|
* attention \n
|
|
|
|
|
* param[in] pClient client handle CNcomment:service 句柄 CNend
|
|
|
|
|
* param[in] fn callback function CNcomment:回调函数指针,指向与注册事件对应的回调函数 CNend
|
|
|
|
|
* param[in] u32EventMask Event mask enumeration CNcomment:表示关注事件类型 CNend
|
|
|
|
|
* retval: TD_SUCCESS Success CNcomment:成功 CNend
|
|
|
|
|
* retval: TD_FAILURE Failure CNcomment:失败 CNend
|
|
|
|
|
*/
|
|
|
|
|
td_s32 uapi_rm_register_callback(const td_void *client, uapi_rm_event_cb_fn fn, td_u32 event_mask);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* brief Deregisters an event. CNcomment:取消注册事件 CNend
|
|
|
|
|
* attention \n
|
|
|
|
|
* param[in] pClient client handle CNcomment:service 句柄 CNend
|
|
|
|
|
* param[in] fn callback function CNcomment:回调函数 CNend
|
|
|
|
|
* retval: TD_SUCCESS Success CNcomment:成功 CNend
|
|
|
|
|
* retval: TD_FAILURE Failure CNcomment:失败 CNend
|
|
|
|
|
*/
|
|
|
|
|
td_s32 uapi_rm_unregister_callback(const td_void *client, uapi_rm_event_cb_fn fn);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* brief request resource. CNcomment:请求资源 CNend
|
|
|
|
|
* attention \n
|
|
|
|
|
* param[in] enResourceType resource type CNcomment:资源类型 CNend
|
|
|
|
|
* retval: TD_SUCCESS Success CNcomment:成功 CNend
|
|
|
|
|
* retval: TD_FAILURE Failure CNcomment:失败 CNend
|
|
|
|
|
*/
|
|
|
|
|
td_s32 uapi_rm_request_resource(uapi_rm_resource_type resource_type);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
#if __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* UAPI_RM_H */
|