/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2019. All rights reserved. * Description: Define functions used to test function of demux driver * Author: Hisilicon * Create: 2019-4-25 */ #ifndef __UAPI_DEMUX_H__ #define __UAPI_DEMUX_H__ #include "td_type.h" #include "uapi_video.h" #include "uapi_stream.h" #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /* Maximum depth of a filter. */ #define DMX_FILTER_MAX_DEPTH 16 #define DMX_MAX_IDX_ACQUIRED_EACH_TIME 256 #define DMX_MAX_REC_DATA_PARTS 2 /* Defines the capability of the DEMUX module.CNcomment:定义DEMUX模块业务功能结构体 */ typedef struct { td_u32 dmx_num; /* Number of DEMUX devices.CNcomment:设备数量 */ td_u32 if_port_num; /* Number of IF ports. * CNcomment: IF 端口数量(与TS In 端口都是通过Tuner 连接, * 但是IF 端口是使用内置 QAM) */ td_u32 tsi_port_num; /* Number of TS In ports. * CNcomment: TS In 端口数量 (与IF端口都是通过Tuner 连接, * 但是IF 端口是使用内置 QAM) */ td_u32 tso_port_num; /* Number of TS Out ports.CNcomment: TS Out 端口数量 */ td_u32 ram_port_num; /* Number of Ram ports.CNcomment: Ram端口数量 */ td_u32 tag_port_num; /* Number of Tag ports.CNcomment: Tag端口数量 */ td_u32 tsio_port_num; /* Number of Tsio ports.CNcomment: Tsio端口数量 */ td_u32 total_play_chan_num; /* Number of channels, containing the audio and video channels. * CNcomment:总通道数量,含音视频通道的数量 */ td_u32 av_play_chan_num; /* Number of av channels.CNcomment:音视频通道数量 */ td_u32 rec_chan_num; /* Number of record channelsCNcomment:录制通道的数量 */ td_u32 filter_num; /* Number of filters.CNcomment:过滤器数量 */ td_u32 desc_num; /* Number of descramblers.CNcomment: 解扰器数量 */ } uapi_dmx_capability; /* TSO port ID.CNcomment:TS输出端口ID */ typedef enum { UAPI_DMX_PORT_TSO_0, /* The first TS OUT port .CNcomment:TS Out 端口0 */ UAPI_DMX_PORT_TSO_1, UAPI_DMX_PORT_TSO_2, UAPI_DMX_PORT_TSO_3 } uapi_dmx_tso_port; /* TS port ID.CNcomment:TS端口ID */ typedef enum { UAPI_DMX_PORT_IF_0 = 0x0, /* The first IF port (port with QAM inside chipset). * CNcomment: IF 端口0, (IF 端口是内置QAM端口,通常不多于一个) */ UAPI_DMX_PORT_IF_1, UAPI_DMX_PORT_IF_2, UAPI_DMX_PORT_IF_3, UAPI_DMX_PORT_IF_4, UAPI_DMX_PORT_IF_5, UAPI_DMX_PORT_IF_6, UAPI_DMX_PORT_IF_7, UAPI_DMX_PORT_IF_8, UAPI_DMX_PORT_IF_9, UAPI_DMX_PORT_IF_10, UAPI_DMX_PORT_IF_11, UAPI_DMX_PORT_IF_12, UAPI_DMX_PORT_IF_13, UAPI_DMX_PORT_IF_14, UAPI_DMX_PORT_IF_15, UAPI_DMX_PORT_TSI_0 = 0x20, /* The first TS IN port .CNcomment:TSIN 端口0, (TSIN 端口即Tuner 端口) */ UAPI_DMX_PORT_TSI_1, UAPI_DMX_PORT_TSI_2, UAPI_DMX_PORT_TSI_3, UAPI_DMX_PORT_TSI_4, UAPI_DMX_PORT_TSI_5, UAPI_DMX_PORT_TSI_6, UAPI_DMX_PORT_TSI_7, UAPI_DMX_PORT_TSI_8, UAPI_DMX_PORT_TSI_9, UAPI_DMX_PORT_TSI_10, UAPI_DMX_PORT_TSI_11, UAPI_DMX_PORT_TSI_12, UAPI_DMX_PORT_TSI_13, UAPI_DMX_PORT_TSI_14, UAPI_DMX_PORT_TSI_15, UAPI_DMX_PORT_RAM_0 = 0x80, /* The first RAM port .CNcomment:RAM 端口0 */ UAPI_DMX_PORT_RAM_1, UAPI_DMX_PORT_RAM_2, UAPI_DMX_PORT_RAM_3, UAPI_DMX_PORT_RAM_4, UAPI_DMX_PORT_RAM_5, UAPI_DMX_PORT_RAM_6, UAPI_DMX_PORT_RAM_7, UAPI_DMX_PORT_RAM_8, UAPI_DMX_PORT_RAM_9, UAPI_DMX_PORT_RAM_10, UAPI_DMX_PORT_RAM_11, UAPI_DMX_PORT_RAM_12, UAPI_DMX_PORT_RAM_13, UAPI_DMX_PORT_RAM_14, UAPI_DMX_PORT_RAM_15, UAPI_DMX_PORT_TSIO_0 = 0xA0, /* The first TSIO port .CNcomment:TSIO 端口0 */ UAPI_DMX_PORT_TSIO_1, UAPI_DMX_PORT_TSIO_2, UAPI_DMX_PORT_TSIO_3, UAPI_DMX_PORT_TSIO_4, UAPI_DMX_PORT_TSIO_5, UAPI_DMX_PORT_TSIO_6, UAPI_DMX_PORT_TSIO_7, UAPI_DMX_PORT_TAG_0 = 0xB0, /* The first Tag port .CNcomment:Tag 端口0 */ UAPI_DMX_PORT_TAG_1, UAPI_DMX_PORT_TAG_2, UAPI_DMX_PORT_TAG_3, UAPI_DMX_PORT_TAG_4, UAPI_DMX_PORT_TAG_5, UAPI_DMX_PORT_TAG_6, UAPI_DMX_PORT_TAG_7, UAPI_DMX_PORT_MAX } uapi_dmx_port; /* TS port mode.CNcomment:TS端口模式 */ typedef enum { UAPI_DMX_PORT_MODE_EXTERNAL, /* External TS input mode.CNcomment:外部TS输入 */ UAPI_DMX_PORT_MODE_INTERNAL, /* Internal TS input mode.CNcomment:内部TS输入 */ UAPI_DMX_PORT_MODE_RAM, /* Memory input mode.CNcomment:从内存输入 */ UAPI_DMX_PORT_MODE_MAX } uapi_dmx_port_mode; /* TS port type.CNcomment:TS端口类型 */ typedef enum { UAPI_DMX_PORT_TYPE_PARALLEL_BURST, /* Parallel burst mode.CNcomment:并行BURST模式 */ UAPI_DMX_PORT_TYPE_PARALLEL_VALID, /* Parallel valid mode.CNcomment:并行VALID模式 */ UAPI_DMX_PORT_TYPE_PARALLEL_NOSYNC_188, /* Self-sync 188 mode.CNcomment:自同步188模式 */ UAPI_DMX_PORT_TYPE_PARALLEL_NOSYNC_204, /* Self-sync 204 mode.CNcomment:自同步204模式 */ UAPI_DMX_PORT_TYPE_PARALLEL_NOSYNC_188_204, /* self-sync 188/204 auto-identification mode. * CNcomment:自同步188/204自动识别模式 */ UAPI_DMX_PORT_TYPE_SERIAL, /* Serial sync mode, 1bit.CNcomment:串行sync模式, 1bit串行 */ UAPI_DMX_PORT_TYPE_SERIAL_NOSYNC, /* Serial nosync mode, 1bitCNcomment:串行nosync模式, 1bit串行 */ UAPI_DMX_PORT_TYPE_SERIAL_NOSYNC_NOVALID, /* Serial nosync novalid mode, 1bit. * CNcomment:串行nosync novalid模式, 1bit串行 */ UAPI_DMX_PORT_TYPE_SERIAL2BIT, /* Serial sync mode, 2bit.CNcomment:串行sync模式, 2bit串行 */ UAPI_DMX_PORT_TYPE_SERIAL2BIT_NOSYNC, /* Serial nosync mode, 2bitCNcomment:串行nosync模式, 2bit串行 */ UAPI_DMX_PORT_TYPE_SERIAL2BIT_NOSYNC_NOVALID, /* Serial nosync novalid mode, 2bit. * CNcomment:串行nosync novalid模式, 2bit串行 */ UAPI_DMX_PORT_TYPE_USER_DEFINED, /* User defined mode.CNcomment:用户自定义模式 */ UAPI_DMX_PORT_TYPE_AUTO, /* Auto mode.CNcomment: 自动模式 */ UAPI_DMX_PORT_TYPE_MAX } uapi_dmx_port_type; /* TSO clock mode.CNcomment:TS输出端口时钟模式 */ typedef enum { UAPI_DMX_TSO_CLK_MODE_NORMAL, /* Normal clock: clock always active.CNcomment:普通模式的时钟,时钟平率均匀 */ UAPI_DMX_TSO_CLK_MODE_JITTER, /* Jittered clock: clock active only when outputing data. * CNcomment:Jittered 模式时钟,时钟频率不均匀,此时只有在有数据输出时才会出时钟 * (valid信号为高的情况下) */ UAPI_DMX_TSO_CLK_MODE_MAX } uapi_dmx_tso_clk_mode; /* TSO valid mode.CNcomment:TS输出端口valid信号模式 */ typedef enum { UAPI_DMX_TSO_VALID_ACTIVE_OUTPUT, /* Valid signal high when outputing datas.CNcomment:valid信号在输出数据时为高 */ UAPI_DMX_TSO_VALID_ACTIVE_HIGH, /* Valid signal always high.CNcomment:valid信号总是为高 */ UAPI_DMX_TSO_VALID_ACTIVE_MAX } uapi_dmx_tso_valid_mode; /* TSO port signal line selector.CNcomment:TS输出端口线序选择 */ typedef enum { UAPI_DMX_TSO_SERIAL_BIT_0 = 0x0, /* Serial output data using data[0] as signal line. * CNcomment:使用data[0]作为串行信号线输出 */ UAPI_DMX_TSO_SERIAL_BIT_7 = 0x7, /* Serial output data using data[7] as signal line. * CNcomment:使用data[7]作为串行信号线输出 */ UAPI_DMX_TSO_SERIAL_BIT_MAX } uapi_dmx_tso_serial_bit; /* TS out mode clock frequency.CNcomment:TS输出模块时钟频率,注意,实际的TS out 端口输出频率 = TSO 模块时钟/分频因子 */ typedef enum { UAPI_DMX_TSO_CLK_100M, /* TS out mode clock frequency 100M.CNcomment:TS输出模块时钟频率选择为100M */ UAPI_DMX_TSO_CLK_150M, /* TS out mode clock frequency 150M.CNcomment:TS输出模块时钟频率选择为150M */ UAPI_DMX_TSO_CLK_1200M, /* TS out mode clock frequency 1200M.CNcomment:TS输出模块时钟频率选择为1200M */ UAPI_DMX_TSO_CLK_1500M, /* TS out mode clock frequency 1500M.CNcomment:TS输出模块时钟频率选择为1500M */ UAPI_DMX_TSO_CLK_MAX } uapi_dmx_tso_clk; /* Tag sync mode.CNcomment: Tag 同步模式 */ typedef enum { UAPI_DMX_SYNC_ON_TAG = 0x0, /* < tag sync signal at tag head.CNcomment:sync信号在tag头 */ UAPI_DMX_SYNC_ON_TS_HEAD = 0x1, /* < tag sync signal at 47 heade. */ } uapi_dmx_cb_desc; /* Initializes the DEMUX module.CNcomment:初始化DEMUX模块。 * Before using DEMUXs, you must call this application programming interface (API) * Before using the personal video recorder (PVR) or audio/video player (AVPLAY), * you need to initialize the DEMUX module. * The error code TD_SUCCESS is returned if this API is called repeatedly. * CNcomment:在进行DEMUX相关操作前应该首先调用本接口 * 在使用PVR和AVPLAY前请提前进行DEMUX模块的初始化 * 重复调用本接口返回成功。 * param * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 */ td_s32 uapi_dmx_init(td_void); /* * brief Deinitializes the DEMUX module. CNcomment:去初始化DEMUX模块。 * After this API is called, the DEMUX module is stopped, and the DEMUX resources used by the process are released. * This API is valid when it is called for the first time. If this API is called repeatedly, * the error code TD_SUCCESS is returned. * CNcomment:调用本接口停止使用DEMUX模块,并释放本进程所占用的DEMUX资源 * 本接口第一次调用起作用,重复调用返回成功。 * param *retval ::TD_SUCCESS Success CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 */ td_s32 uapi_dmx_deinit(td_void); /* * brief Obtains the information about the service capabilities of the DEMUX module. * The information includes the numbers of channels, filters, keys, ports, DEMUXs, and audio/video channels. * CNcomment:查询DEMUX模块业务能力。 * 业务功能包括通用通道数目、过滤器数目、密钥数目、端口数目、DEMUX设备数目和音视频通道数目等。 * param[out] capability Pointer to the capability of the DEMUX module (output).CNcomment:指针类型,输出DEMUX模块能力。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null.CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_capability(uapi_dmx_capability *capability); /* * brief Sets the tsi port attr corresponding to demod.CNcomment:设置demod对应的tsi端口属性。 * param[in] demod_id Demod ID.CNcomment:demod号。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid.CNcomment:输入参数非法。 */ td_s32 uapi_dmx_attach_demod(td_u8 demod_id); /* * brief Obtains the attributes of a DEMUX port.CNcomment:获取DEMUX端口属性。 * param[in] id Port ID.CNcomment:端口号。 * param[out] attr Pointer to the port attributes (output).CNcomment:指针类型,输出端口属性。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid.CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null.CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_ts_port_attr(uapi_dmx_port id, uapi_dmx_port_attr *attr); /* * brief Sets the attributes of a DEMUX port.CNcomment:设置DEMUX端口属性。 * It is recommended to query the default attributes of a DEMUX port by calling uapi_dmx_get_ts_port_attr * before modifying the attributes of the port. * The port mode can be queried only, notice that it will lose TS data if call this function during receiving data. * If the sync loss threshold and sync lock threshold are used, their default values are recommended. * For details on how to set the input clock of the tuner, select the line sequence of the port, * and set the level of the tuner error line, contact hardware engineers of Huanglong and refer to tuner user manuals. * If ramport, it must be called after UAPI_DMX_CreateTSBuffer. * CNcomment:建议先通过uapi_dmx_get_ts_port_attr获取默认属性,然后对要改变的属性进行设置 * 端口模式只支持查询,不支持修改,注意收数据过程调用该接口会引起丢TS包 * 同步丢失和同步锁定门限,推荐使用默认值 * tuner输入时钟反向、端口线序选择和tuner error线电平模式的设置请咨询硬件工程师 * 并参考tuner的用户手册,然后设置为合适的值 * 针对ramport,本接口需要在UAPI_DMX_CreateTSBuffer之后调用。 * param[in] id Port ID.CNcomment:端口号。 * param[in] attr Pointer to port attributes.CNcomment:指针类型,端口属性。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_set_ts_port_attr(uapi_dmx_port id, const uapi_dmx_port_attr *attr); /* * brief Obtains the attributes of a DEMUX TSO port.CNcomment:获取DEMUX TS输出端口属性。 * param[in] id Port ID.CNcomment:端口号。 * param[out] attr Pointer to the port attributes (output).CNcomment:指针类型,输出端口属性。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid.CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null.CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_tso_port_attr(uapi_dmx_tso_port id, uapi_dmx_tso_port_attr *attr); /* * brief Sets the attributes of a DEMUX TSO port.CNcomment:设置DEMUX TS 输出端口属性。 * It is recommended to query the default attributes of a DEMUX TSO port by calling uapi_dmx_get_tso_port_attr * before modifying the attributes of the TSO port. * CNcomment:建议先通过uapi_dmx_get_tso_port_attr获取默认属性,然后对要改变的属性进行设置。 * param[in] id Port ID.CNcomment:端口号。 * param[in] attr Pointer to port attributes.CNcomment:指针类型,端口属性。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_set_tso_port_attr(uapi_dmx_tso_port id, const uapi_dmx_tso_port_attr *attr); /* * brief Get the tag attributes.CNcomment:获取tag 的相关属性。 * pstAttr.au8Tag is a key index, this interface will return corresponding tag attrs if this key value has registered, * otherwise return default tag attrs. * CNcomment:pstAttr.au8Tag参数是一个索引,这个接口会返回对应的tag参数如果这个索引已经被注册, * 否则的话返回默认的tag属性配置。 * param[in] id TagPort ID.CNcomment:TapPort ID号。 * param[in & out] attr Pointer to the tag port attributes (output).CNcomment:指针类型,tag端口属性。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid.CNcomment:输入参数非法。 */ td_s32 uapi_dmx_get_tag_port_attr(uapi_dmx_port id, uapi_dmx_tag_attr *attr); /* * brief Set the tag attributes.CNcomment:设置tag的相关属性。 * pstAttr.au8Tag is a key index, it will register this new tag if this key value has not registered. * otherwise increase tag reference number. * N/A.CNcomment:pstAttr.au8Tag参数是一个索引,这个接口会注册新的tag值如果tag未被注册的话,否则会增加tag的应用计数。 * param[in] id TagPort ID.CNcomment:TapPort ID号。 * param[in] attr Pointer to the tag port attributes (output).CNcomment:指针类型,tag端口属性。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid.CNcomment:输入参数非法。 */ td_s32 uapi_dmx_set_tag_port_attr(uapi_dmx_port id, const uapi_dmx_tag_attr *attr); /* * brief Attaches a DEMUX to a port.CNcomment:绑定DEMUX到端口上。 * Each DEMUX can be attached to only one port, but the data from a port can be delivered to multiple DEMUXs. * After a DEMUX is attached to a port, the DEMUX starts to receive the data input from this port. * If the DEMUX is not used, you can detach it by calling UAPI_DMX_DetachTSPort. * The DEMUXs can be attached to different ports dynamically. That is, you can attach the DEMUXs without detaching them. * If you call this API to attach a DEMUX to the same channel, the error code TD_SUCCESS is returned. * If ramport, it must be called before uapi_dmx_create_ts_buffer. * CNcomment:每路DEMUX只能绑定到一个PORT,但是一个PORT的数据可以分发到多个DEMUX * DEMUX绑定到端口上之后就开始接收这个端口上输入的数据 * 不再使用这路DEMUX接收数据后,使用UAPI_DMX_DetachTSPort接口解绑定DEMUX * 可以动态的绑定到不同的端口上,不用先解绑定 * 重复调用此接口绑定到相同通道上返回成功 * 针对ramport,本接口需要在uapi_dmx_create_ts_buffer之前调用。 * param[in] dmx_id DEMUX ID.CNcomment:DEMUX号。 * param[in] id Port ID.CNcomment:端口号。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_attach_ts_port(td_u32 dmx_id, uapi_dmx_port id); /* * brief Detaches a DEMUX from a port.CNcomment:从端口上解绑定DEMUX。 * If a DEMUX is not used, you can detach it from the corresponding port by calling this API. * This API can be called dynamically, and can be used to disable the input sources of a DEMUX. * If this API is called repeatedly, the error code TD_SUCCESS is returned. * CNcomment:不再使用DEMUX接收任何数据时使用此接口将DEMUX从端口上解绑定 * 可以动态使用解绑定接口,可以通过解绑定接口切断DEMUX的输入源 * 重复解绑定返回成功。 * param[in] dmx_id DEMUX ID. CNcomment: DEMUX号。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_detach_ts_port(td_u32 dmx_id); /* * brief Obtains the ID of the port that is attached to a DEMUX. CNcomment:获取DEMUX所绑定的端口的端口号。 * If a DEMUX is not attached to any port, an error code is * returned.CNcomment:如果DEMUX没有绑定到任何端口上会返回错误码。 param[in] dmx_id DEMUX ID. CNcomment: DEMUX号。 * param[out] id Pointer to the ID of the port that is attached to a DEMUX(output). * CNcomment:指针类型,输出DEMUX绑定的端口号。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_NOATTACH_PORT The DEMUX is not attached to any port.CNcomment:此路DEMUX没有绑定到任何端口上。 */ td_s32 uapi_dmx_get_ts_port_id(td_u32 dmx_id, uapi_dmx_port *id); /* * brief Obtains the default attributes of a TS Buffer.CNcomment:获取TS Buffer默认属性。 * It is recommended to query the default TS Buffer attributes before creating a TS Buffer, * and then modify the attributes, notice the secure mode of default attributes is None Secure Mode. * CNcomment:最好在申请TS Buffer之前使用此接口获取默认属性, * 然后改变需要修改的属性即可,注意默认属性为非安全模式。 * param[out] buffer_attr Pointer to the structure of the TS Buffer attributes.CNcomment:TS Buffer属性结构体指针。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_ts_buffer_default_attr(uapi_dmx_ts_buffer_attr *buffer_attr); /* * brief Creates a TS buffer for the RAM port to receive the TS data from Internet or local memory. * CNcomment:为RAM端口创建TS Buffer用于接收从网络或本地存储中输入的TS数据。 * A TS buffer can be created for the RAM port only. * The buffer size must range from 4 KB to 16 MB. * It is recommended to set the buffer size to an integral multiple of 4 KB. * Otherwise, bottom alignment is performed inside. * The TS buffer cannot be created for the same port for multiple times; otherwise, an error code is returned. * CNcomment:只有RAM端口可以创建TS Buffer * buffer大小必须在4K和16M之间,单位为字节 * buffer大小最好为4K的整数倍,如果不是整数倍,内部会进行向下对齐操作 * 同一个端口不能重复创建TS Buffer,否则返回错误码。 * param[in] id Port ID.CNcomment:端口号。 * param[in] ts_buffer_attr Attributes of a TS buffer.CNcomment:TS Buffer创建属性。 * param[out] ts_buffer Pointer to the handle of a created TS buffer (output). * CNcomment:指针类型,输出创建的TS Buffer 句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_RECREAT_TSBUFFER The TS buffer corresponding to the port is created.CNcomment:重复创建TS * Buffer。 */ td_s32 uapi_dmx_create_ts_buffer(uapi_dmx_port id, const uapi_dmx_ts_buffer_attr *ts_buffer_attr, td_handle *ts_buffer); /* * brief Destroys an existing TS buffer. CNcomment:销毁创建的TS Buffer。 * A TS buffer cannot be destroyed repeatedly. If a TS buffer is destroyed, its handle is also destroyed. * In addition, if a buffer is destroyed, its data is cleared. In this case, the get and put operations are not * available.However, the data in channels is retained when a TS buffer is destroyed. To switch streams, * you need disable the channel, and then enable the channel again. * CNcomment:不能重复销毁一个TS Buffer,销毁之后handle就不存在了 * 销毁之后buffer中的数据就会被清空,不能再进行Get和Put操作 * 销毁TS buffer并不能清空通道中数据,要切换码流,要注意关闭通道,重新打开。 * param[in] ts_buffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_destroy_ts_buffer(td_handle ts_buffer); /* * brief Attach demux handle and releated secure buffer to session manager. * CNcomment:将demux句柄及相应安全buffer绑定到 session manager。 * The demux handle should be tsbuffer handle. * CNcomment:此处demux句柄为tsbuffer句柄。 * param[in] handle Tsbuffer handle. CNcomment:Tsbuffer句柄。 * param[in] ssm_handle Session manager handle. CNcomment:session manager句柄。 * param[in] attach_type Buffer attach type. CNcomment:buffer绑定类型。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_ts_buffer_attach_ssm(td_handle handle, td_handle ssm_handle, uapi_dmx_buffer_attach_type attach_type); /* * brief Behavior1, Default,need work with uapi_dmx_put_ts_buffer. Obtains a TS buffer to input data. * CNcomment:行为一,默认模式,需要和uapi_dmx_put_ts_buffer配合使用。获取TS Buffer空间,用于数据输入。 * If you call this API repeatedly, the address of the same buffer is returned. * The input data length must be appropriate. If the data length is too large, data cannot be input in time. * If the data length is too small,the buffer is scheduled frequently, * which causes the system performance to deteriorate. * If the size of the available space is smaller than the requested data length, an error code is returned. * To be specific, the requested data length must be smaller than the size of the available space, that is, * the buffer cannot be full. * In addition, the requested data length cannot be 0; otherwise, the error code SOC_ERR_DMX_INVALID_PARA is returned. * If timeout_ms is set to 0, it indicates that the waiting time is 0; if timeout_ms is set to 0XFFFFFFFF, * it indicates infinite wait;if timeout_ms is set to other values,it indicates that the waiting time is timeout_ms ms. * If no buffer can be applied for during the block period, the error code SOC_ERR_DMX_TIMEOUT is returned. * If timeout_ms is set to 0, and no buffer can be applied for, it indicates that the internal TS buffer is full. * In this case,you need to call the usleep(10000) function to release the CPU. * Therefore,other threads can be scheduled. * CNcomment:重复get返回同一个buffer地址 * 输入数据时注意每次输入的数据长度,太长可能会导致输入数据不及时 * 太短可能会导致调度太频繁,性能下降 * 当剩余空间小于等于请求的长度时,返回错误码 * 每次申请的长度要小于剩余剩余长度,即buffer不可能被填满 * 请求长度不允许为0,否则返回参数非法错误码 * timeout_ms设置为0表示不等待,设置为0xffffffff表示一直等待,设置为其他值表示等待timeout_ms毫秒。 * 若超过阻塞时间,还无法申请到Buffer,则返回SOC_ERR_DMX_TIMEOUT错误码 * timeout_ms配置为0时,如果申请不到Buffer,说明此时内部TS Buffer空间已满,需要通过usleep(10000)释放cpu * 以使其它线程能够得到调度。 * param[in] hTsBuffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * param[in] u32ReqLen Requested data length.CNcomment:请求数据的长度。 * param[out] pstData Data buffer.CNcomment:数据buffer结构。 * param[in] timeout_ms Wait timeout, in ms.CNcomment:等待超时时间,单位ms。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_TIMEOUT The wait times out. CNcomment:等待超时。 * retval ::SOC_ERR_DMX_NOAVAILABLE_BUF The size of the available buffer is smaller than the requested data length. * CNcomment:剩余buffer空间小于请求长度。 * Behavior2,Support multrtherad operate one tsbuffer,Only Valid wen CFG_DMX_TSBUF_MULTI_THREAD_SUPPORT=y, * need work with uapi_dmx_put_ts_buffer and uapi_dmx_release_ts_buffer. Obtains a TS buffer to input data. * CNcomment:行为二,支持多线程操作同一个TSbuffer模式,仅当CFG_DMX_TSBUF_MULTI_THREAD_SUPPORT=y有效, * 需要和uapi_dmx_put_ts_buffer、uapi_dmx_release_ts_buffer配合使用。获取TS Buffer空间,用于数据输入。 * If you call this API repeatedly and didn't call uapi_dmx_release_ts_buffer, * the address of the different buffer block * is returned and memory leak will be happened, this function must be couple with UAPI_DMX_ReleaseTSBuffer. * The input data length must be appropriate. If the data length is too large, data cannot be input in time. * If the data length is too small, the buffer is scheduled frequently, * which causes the system performance to deteriorate. * If the size of the available space is smaller than the requested data length, an error code is returned. * To be specific, the requested data length must be smaller than the size of the available space, that is, * the buffer cannot be full. * In addition, the requested data length cannot be 0; otherwise, the error code SOC_ERR_DMX_INVALID_PARA is returned. * If timeout_ms is set to 0, it indicates that the waiting time is 0; if timeout_ms is set to 0XFFFFFFFF, * it indicates infinite wait;if timeout_ms is set to other values,it indicates that the waiting time is timeout_ms ms. * If no buffer can be applied for during the block period, the error code SOC_ERR_DMX_TIMEOUT is returned. * If timeout_ms is set to 0, and no buffer can be applied for, it indicates that the internal TS buffer is full. * In this case,you need to call the usleep(10000) function to release the CPU.Therefore,other threads can be scheduled. * CNcomment:重复get返回不同buffer块的地址,并且如果本接口调用成功而不调用UAPI_DMX_ReleaseTSBuffer, * 则会引起内存泄漏,所以只要本接口调用成功,必须调用uapi_dmx_release_ts_buffer确保buffer块正确释放。 * 输入数据时注意每次输入的数据长度,太长可能会导致输入数据不及时 * 太短可能会导致调度太频繁,性能下降 * 当剩余空间小于等于请求的长度时,返回错误码 * 每次申请的长度要小于剩余剩余长度,即buffer不可能被填满 * 请求长度不允许为0,否则返回参数非法错误码 * timeout_ms设置为0表示不等待,设置为0xffffffff表示一直等待,设置为其他值表示等待timeout_ms毫秒。 * 若超过阻塞时间,还无法申请到Buffer,则返回SOC_ERR_DMX_TIMEOUT错误码 * timeout_ms配置为0时,如果申请不到Buffer,说明此时内部TS Buffer空间已满,需要通过usleep(10000)释放cpu * 以使其它线程能够得到调度。 * param[in] ts_buffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * param[in] req_len Requested data length.CNcomment:请求数据的长度。 * param[out] ts_stream Data buffer.CNcomment:数据buffer结构。 * param[in] timeout_ms Wait timeout, in ms.CNcomment:等待超时时间,单位ms。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_TIMEOUT The wait times out. CNcomment:等待超时。 * retval ::SOC_ERR_DMX_NOAVAILABLE_BUF The size of the available buffer is smaller than the requested data length. * CNcomment:剩余buffer空间小于请求长度。 */ td_s32 uapi_dmx_get_ts_buffer(td_handle ts_buffer, td_u32 req_len, uapi_stream_buf *ts_stream, td_u32 timeout_ms); /* * brief Updates the write pointer of a TS buffer after the TS data is input. * CNcomment:TS数据输入完毕,用于更新TS Buffer写指针。 * This API must work with uapi_dmx_get_ts_buffer. That is, if you call uapi_dmx_put_ts_buffer without calling * uapi_dmx_get_ts_buffer, no operation takes effect, but the error code TD_SUCCESS is returned. * If the valid data length is 0, no operation takes effect, and the error code TD_SUCCESS. * The valid data length cannot be greater than data length queried by calling uapi_dmx_get_ts_buffer. * Otherwise, the error code SOC_ERR_DMX_INVALID_PARA is returned. * If the valid data length is smaller than the data length queried by calling uapi_dmx_get_ts_buffer, * it indicates that a part of data is stored. * CNcomment:此接口必须和Get接口配对使用,如果没有Get则进行Put操作,则不会进行任何操作,但返回成功 * Put的长度如果为0,也不会进行任何操作直接返回成功 * 不允许Put长度大于实际Get到的长度,否则返回参数非法错误码 * 允许Put长度小于Get长度,表明只输入了一部分数据 * 为提高效率,Put的长度尽量不要太短,尽量保持在10个ts包以上Put一次,数据太短会导致性能下降。 * param[in] ts_buffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * param[in] valid_data_len Valid data length.CNcomment:有效数据的长度。 * param[in] start_pos Start position of the valid data. CNcomment:有效数据的起始位置。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_put_ts_buffer(td_handle ts_buffer, td_u32 valid_data_len, td_u32 start_pos); /* * brief Only valid when CFG_DMX_TSBUF_MULTI_THREAD_SUPPORT=y Updates the write pointer of a TS buffer after * the TS data is input.CNcomment:TS数据输入完毕,用于更新TS Buffer写指针。 * This API must work after uapi_dmx_get_ts_buffer success. That is, if you call uapi_dmx_push_ts_buffer * without calling uapi_dmx_get_ts_buffer, no operation takes effect, but the error code TD_SUCCESS is returned. * If the valid data length is 0, no operation takes effect, and the error code TD_SUCCESS. * The valid data length cannot be greater than data length queried by calling uapi_dmx_get_ts_buffer. * Otherwise, the error code SOC_ERR_DMX_INVALID_PARA is returned. * If the valid data length is smaller than the data length queried by calling uapi_dmx_get_ts_buffer, * it indicates that a part of data is stored. * CNcomment:此接口必须在Get接口调用成功后使用,如果没有Get则进行Push操作,则不会进行任何操作,但返回成功 * Put的长度如果为0,也不会进行任何操作直接返回成功 * 不允许Push长度大于实际Get到的长度,否则返回参数非法错误码 * 允许Push长度小于Get长度,表明只输入了一部分数据 * 为提高效率,Push的长度尽量不要太短,尽量保持在10个ts包以上Push一次,数据太短会导致性能下降。 * param[in] ts_buffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * param[in] ts_stream Pointer that point to uapi_stream_buf.CNcomment:指向uapi_stream_buf类型的结构体指针。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_push_ts_buffer(td_handle ts_buffer, const uapi_stream_buf *ts_stream); /* * brief Only valid when CFG_DMX_TSBUF_MULTI_THREAD_SUPPORT=y Release the Ts buffer Get by uapi_dmx_get_ts_buffer. * CNcomment:释放由uapi_dmx_get_ts_buffer接口申请的TS buffer空间。 * This API must work with uapi_dmx_get_ts_buffer. That is, you must call uapi_dmx_release_ts_buffer, * if uapi_dmx_get_ts_buffer has success,if not, there will be memory leak happened. * The valid data length cannot be greater than data length queried by calling uapi_dmx_get_ts_buffer. * Otherwise, the error code SOC_ERR_DMX_INVALID_PARA is returned. * If the valid data length must be same as the data length queried by calling uapi_dmx_get_ts_buffer. * CNcomment:此接口必须和Get接口配对使用,换句话说uapi_dmx_get_ts_buffer调用成功后必须调用本接口释放buffer, * 否则将有内存泄漏发生。 * 不允许Release长度大于实际Get到的长度,否则返回参数非法错误码 * Release长度必须和Get的长度一致。 * param[in] ts_buffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * param[in] ts_stream Pointer that point to uapi_stream_buf.CNcomment:指向uapi_stream_buf类型的结构体指针。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_release_ts_buffer(td_handle ts_buffer, const uapi_stream_buf *ts_stream); /* * brief Wait until tsbuffer stream has been consumed completely.CNcomment:等待tsbuffer里的码流数据消耗完成。 * param[in] ts_buffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_flush_ts_buffer(td_handle ts_buffer); /* * brief Resets a TS buffer to clear its data.CNcomment:复位TS Buffer,清空TS Buffer中的数据。 * If a TS buffer is reset, you can call uapi_dmx_put_ts_buffer only after calling uapi_dmx_get_ts_buffer. * CNcomment:TS Buffer复位后需要重新get才能执行put操作。 * param[in] ts_buffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_reset_ts_buffer(td_handle ts_buffer); /* * brief Obtains the status of a TS buffer. CNcomment:获取TS Buffer状态。 * You can query the size of a TS buffer and the used buffer size by calling this API. * CNcomment:可以查询TS Buffer大小和已用的空间大小。 * param[in] ts_buffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * param[out] ts_buffer_status TS buffer status.CNcomment:TS Buffer状态结构。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_ts_buffer_status(td_handle ts_buffer, uapi_dmx_ts_buffer_status *ts_buffer_status); /* * brief Obtains the ID of the port corresponding to a TS buffer.CNcomment:获取TS Buffer对应的Port ID。 * If you query the ID of the port corresponding to a TS buffer that is not applied for successfully, * an error code is returned. * CNcomment:对于没有申请的TS buffer,查询会返回错误。 * param[in] ts_buffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * param[out] id ID of the port.corresponding to a TS buffer CNcomment:TS Buffer对应的Port ID。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_ts_buffer_port_id(td_handle ts_buffer, uapi_dmx_port *id); /* * brief Obtains the handle of the TS buffer corresponding to a port ID.CNcomment:获取Port ID对应的TS Buffer handle。 * If you obtain the handle of a TS buffer that is not created, an error code is returned. * CNcomment:对于没有申请的TS buffer,查询会返回错误。 * param[in] id Port ID. CNcomment:端口号。 * param[out] ts_buffer Handle of a TS buffer.CNcomment:TS Buffer句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_ts_buffer_handle(uapi_dmx_port id, td_handle *ts_buffer); /* * brief Obtains the information about TS packets of a port.CNcomment:获取端口的TS包信息。 * If you query the information about an unattached port, an error code is returned. * CNcomment:对于没有绑定的端口,查询会返回错误。 * param[in] id Port ID. CNcomment:端口号。 * param[out] port_status Number of TS packets .CNcomment:TS包计数信息。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_ts_port_packet_num(uapi_dmx_port id, uapi_dmx_port_packet_num *port_status); /* * brief Obtains the default attributes of a channel.CNcomment:获取通道默认属性。 * It is recommended to query the default channel attributes before creating a channel, and then modify the attributes. * By default, the attributes of the Section channel are returned. If other channels are used, * you need to modify the attributes. * CNcomment:最好在申请通道之前使用此接口获取默认属性,然后改变需要修改的属性即可 * 默认属性按一般的section通道返回的,如果要使用其他类型的通道注意修改属性值。 * param[out] play_chan_attr Pointer to the structure of the channel attributes.CNcomment:通道属性结构体指针。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_play_chan_default_attr(uapi_dmx_chan_attr *play_chan_attr); /* * brief Creates a play channel based on channel attributes.CNcomment:根据通道属性创建一个播放通道。 * It is recommended to call uapi_dmx_get_play_chan_default_attr to query default channel attributes before calling * uapi_dmx_create_play_chan. * For the Section channel and ECM/EMM channel, you can set the CRC mode, and dynamically change the CRC mode by calling * uapi_dmx_get_play_chan_attr. * For other channels, the CRC check is always disabled. If you select other CRC modes, * the CRC disable mode takes effect by default. * You need to set the buffer size when creating a channel. The buffer size is in the unit of byte and the default size * is 16 KB. * It is recommended to set the buffer size to a value greater than 4 KB for the Section channel, ECM/EMM channel, * or post channel. If the buffer size is smaller than 4 KB, the size of 4 KB is used by default. * It is recommended to set the buffer size to a value greater than 64 KB for the PES channel. * If the buffer size is smaller than 64 KB, the size of 64 KB is used by default. * CNcomment:建议调用此接口之前,建议先调用uapi_dmx_get_play_chan_default_attr获取通道默认属性 * 只有section类型的通道和ecm emm类型的通道支持设置CRC模式,并且可以通过属性设置接口动态修改CRC模式 * 其他类型通道只支持设置为CRC禁止,如果选择了其他类型的CRC会被默认修改为CRC禁止 * 在申请通道时注意Buffer大小的配置,默认大小为16K,buffer大小的单位为字节 * Section、ecm emm和POST通道的buffer大小至少为4K,如果小于4K会被默认修改为4K * PES通道建议使用64K以上的buffer大小,如果小于64K会被默认修改为64K * param[in] dmx_id DEMUX ID. CNcomment: DEMUX号。 * param[in] chan_attr Pointer to the attributes of an input channel.For details, * see the description of i_iapi_dmx_chan_attr.CNcomment:指针类型,输入通道属性。请参见::uapi_dmx_chan_attr。 * param[out] play_chan Pointer to the handle of an allocated channel.CNcomment:指针类型,输出分配的通道Handle。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_NOFREE_CHAN There is no available channel.CNcomment:没有空闲通道。 */ td_s32 uapi_dmx_create_play_chan(td_u32 dmx_id, const uapi_dmx_chan_attr *play_chan_attr, td_handle *play_chan); /* * brief Destroys an existing play channel.CNcomment:销毁创建的播放通道。 * If you release an enabled channel, the channel is disabled automatically. If you release a channel that is attached * to a filter or key area, the channel is detached from the filter or key area automatically. * However, the filter or key area is not released. * It is recommended to explicitly detach channels by calling corresponding detach APIs. In this way, resources are * managed in a unified manner. * CNcomment:释放通道时如果通道处于打开状态会自动关闭通道,如果通道上绑定了过滤器或密钥区,会自动解绑定 * 但是并不会释放过滤器和密钥区 * 建议使用解绑定接口进行显式的解绑定操作,对资源的使用进行清晰的管理。 * param[in] play_chan Play channel handle.CNcomment:通道句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_destroy_play_chan(td_handle play_chan); /* * brief Attach demux handle and releated secure buffer to session manager.CNcomment:将demux句柄及相应安全buffer绑定到 * session manager。 * The demux handle should be play channel handle. * CNcomment:此处demux句柄为播放句柄。 * param[in] play_chan Play channel handle. CNcomment:播放通道句柄。 * param[in] ssm_handle Session manager handle. CNcomment:session manager句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_play_chan_attach_ssm(td_handle play_chan, td_handle ssm_handle); /* * brief Obtains the attributes of a play channel.CNcomment:获取播放通道属性。 * The API can be called only after a channel is allocated.CNcomment:本接口必须在通道分配以后才可以调用。 * param[in] play_chan Channel handle.CNcomment:通道Handle。 * param[out] chan_attr Pointer to the attributes of a specified channel. For details, * see the description of uapi_dmx_chan_attr.CNcomment:指针类型,输出指定通道属性。请参见::uapi_dmx_chan_attr。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid.CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_play_chan_attr(td_handle play_chan, uapi_dmx_chan_attr *chan_attr); /* * brief Sets the attributes of a play channel.CNcomment:设置播放通道属性。 * The API can be called only after a channel is allocated. * You cannot dynamically modify all attributes except the CRC mode by calling uapi_dmx_set_play_chan_attr. * To be specific, the CRC mode can be changed dynamically after a channel is created. * If you modify other attributes, the error code SOC_ERR_DMX_INVALID_PARA is returned. * CNcomment:本接口必须在通道分配以后才可以调用 * 除了CRC模式其他属性都不允许使用uapi_dmx_set_play_chan_attr接口进行动态修改 * CRC模式可以在通道申请后的任意时刻修改,动态生效 * 要修改其他属性会返回参数非法错误码。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * param[in] chan_attr Pointer to the attributes of an input channel. For details, see the description of * uapi_dmx_chan_attr. CNcomment:指针类型,输入通道属性。请参见 ::uapi_dmx_chan_attr。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_set_play_chan_attr(td_handle play_chan, const uapi_dmx_chan_attr *chan_attr); /* * brief Sets the PID of a play channel.CNcomment:设置播放通道PID。 * If you set the same PID for two channels of a DEMUX, the PID of the second channel is valid, * and the PID of the first channel is changed to 0x1FFF. * You must set the PID of a channel after the channel is disabled. * If you set the PID of a channel to 0x1FFF, the channel cannot receive data. That is, the channel is disabled. * CNcomment:同一路DEMUX的两个通道设置相同的PID。后设置的通道有效,先设置的通道的PID被修改为0x1fff * 必须在通道关闭的状态下配置通道的PID * 允许将通道的PID配置为0x1fff,配置为0x1fff后不接收任何数据,相当于关闭通道。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * param[in] pid Channel PID.CNcomment:通道PID。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_OPENING_CHAN The channel is enabled.CNcomment:通道处于打开状态。 */ td_s32 uapi_dmx_set_play_chan_pid(td_handle play_chan, td_u32 pid); /* * brief Obtains the PID of a play channel.CNcomment:获取播放通道配置的PID。 * If no PID is set for a channel, the obtained value is 0x1FFF. * You can obtain the channel PID after a channel is created. * CNcomment:没有配置PID前,获取到的PID为0x1fff * 可以在通道申请后的任意时刻获取通道PID。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * param[out] pid Pointer to the PID of a channel (output).CNcomment:指针类型,输出通道的PID。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_play_chan_pid(td_handle play_chan, td_u32 *pid); /* * brief Enables a paly channel.CNcomment:打开播放通道。 * If you call this API to enable a play channel that has been enabled, no error occurs. * If you call this API to enable a Section channel that is not attached to a filter, the channel cannot receive data. * If you want to receive data without filter, you can create a filter and then set its filter depth to 0. * CNcomment:在播放通道打开状态下,调用本接口打开通道不会发生错误 * 对于section通道,在通道没有绑定过滤器时调用本接口,通道不能接收数据 * 如果不想使用filter接收数据,可以申请一个filter将过滤深度配置为0,进行数据接收。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_open_play_chan(td_handle play_chan); /* * brief Disables a play channel.CNcomment:关闭播放通道。 * If you this API to disable a play channel that has been disabled, no error occurs. * CNcomment:在播放通道关闭状态下,调用本接口关闭通道不会发生错误。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_close_play_chan(td_handle play_chan); /* * brief Obtains the status of a play channel.CNcomment:获取播放通道状态。 * You can call this API after a channel is created.CNcomment:可以在通道申请后的任意时刻调用。 * param[in] chan Channel handle.CNcomment:通道句柄。 * param[out] chan_status Pointer to the status of a channel (output). For details, * see the description of ::uapi_dmx_chan_status.CNcomment:指针类型,输出通道状态。请参见::uapi_dmx_chan_status * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_play_chan_status(td_handle play_chan, uapi_dmx_chan_status *chan_status); /* * brief Obtains the handle of the pid channel with a specific PID.CNcomment:获取配置某PID的通道句柄。 * You must specify the DEMUX ID when calling this API, because the channel PIDs of different DEMUXs can be the same. * You cannot query the PID that is equal to or greater than 0x1FFF; otherwise, the error code * SOC_ERR_DMX_INVALID_PARA is returned. * If no channel with a specific PID is found, an error code is returned. * CNcomment:因不同DEMUX设备的通道允许设置相同的PID,调用本接口需要指定DEMUX ID * 不允许查询0x1fff及以上的非法PID值,否则返回参数非法错误码 * 如果没有查询到任何通道设置了要查询的PID,将返回错误码。 * param[in] dmx_id DEMUX ID. CNcomment: DEMUX号。 * param[in] pid Channel PID.CNcomment:通道PID。 * param[out] pid_channel Pointer to channel handle.CNcomment: 指针类型,输出通道Handle。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_UNMATCH_CHAN No matched channel is found.CNcomment:没有查询到匹配通道。 * retval ::SOC_ERR_DMX_OCCUPIED_PID The same pid was found on multiple channels.CNcomment:在多个通道上发现了相同的PID。 */ td_s32 uapi_dmx_get_pid_chan_handle(td_u32 dmx_id, td_u32 pid, td_handle *pid_chan); /* * brief Obtains the number of available channels of a DEMUX.CNcomment:获取DEMUX设备可用的空闲通道的数量。 * The returned number is the number of all remaining channels including the used audio/video channels. * Because channels are allocated in a unified manner, the parameter u32DmxId is invalid. * CNcomment:返回的数量为所有通道剩余的数量,包括已被使用的音视频通道 * 由于通道资源统一分配所以参数u32DmxId已经没有意义。 * param[in] dmx_id DEMUX ID. CNcomment: DEMUX号。 * param[out] free_count Pointer to the number of available channels of a DEMUX. * CNcomment:指针类型,输出DEMUX空闲通道数目。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_free_play_chan_count(td_u32 dmx_id, td_u32 *free_count); /* * brief Obtains the scrambled flag of the channel data.CNcomment:获取通道数据加扰标志。 * You can query the scrambled PES data and ES data.CNcomment:支持PES级加扰和TS级加扰的查询。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * param[out] scramble_flag Pointer to the scrambled flag of the channel data (output). * For details, see the description of ::uapi_dmx_scrambled_flag. * CNcomment:指针类型,输出通道数据加扰标志。请参见::uapi_dmx_scrambled_flag。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_play_chan_scrambled_flag(td_handle play_chan, uapi_dmx_scrambled_flag *scramble_flag); /* * brief Creates a data filter.CNcomment:创建一个数据过滤器。 * The maximum depth of a filter is 16 bytes. * For details on how to set the attributes of a filter, see the description of ::uapi_dmx_filter_attr. * You can set a filter when creating it. If you do not want to filter data, you can set the filter depth to 0. * To modify the attributes of a filter, call uapi_dmx_set_filter_attr. * The attributes can be modified dynamically. * If a filter is used to filter the Section data, the valid byte is byte 1 and byte 4 to byte 18. * If a filter is used to filter the PES data, the valid byte is byte 4 and byte 7 to byte 21. * The filter can be used to filter the data of general-purpose channels only, including the Section channel, * ECM/EMM channel, and PES channel. * If a filter is allocated successfully, phFilter returns the handle of the created filter. * CNcomment:过滤器深度最大为16 * 过滤器属性配置请参考::uapi_dmx_filter_attr * 创建过滤器时,同时实现对过滤器的设置;若不需要数据过滤,设置过滤器深度为0即可 * 若需要修改过滤器属性,可调用uapi_dmx_set_filter_attr进行属性修改 * 支持属性的动态修改 * 过滤器用于过滤Section数据时,有效过滤字节为第1字节及第4字节~第18字节 * 过滤器用于过滤PES数据时,有效过滤字节为第4字节及第7字节~第21字节 * 过滤器只适用于通用通道的数据过滤,包括section通道、ECM/EMM通道和PES通道 * 若分配成功,phFilter返回获取的过滤器Handle。 * param[in] dmx_id DEMUX ID. CNcomment: DEMUX号。 * param[in] filter_attr Pointer to the attributes of a filter (input).CNcomment:指针类型,输入过滤器属性。 * param[out] filter Pointer to the handle of the created filter (output).CNcomment:指针类型,输出申请的过滤器Handle。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_NOFREE_FILTER There is no available filter.CNcomment:没有空闲filter。 */ td_s32 uapi_dmx_create_filter(td_u32 dmx_id, const uapi_dmx_filter_attr *filter_attr, td_handle *filter); /* * brief Destroys an existing data filter.CNcomment:销毁创建的数据过滤器。 * If a filter is attached to a general-purpose channel, you can call this API to release the filter * when the channel is enabled or disabled. * If no filter is attached to a Section channel, the channel cannot receive data. * This restriction is not applicable to other channels. * CNcomment:若过滤器和通用通道绑定,允许在通道打开或者关闭状态下,调用本接口释放过滤器 * 对于section通道当通道上没有任何过滤器绑定时,则不再接收数据,其他通道没有此限制。 * param[in] filter Filter handle.CNcomment:过滤器句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_destroy_filter(td_handle filter); /* * brief Releases all the filters attached to a channel.CNcomment:释放绑定在某个通道上的所有过滤器。 * You can call this API to release all filters attached to a channel when the channel is enabled * or disabled.CNcomment:允许在通道打开或者关闭状态下,调用本接口释放通道上绑定的所有过滤器。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is valid.CNcomment:输入参数非法。 */ td_s32 uapi_dmx_delete_all_filter(td_handle play_chan); /* * brief Sets the filter criteria of a filter.CNcomment:设置过滤器的过滤条件。 * The maximum filter depth u32FilterDepth is 16. * For details on how to set the attributes of a filter, see the description of ::uapi_dmx_filter_attr. * If a filter is used to filter the Section data, the valid byte is byte 1 and byte 4 to byte 18. * If a filter is used to filter the PES data, the valid byte is byte 4 and byte 7 to byte 21. * The attributes can be modified dynamically. * CNcomment:过滤器的深度属性u32FilterDepth最大为16 * 过滤器属性配置请参考::uapi_dmx_filter_attr * 过滤器用于过滤Section数据时,有效过滤字节为第1字节及第4字节~第18字节 * 过滤器用于过滤PES数据时,有效过滤字节为第4字节及第7字节~第21字节 * 支持属性的动态修改。 * param[in] filter Filter handle.CNcomment:过滤器句柄。 * param[in] filter_attr Pointer to the attributes of a filter (input).CNcomment:指针类型,输入过滤器属性。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_ATTACHED_FILTER The attributes cannot be set dynamically, because the filter is attached * to a channel. * CNcomment:过滤器绑定在通道上,不能动态设置。 */ td_s32 uapi_dmx_set_filter_attr(td_handle filter, const uapi_dmx_filter_attr *filter_attr); /* * brief Obtains the filter criteria of a filter.CNcomment:获取过滤器的过滤条件。 * If you call the API before a filter is allocated, an error code is returned. * CNcomment:在过滤器未分配时调用该接口,返回错误。 * param[in] filter Filter handle.CNcomment:过滤器句柄。 * param[out] filter_attr Pointer to the attributes of a filter (output). For details, * see the description of ::uapi_dmx_filter_attr.CNcomment:指针类型,输出过滤器属性。请参见::uapi_dmx_filter_attr。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_filter_attr(td_handle filter, uapi_dmx_filter_attr *filter_attr); /* * brief Attaches filters to a specific channel.CNcomment:绑定过滤器到指定的通道。 * One or more filters can be attached to a general-purpose channel. All filters are ORed. * That is, if the data meets the filter criteria of a filter, the data is transmitted to the DMA buffer. * Filters cannot be attached to the audio/video channel and post channel. * If a filter is used, it cannot be attached to one or more channels repeatedly. * If a filter and a channel do not belong to the same DEMUX, the filter cannot be detached from the channel. * A filter can be attached to a general-purpose channel when the channel is enabled or disabled. * CNcomment:一个通用通道可以绑定一个或者多个数据过滤器,所有过滤器之间的过滤关系是或。 * 即只要满足其中任何一个过滤器的过滤条件,当前过滤的数据都将通过过滤而被送入DMA缓冲区 * 不支持音视频通道和POST通道的过滤器绑定 * 不能将一个过滤器重复绑定到一个或多个通道上 * 过滤器与通道不属于同一路DEMUX时,不能进行绑定操作 * 支持通用通道打开或者关闭状态下的过滤器绑定。 * param[in] filter Filter handle.CNcomment:过滤器句柄。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_ATTACHED_FILTER The filter is attached.CNcomment:过滤器已经处于绑定状态。 * retval ::SOC_ERR_DMX_NOT_SUPPORT No filter can be attached to the channel.CNcomment:此类型通道不支持绑定过滤器。 */ td_s32 uapi_dmx_attach_filter(td_handle filter, td_handle play_chan); /* * brief Detaches a filter from a specific channel.CNcomment:将过滤器从指定通道上解绑定。 * If no filter is attached to a channel, the error code TD_FAILURE is returned when you call this API. * If a filter and a channel do not belong to the same DEMUX, an error code is returned. * A filter can be detached from a general-purpose channel when the channel is enabled or disabled. * CNcomment:通道上没有绑定过滤器进行解绑定返回失败 * 过滤器与通道不属于同一路DEMUX维护时,返回错误 * 支持通用通道打开或者关闭状态下的过滤器解绑定。 * param[in] filter Filter handle.CNcomment:过滤器句柄。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NOATTACH_FILTER No filter is attached to any channel.CNcomment:filter没有绑定在任何通道上。 * retval ::SOC_ERR_DMX_UNMATCH_FILTER No filter is attached to the channel.CNcomment:filter没有绑定在此通道上。 */ td_s32 uapi_dmx_detach_filter(td_handle filter, td_handle play_chan); /* * brief Obtains the handle of the channel to which a filter is attached.CNcomment:获取过滤器所绑定的通道句柄。 * Each filter corresponds to a channel. If a filter is not attached to a channel, the error code * SOC_ERR_DMX_NOATTACH_FILTER is returned. * CNcomment:每个过滤器唯一对应一个通道。若过滤器没有绑定任何到通道上,则返回SOC_ERR_DMX_NOATTACH_FILTER错误码。 * param[in] filter Filter handle.CNcomment:过滤器句柄。 * param[out] play_chan Pointer to the handle of the channel to which a filter is attached (output). * CNcomment:指针类型,输出过滤器绑定的通道句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_NOATTACH_FILTER No filter is attached to any channel.CNcomment:filter没有绑定在任何通道上。 */ td_s32 uapi_dmx_get_filter_play_chan_handle(td_handle filter, td_handle *play_chan); /* * brief Obtains the number of available filters of a DEMUX.CNcomment:获取DEMUX设备可用的空闲过滤器数量。 * The number of unallocated filters is returned. * The filters that are allocated but not attached to channels are excluded. * CNcomment:返回当前未分配的过滤器数目,已分配但未绑定到通道上的过滤器不统计。 * param[in] dmx_id DEMUX ID. CNcomment: DEMUX号。 * param[out] free_count Pointer to the number of allocated filters (output). * CNcomment:指针类型,输出当前未分配的过滤器数目。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_free_filter_count(td_u32 dmx_id, td_u32 *free_count); /* * brief Obtains the handles of all channels that receive new data.CNcomment:获取有新数据到达的所有通道的句柄。 * When you call this API, the parameter play_chan_num serves as the input parameter and is used to specify * the data length pointed by play_chan. play_chan_num indicates the number of channels to be queried. * The number of channels must be initialized, and the initial value cannot be 0. * It is recommended to set the number of channels to the total number. For details about the total number of channels. * After you call this API successfully, the parameter play_chan_num serves as the output parameter and is used to * specify the valid data length of play_chan array. * The block time is configurable (in ms). If timeout_ms is set to 0, it indicates that the block time is 0; * if timeout_ms is set to 0xFFFFFFFF, it indicates infinite wait. * If no data is received when the block time is exceeded, the error code SOC_ERR_DMX_TIMEOUT is returned. * If the wait time is 0, and no data is received in any channel, ::SOC_ERR_DMX_NOAVAILABLE_DATA is returned. * CNcomment:调用该接口时,play_chan_num作为输入参数,用于指定play_chan数组的长度,表示要查询的通道个数; * 通道个数必须初始化,且初始值必须为非0值 * 建议将通道个数设置为通道的总个数 * 当该接口调用成功时,play_chan_num作为输出参数,指定play_chan指向数组的有效长度 * 阻塞时间可以设置,时间单位为毫秒,设置为0不等待,设置为0xffffffff一直等待。 * 若超过阻塞时间,所有通道都没有数据到达,则返回等待超时错误 * 如果等待时间为0,而且没有任何通道有数据则返回::SOC_ERR_DMX_NOAVAILABLE_DATA。 * param[out] play_chan Pointer to the number of channels. * The number of channels depends on the value of play_chan_num. * CNcomment:指针类型,指向通道句柄数组。数组长度由play_chan_num决定。 * param[in] play_chan_num Pointer type * Input: indicates the number of channel handles to which play_chan points. * Output: indicates the number of lower-layer channels that receive new data. * The maximum value cannot be greater than the input value. * CNcomment: 指针类型。注意:该参数同时作为输入和输出。 * CNcomment: 输入:play_chan指向数组的长度。 * CNcomment: 输出:底层有新数据通道的数目;最多不超过输入的数值。 * param[in] timeout_ms Wait timeout, in ms.CNcomment:等待超时时间,单位ms。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_NOAVAILABLE_DATA No data is received in any channel.CNcomment:没有任何通道有数据到达。 * retval ::SOC_ERR_DMX_TIMEOUT The wait times out.CNcomment:等待超时。 * retval ::SOC_ERR_DMX_NOT_OPEN_CHAN No opened channels.CNcomment:没有可用的通道。 */ td_s32 uapi_dmx_get_data_handle(td_handle play_chan[], td_u32 *play_chan_num, td_u32 timeout_ms); /* * brief Obtains whether data is received in some channels.CNcomment:查询部分通道是否有数据到达。 * This API is a supplementary interface of ::uapi_dmx_get_data_handle. You can call this API when you only want * to check whether data is received in some channels. * The handles of the channels to be queried are specified by watch_play_chan, and the number of channels to be queried * is specified by watch_num. * If watch_play_chan is NULL, all channels are queried. The value of watch_num cannot be 0. * The block time is configurable (in ms). If timeout_ms is set to 0, it indicates that the block time is 0; * if timeout_ms is set to 0xFFFFFFFF, it indicates infinite wait. * If no data is received when the block time is exceeded, the error code SOC_ERR_DMX_TIMEOUT is returned. * If the wait time is 0, and no data is received in any channel, ::SOC_ERR_DMX_NOAVAILABLE_DATA is returned. * CNcomment:用来作为::uapi_dmx_get_data_handle的补充,当应用中只关注部分通道的数据到达情况时使用此接口 * 被监视通道的句柄由watch_play_chan指定,个数由watch_num指定 * watch_play_chan为NULL,查询所有通道的数据到达情况,watch_num必须为非0值 * 阻塞时间可以设置,时间单位为毫秒,设置为0不等待,设置为0xffffffff一直等待。 * 若超过阻塞时间,所有通道都没有数据到达,则返回等待超时错误 * 如果等待时间为0,而且没有任何通道有数据则返回::SOC_ERR_DMX_NOAVAILABLE_DATA。 * param[in] watch_play_chan Pointer to the number of handles of the channels to be queried. * The number depends on the value of watch_num. * CNcomment:指针类型,指向被监视通道的句柄数组。数组长度有watch_num决定。 * param[in] watch_num Number of channels to be queried.CNcomment:监视通道的个数。 * param[in] data_channel Pointer to the number of handles of the channels that contain data. * The number depends on the value of chn_num. * CNcomment:指针类型,指向存在数据的通道的句柄数组。数组长度有chn_num决定。 * param[out] chn_num Pointer to the number of lower-layer channels that receive new data. * The maximum value cannot be greater than the input value. * CNcomment:指针类型。底层有新数据通道的数目;最多不超过被监视的通道的数值。 * param[in] timeout_ms Wait timeout, in ms.CNcomment:等待超时时间,单位ms。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null.CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_NOAVAILABLE_DATA No data is received in any channel.CNcomment:没有任何通道有数据到达。 * retval ::SOC_ERR_DMX_TIMEOUT The wait times out.CNcomment:等待超时。 */ td_s32 uapi_dmx_select_data_handle(td_handle watch_play_chan[], td_u32 watch_num, td_handle *data_chan, td_u32 *chn_num, td_u32 timeout_ms); /* * brief Obtains the received data packets from a specific channel.CNcomment:从指定通道中获取输出的数据包。 * Before calling this API, you need to set the value of acquire_num to specify the maximum number of buffers that * can be queried. The number of buffers depends on the value of acquire_num. * The value of acquired_num is not greater than that of acquire_num. * For the Section channel, ECM channel, or EMM channel, each data packet contains a complete Section. * For the PES channel, each data packet may contain a complete PES. If the PES is too large, * it is divided into multiple PES packets to transfer. * The data_type field determines whether a transferred data packet is complete. * For the post channel, each data packet may contain one or more complete TS packets. * Each TS packet consists of 188 bytes. * For the audio/video channel, data cannot be obtained by calling this API. * The audio data and video data are transferred to the decoder through internal interfaces. * You cannot call this API repeatedly, but you can call this API once and release buffers for several times. * Note that you must release buffers in sequence, and the address and size of the buffer to be released must be * consistent with those obtained by calling uapi_dmx_acquire_buffer. * In addition, you can call uapi_dmx_acquire_buffer again only after all data packets are released. * Otherwise, the error code SOC_ERR_DMX_REACQUIRE_BUF is returned. * CNcomment:在调用本接口之前,给acquire_num赋值,指定允许查询的缓冲区信息最大数目。 * 消息缓冲区数组的长度由acquire_num决定 * 实际获取的缓冲区信息数目acquired_num数值不会超过acquire_num * 对于section通道和ECM/EMM通道,每个数据包包含一个完整的section * 对于PES通道,每个数据包尽量包含完整的pes,但是如果pes太大,可能要分多个pes包输出, * 输出的数据是否完整通过数据包结构的data_type字段指定 * 对于POST类型的通道,每个数据包包含一个或多个完整的TS包,TS包长188字节 * 对于音视频通道是不能通过此接口获取数据的,音视频数据会通过内部接口直接送给解码器进行解码 * 不允许重复调用此接口,可以一次请求多次释放,但是释放必须按顺序,而且释放的地址和长度必须和请求的一致 * 并且只有释放完所有的数据包才能再次请求,否则返回重复请求错误码。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * param[in] acquire_num Maximum number of obtained data packets.CNcomment:请求的数据包的最大个数。 * param[out] acquired_num Pointer to the actual number of obtained data packets. * CNcomment:指针类型,输出实际请求到的数据包个数。 * param[out] buffer Pointer to the number of data packets. The number depends on the value of acquired_num. * CNcomment:指针类型,指向数据包信息数组,数组个数由acquired_num决定。 * param[in] timeout_ms Wait timeout, in ms.CNcomment:等待超时时间,单位为ms。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_NOAVAILABLE_DATA There is no valid data in the channel.CNcomment:通道中没有有效数据。 * retval ::SOC_ERR_DMX_TIMEOUT The wait times out.CNcomment:等待超时。 * retval ::SOC_ERR_DMX_REACQUIRE_BUF The data packet has been obtained.CNcomment:重复请求数据包。 */ td_s32 uapi_dmx_acquire_buffer(td_handle play_chan, td_u32 acquire_num, td_u32 *acquired_num, uapi_dmx_data *buffer, td_u32 timeout_ms); /* * brief Releases the buffers for storing data packets after data packets are processed. * CNcomment:处理完数据包的数据后,释放数据包占用的缓冲空间。 * If you release buffers by calling this API, the buffers must be those obtained by calling * ::uapi_dmx_acquire_buffer, and the addresses and sizes of these buffers cannot be changed. * The number of released buffers can be less than the number of obtained buffers. * CNcomment:本接口释放的缓冲区一定是通过::uapi_dmx_acquire_buffer获取的缓冲区,缓冲区的地址和长度不能更改 * 释放的缓冲区个数可以小于获取的缓冲区个数。 * param[in] play_chan Channel handl.CNcomment:通道句柄。 * param[in] release_num Number of released buffers.CNcomment:释放数据包个数。 * param[in] buffer Pointer to the number of released buffers. The number depends on the value * of u32ReleaseNum. * CNcomment:指针类型,指向释放缓冲区信息数组,长度由u32ReleaseNum决定。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_release_buffer(td_handle play_chan, td_u32 release_num, const uapi_dmx_data *buffer); /* * brief Obtains the received es data packets from a specific channel.CNcomment:从指定通道中获取输出的es数据包。 * You can call this API to obtain video or audio es data. * It's allowed to call repeatedly and then release in the same order. * CNcomment:音视频通道通过此接口获取es数据. * 允许重复调用此接口获取有效数据,然后按相同顺序释放。 * param[in] play_chan Channel handle.CNcomment:通道句柄。 * param[out] es_buffer Pointer to the es data packets.CNcomment:指针类型,指向es数据包。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_NOAVAILABLE_DATA There is no valid data in the channel。CNcomment:通道中没有有效数据。 */ td_s32 uapi_dmx_acquire_es(td_handle play_chan, uapi_es_buf *es_buffer); /* * brief Releases the es buffers after processed.CNcomment:处理完es数据包的数据后,释放数据包所在buffer。 * If you release buffers by calling this API, the buffers must be those obtained by calling ::uapi_dmx_acquire_es, * and the addresses and sizes of these buffers cannot be changed. * CNcomment:本接口释放的缓冲区一定是通过::uapi_dmx_acquire_es获取的缓冲区,缓冲区的地址和长度不能更改. * param[in] play_chan Channel handl.CNcomment:通道句柄。 * param[in] es_buffer Pointer to the es data packets.CNcomment:指针类型,指向es数据包。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_release_es(td_handle play_chan, const uapi_es_buf *es_buffer); /* * brief Creates a record channel. CNcomment: 创建一个录制通道。 * A demux can be set only one recording channe. * CNcomment: 一个DEMUX上只能创建一个录制通道。 * param[in] rec_attr record attribute. CNcomment: 录制属性。 * param[out] rec_chan record handle. CNcomment: 录制句柄。 * retval ::TD_SUCCESS Success. CNcomment: 成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment: 模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment: 输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment: 指针参数为空。 * retval ::SOC_ERR_DMX_NOFREE_CHAN There is no available channel. CNcomment: 没有空闲的通道。 * retval ::SOC_ERR_DMX_ALLOC_MEM_FAILED memory allocate failure. CNcomment: 内存分配失败。 * retval ::SOC_ERR_DMX_MMAP_FAILED memory map failed. CNcomment: 内存映射失败。 */ td_s32 uapi_dmx_create_rec_chan(const uapi_dmx_rec_attr *rec_attr, td_handle *rec_chan); /* * brief Destroys an existing record channel. CNcomment: 销毁创建的录制通道。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * retval ::TD_SUCCESS Success. CNcomment: 成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment: 模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment: 输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment: 指针参数为空。 */ td_s32 uapi_dmx_destroy_rec_chan(td_handle rec_chan); /* * brief Attach demux handle and releated secure buffer to session manager. * CNcomment:将demux句柄及相应安全buffer绑定到 session manager。 * The demux handle should be rec channel handle. * CNcomment:此处demux句柄为录制通道句柄。 * param[in] rec_chan RecChan handle. CNcomment:录制通道句柄。 * param[in] ssm_handle Session manager handle. CNcomment:session manager句柄。 * param[in] type buffer attach type. CNcomment:buffer绑定类型。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 */ td_s32 uapi_dmx_rec_chan_attach_ssm(td_handle rec_chan, td_handle ssm_handle, uapi_dmx_buffer_attach_type type); /* * brief if the type of record were the UAPI_DMX_REC_TYPE_SELECT_PID, it would increase the recorded PID that we need. * CNcomment: 录制类型为UAPI_DMX_REC_TYPE_SELECT_PID时增加需要录制的PID。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * param[in] pid pid value. CNcomment: PID值。 * param[out] pid_chan pid channel handle指针. CNcomment: pid通道句柄指针。 * retval ::TD_SUCCESS Success. CNcomment: 成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment: 模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment: 输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment: 指针参数为空。 * retval ::SOC_ERR_DMX_NOT_SUPPORT This function is not supported. CNcomment: 不支持此功能。 */ td_s32 uapi_dmx_add_rec_pid(td_handle rec_chan, td_u32 pid, td_handle *pid_chan); /* * brief if the type of record were the UAPI_DMX_REC_TYPE_SELECT_PID, it would delete increase PID. * CNcomment: 录制类型为UAPI_DMX_REC_TYPE_SELECT_PID时删除已增加的PID。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * param[in] pid_chan pid channel handle. CNcomment: pid通道句柄。 * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_del_rec_pid(td_handle rec_chan, td_handle pid_chan); /* * brief if the type of record were the UAPI_DMX_REC_TYPE_SELECT_PID, it would delete all increase PID. * CNcomment: 录制类型为UAPI_DMX_REC_TYPE_SELECT_PID时删除所有已增加的PID。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_del_all_rec_pid(td_handle rec_chan); /* * brief Starts a recording channel. CNcomment: 启动录制通道。 * when the recording channel has been activated, it should use the interface to come back success. * CNcomment: 在录制通道已启动的状态下调用本接口返回成功。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_start_rec_chan(td_handle rec_chan); /* * brief Stops a recording channel. CNcomment: 停止录制通道。 * when the recording channel has been stopped, it should use the interface to come back success. * CNcomment: 在录制通道已停止的状态下调用本接口返回成功。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_stop_rec_chan(td_handle rec_chan); /* * brief Obtains record data. CNcomment: 获取录制数据。 * The obtained data must use the ::uapi_dmx_release_rec_data function to release. * CNcomment: 调用本接口获取到的数据必须使用::uapi_dmx_release_rec_data接口进行释放。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * param[out] rec_data record data. CNcomment: 录制数据。 * param[in] timeout_ms Wait timeout, in ms. CNcomment: 等待超时时间,单位为毫秒。 * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_acquire_rec_data(td_handle rec_chan, uapi_dmx_rec_data *rec_data, td_u32 timeout_ms); /* * brief Releases record data. CNcomment: 释放获取到的录制数据。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * param[in] rec_data record data. CNcomment: 录制数据。 * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_release_rec_data(td_handle rec_chan, const uapi_dmx_rec_data *rec_data); /* * brief Obtains index data. CNcomment: 获取索引数据。 * when indexing video or audio, it would use the interface to gain indexing data, or it will not support if you return. * CNcomment: 音频或视频索引时才能获取索引数据,否则返回不支持。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * param[in] acquire_num Number of indexes requested. CNcomment: 请求的索引数量 * param[in] acquired_num Number of indexes received. CNcomment: 收到的索引数量 * param[out] rec_index index data. CNcomment: 索引数据。 * param[in] timeout_ms Wait timeout, in ms. CNcomment: 等待超时时间,单位为毫秒。 * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_NOT_START_REC_CHAN CNcomment: 录制通道未启动。 * retval ::SOC_ERR_DMX_NOT_SUPPORT This function is not supported. CNcomment: 不支持此功能。 * retval ::SOC_ERR_DMX_NOAVAILABLE_DATA no data. CNcomment: 无数据。 * retval ::SOC_ERR_DMX_TIMEOUT The wait times out. CNcomment:等待超时。 */ td_s32 uapi_dmx_acquire_rec_index(td_handle rec_chan, td_u32 acquire_num, td_u32 *acquired_num, uapi_dmx_rec_index *rec_index, td_u32 timeout_ms); /* * brief Obtains index and rec data with synchronous. CNcomment: 同步获取索引和录制数据 。 * 1. when indexing video or audio, it would use the interface to gain indexing data and * record TS data with synchronous. * 2. when recording all ts without index, .it would use the interface to gain only record TS data, * as there is no index. * 3. Length of each block of record data is Alligned with 188 and 16 if it is not 0. * CNcomment: * 1. 音频或视频索引时,可以获取索引数据和与之对应的录制TS数据 * 2.如果是allts 录制,则只可以获取录制的TS数据,此时无索引数据 * 3. 获取上来的每一个数据块的长度如果不为0,都是188 与 16 对齐的。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * param[out] rec_data_idx index and record data. CNcomment: 索引数据和录制TS数据。 * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_DMX_NOT_START_REC_CHAN CNcomment: 录制通道未启动。 * retval ::SOC_ERR_DMX_NOT_SUPPORT This function is not supported. CNcomment: 不支持此功能。 * retval ::SOC_ERR_DMX_NOAVAILABLE_DATA no data. CNcomment: 无数据。 */ td_s32 uapi_dmx_acquire_rec_data_and_index(td_handle rec_chan, uapi_dmx_rec_data_index *rec_data_idx); /* * brief Releases record data. CNcomment: 释放获取到的索引数据和录制数据。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * param[in] rec_data_idx record data and index. CNcomment: 录制数据和索引数据。 * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 * retval ::SOC_ERR_MDX_REC_BUFNOTMATCH The param is not mattched . CNcomment:参数不匹配,例如释放的地址或者长度非法。 */ td_s32 uapi_dmx_release_rec_data_and_index(td_handle rec_chan, const uapi_dmx_rec_data_index *rec_data_idx); /* * brief Obtains the status of a record buffer. CNcomment: 获取录制缓存的状态。 * param[in] rec_chan record handle. CNcomment: 录制句柄。 * param[out] buffer_status record buffer status. CNcomment: 录制缓存的状态。 * retval ::TD_SUCCESS Success. CNcomment:成功。 * retval ::TD_FAILURE Calling this API fails. CNcomment:API系统调用失败。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized. CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_get_rec_buffer_status(td_handle rec_chan, uapi_dmx_rec_buf_status *buffer_status); /* * brief register channel callback .CNcomment:注册通道回调。 * param[in] chan Channel handle. CNcomment:通道Handle。 * param[out] cb_desc Pointer to the descriptor of a specified cb. For details, see the description of * uapi_dmx_cb_desc. * CNcomment:指针类型,输出指定通道 回调描述信息。请参见::uapi_dmx_cb_desc。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid.CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_register_callback(td_handle chan, const uapi_dmx_cb_desc *cb_desc); /* * brief unregister channel callback.CNcomment:注销通道回调。 * param[in] chan Channel handle.CNcomment:通道句柄。 * retval ::TD_SUCCESS Success.CNcomment:成功。 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化。 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法。 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空。 */ td_s32 uapi_dmx_unregister_callback(td_handle chan); /* * brief Set or get the extra attributes of a demux through the commands.CNcomment:通过命令设置或获取DMX附加属性 * Diffrent CMD use diffrent param, for details see the description of uapi_dmx_invoke_type. * CNcomment:不同的命令使用的参数不同,具体信息请参考命令枚举的定义uapi_dmx_invoke_type * param[in] cmd_type Command type. CNcomment:命令类型。 * param[in] cmd_para Pointer to command param. CNcomment:命令参数 * retval ::TD_SUCCESS Success.CNcomment:成功 * retval ::TD_FAILURE Calling this API fails.CNcomment:API系统调用失败 * retval ::SOC_ERR_DMX_NOT_INIT The DEMUX module is not initialized.CNcomment:模块没有初始化 * retval ::SOC_ERR_DMX_INVALID_PARA The input parameter is invalid. CNcomment:输入参数非法 * retval ::SOC_ERR_DMX_NULL_PTR The pointer is null. CNcomment:指针参数为空 */ td_s32 uapi_dmx_invoke(uapi_dmx_invoke_type cmd_type, const td_void *cmd_para); #ifdef __cplusplus #if __cplusplus } #endif #endif #endif /* __UAPI_DEMUX_H__ */