You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1990 lines
133 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* 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.<CNcomment:sync信号在47头 */
UAPI_DMX_SYNC_MAX
} uapi_dmx_tag_sync_mode;
/* TS Tag attributes.CNcomment: TS Tag 配置属性 */
#define MAX_TAG_LENGTH 12
typedef struct {
uapi_dmx_port ts_source; /* [IN]Source of this Tag port, can choose from UAPI_DMX_PORT_TSI_XX.
* CNcomment:Tag 端口数据源,可以从UAPI_DMX_PORT_TSI_XX中选择
*/
td_bool enable; /* [IN & OUT]Port state(default disabled), which is an input para when setTagAttr,
* otherwise out para when getTagAttr.
* CNcomment:端口使能(默认不使能),setTagAttr时作为输入参数,getTagAttr时作为输出参数
*/
uapi_dmx_tag_sync_mode sync_mode; /* [IN & OUT]Sync mode(default UAPI_DMX_TAG_HEAD_SYNC),
* which is an input para when setTagAttr, otherwise out para when getTagAttr
* CNcomment:同步模式(默认值为UAPI_DMX_TAG_HEAD_SYNC ),
* setTagAttr时作为输入参数,getTagAttr时作为输出参数
*/
td_u32 tag_len; /* [IN & OUT]Valid tag length(1 ~ 12bytes), which is an input para when
* setTagAttr, otherwise out para when getTagAttr.
* CNcomment:有效tag长度(1~12字节),setTagAttr时作为输入参数,
* getTagAttr时作为输出参数
*/
td_u8 tag[MAX_TAG_LENGTH]; /* [IN]tag index value.CNcomment:端口的tag值 */
} uapi_dmx_tag_attr;
/* TS out port attributes.CNcomment:TS Out 端口属性 */
typedef struct {
td_bool enable; /* Port enable, default value TD_TRUE means enable.
* CNcomment:端口使能,默认使能
*/
uapi_dmx_port ts_source; /* Source of this TS Out port, can choose from UAPI_DMX_PORT_IF_0 to
* UAPI_DMX_PORT_TSI_9.
* CNcomment:TS Out 端口数据源,可以从UAPI_DMX_PORT_IF_0 到
* UAPI_DMX_PORT_TSI_9 之间选择
*/
td_bool clk_reverse; /* Clock phase reverse, default value TD_FALSE means do not
* reverse the phase of clock.
* CNcomment:端口时钟反向,默认不反向
*/
uapi_dmx_tso_clk_mode clk_mode; /* Clock mode: UAPI_DMX_TSO_CLK_MODE_NORMAL is the default value.
* CNcomment:时钟模式: 默认值为 UAPI_DMX_TSO_CLK_MODE_NORMAL
*/
uapi_dmx_tso_valid_mode valid_mode; /* Wether valid signal always enable : UAPI_DMX_TSO_VALID_ACTIVE_OUTPUT
* is the default value.
* CNcomment:Valid 模式: 默认值为:UAPI_DMX_TSO_VALID_ACTIVE_OUTPUT
*/
td_bool bit_sync; /* The sync signal duration : TD_TRUE: only valid when output the first
* bit(default). TD_FALSE: keep when outputing the whole byte
* CNcomment:sync 信号有效期 : TD_TRUE: 只在输出第一个bit时有效 (默认).
* TD_FALSE: 在输出整个字节时都有效
*/
uapi_dmx_port_type port_type; /* Port out put mode: serial(UAPI_DMX_PORT_TYPE_SERIAL),
* parallel(UAPI_DMX_PORT_TYPE_PARALLEL_BURST) or serial 2bits
* (UAPI_DMX_PORT_TYPE_SERIAL2BIT) mode.
* default is serial(UAPI_DMX_PORT_TYPE_SERIAL)
*/
/* CNcomment:TSO模块输出模式:串行(UAPI_DMX_PORT_TYPE_SERIAL)
* 并行(UAPI_DMX_PORT_TYPE_PARALLEL_BURST)或者
* 串行2bit(UAPI_DMX_PORT_TYPE_SERIAL2BIT)模式。
* 默认是串行(UAPI_DMX_PORT_TYPE_SERIAL)
*/
uapi_dmx_tso_serial_bit bit_selector; /* Port line sequence select In serial mode.only valid when using serial out
* put mode,UAPI_DMX_TSO_SERIAL_BIT_7 is the default value.
* CNcomment:端口串行模式线序选择,只有使用串行输出模式的时候有效,
* 默认值为 UAPI_DMX_TSO_SERIAL_BIT_7
*/
td_bool lsb; /* Out put byte endian .only valid when using serial out put mode:
* TD_FALSE: first output MSB (default). TD_TRUE: first output LSB
* CNcomment:端口输出大小端模式,只有使用串行输出模式的时候有效:
* TD_FALSE: 首先输出最高位 (默认) . TD_TRUE: 首先输出最低位
*/
uapi_dmx_tso_clk clk; /* TS out mode clock frequency, default is UAPI_DMX_TSO_CLK_150M.
* CNcomment:TS输出模块时钟频率,默认是 UAPI_DMX_TSO_CLK_150M
*/
td_u32 clk_div; /* TS out mode clock frequency divider, must be times of 2,
* and must meet (2 <= u32ClkDiv <= 32) .default is 2.
* CNcomment:TSO模块分频因子,必须是2的整数倍,取值范围在2与32之间
*/
} uapi_dmx_tso_port_attr;
/* TS port attributes.CNcomment:TS端口属性 */
typedef struct {
uapi_dmx_port_type port_type; /* Port type.CNcomment:端口类型 */
td_u32 sync_lost_threshold; /* Sync loss threshold.The default value is recommended.
* CNcomment:同步丢失门限,推荐使用默认值
*/
td_u32 sync_lock_threshold; /* Sync lock threshold.The default value is recommended.
* CNcomment:同步锁定门限,推荐使用默认值
*/
td_u32 serial_bit_selector; /* Port line sequence select.
* In parallel mode: 0:cdata[7] is the most significant bit(MSB) (default)
* 1: cdata[0] is the MSB.
* In serial mode: 1:cdata[0] is the data line (default).
* 0:cdata[7] is the data line.
* CNcomment:端口线序选择。并行时:0: 表示cdata[7]最高位(默认);
* 1: 表示cdata[0]最高位。
* 串行时:1: 表示cdata[0]为数据线(默认); 0: 表示cdata[7]为数据线
*/
uapi_dmx_port serial_port_share_clk; /* Port of clock that this port shared, only valid for TSI port tpye.
* CNcomment:指定该端口所复用时钟的对应端口该成员仅对TSI端口类型有效
*/
td_bool frontend_clk_mode; /* Frontend Clock Mode, the configure must be sync with Tuner,
* 0: single edge-triggered, 1: double edge-triggered.
* CNcomment:Frontend输入时钟边沿选择必须和frontend配置一致默认为0
* 单沿触发.0: 单沿触发; 1: 双沿触发
*/
td_bool frontend_clk_inverse; /* Whether to reverse the phase of the clock input from the frontend.
* CNcomment:Frontend输入时钟是否反相.0: 同相(默认); 1: 反相
*/
td_bool frontend_err_mode; /* Level mode of the cerr_n line from the tuner to a DEMUX.
* 0: A data error occurs when the cerr_n line is high.
* 1: A data error occurs when the cerr_n line is low (default).
* CNcomment:tuner到DEMUX的cerr_n线电平模式:
* 0: 表示cerr_n线为高时表示数据错误;
* 1: 表示cerr_n线为低时表示数据错误 (默认)
*/
td_u32 user_def_len1; /* User defined length1, valid when enPortType is
* UAPI_DMX_PORT_TYPE_USER_DEFINED,188~255.
* CNcomment:用户自定义长度检测包长1只有端口类型为用户自定义时有效
* 有效范围188~255
*/
td_u32 user_def_len2; /* User defined length2, valid when enPortType is
* UAPI_DMX_PORT_TYPE_USER_DEFINED,188~255.
* CNcomment:用户自定义长度检测包长2只有端口类型为用户自定义时有效
* 有效范围188~255
*/
} uapi_dmx_port_attr;
/* Status of the TS port. CNcomment:TS端口的状态 */
typedef struct {
td_u32 ts_pack_cnt; /* Number of TS packets received from the TS port.CNcomment:端口收到的TS包计数 */
td_u32 err_ts_pack_cnt; /* Number of error TS packets received from the TS port.CNcomment:端口上错误TS包的计数 */
td_u32 ts_sync_byte_err_cnt; /* Number of sync byte error TS packets received from the TS port.
* CNcomment:端口接收到非法传输同步字节的TS包计数
*/
td_u32 ts_sync_loss_cnt; /* Number of sync loss TS packets received from the TS port.
* CNcomment:端口接收到同步丢失的TS包计数
*/
td_u32 ts_pack_drained_cnt; /* Number of Drained TS packets received from the TS port.
* CNcomment:端口成功获取到的合法TS包计数
*/
td_u32 pack_dis_cc_cnt; /* Number of Discontinuity TS packets received from the TS port.
* CNcomment:解扰后端口收到的不连续错误TS包计数
*/
td_u32 pack_dis_cc_cnt_ca; /* Number of Discontinuity TS packets received before descrambler from the TS port,
* the value is same as u32PackDisCCCnt.
* CNcomment: 解扰前进入端口的TS包不连续错误次数,值与u32PackDisCCCnt一致
*/
} uapi_dmx_port_packet_num;
/* Secure mode type.CNcomment:安全模式类型 */
typedef enum {
UAPI_DMX_SECURE_MODE_REE = 0, /* <no security protection.CNcomment:无安全保护 */
UAPI_DMX_SECURE_MODE_TEE, /* <trustedzone security protection.CNcomment:trustedzone安全保护 */
UAPI_DMX_SECURE_MODE_MAX
} uapi_dmx_secure_mode;
/* TS buffer attribute. CNcomment:TS buffer 属性 */
typedef struct {
uapi_dmx_secure_mode secure_mode; /* Secure indication.CNcomment:安全标示 */
td_u32 buffer_size; /* Buffer size.CNcomment:缓冲区大小 */
} uapi_dmx_ts_buffer_attr;
/* Status of a TS buffer of a DEMUX.CNcomment:DEMUX的TS Buffer状态 */
typedef struct {
td_u32 buffer_size; /* Buffer size.CNcomment:缓冲区大小 */
td_u32 used_size; /* Used buffer size.CNcomment:缓冲区已使用大小,该值比实际使用值大0x100字节 */
uapi_dmx_secure_mode secure_mode; /* Secure indication.CNcomment:安全标示 */
td_u32 hardware_used_size; /* Hardware Used Buffer Size, used for special scene.
* CNcomment:硬件当前正在使用的buffer大小特殊场景使用
* 外部客户不需要关心
*/
} uapi_dmx_ts_buffer_status;
/* Channel type.CNcomment:通道类型 */
typedef enum {
UAPI_DMX_CHAN_TYPE_SEC = 0, /* Channel that receives sections data such as program specific information (PSI) or
* service information (SI) data.
* CNcomment:用于接收 PSI/SI等secitons数据的通道
*/
UAPI_DMX_CHAN_TYPE_PES, /* Channel that receives packetized elementary stream (PES) data.
* CNcomment:用于接收PES包数据的通道
*/
UAPI_DMX_CHAN_TYPE_AUD, /* Channel that receives audio data.
* CNcomment:用于接收音频数据的通道
*/
UAPI_DMX_CHAN_TYPE_VID, /* Channel that receives video data.
* CNcomment:用于接收视频数据的通道
*/
UAPI_DMX_CHAN_TYPE_POST, /* Entire-packet posting channel that receives an entire TS packet with a specific
* packet identifier (PID).
* CNcomment:整包上送通道用于接收某PID的完整TS包
*/
UAPI_DMX_CHAN_TYPE_MAX
} uapi_dmx_chan_type;
/* Cyclic redundancy check (CRC) mode of a channel.CNcomment:通道的CRC模式 */
typedef enum {
UAPI_DMX_CHAN_CRC_MODE_FORBID = 0, /* The CRC check is disabled.CNcomment:CRC校验禁止 */
UAPI_DMX_CHAN_CRC_MODE_FORCE_AND_DISCARD = 1, /* The CRC check is enabled, and the error Section data is discarded
* CNcomment:CRC校验使能并丢弃错误Section
*/
UAPI_DMX_CHAN_CRC_MODE_FORCE_AND_SEND = 2, /* The CRC check is enabled, and the error Section data is received.
* CNcomment:CRC校验使能并上送错误Section
*/
UAPI_DMX_CHAN_CRC_MODE_MAX
} uapi_dmx_chan_crc_mode;
/* Channel attribute.CNcomment:通道属性 */
typedef struct {
td_u32 buffer_size; /* Buffer size used by channels.CNcomment:通道硬件使用buffer大小 */
uapi_dmx_chan_type chan_type; /* Channel type.CNcomment:通道类型 */
uapi_dmx_chan_crc_mode crc_mode; /* CRC mode.It is valid for the DEMUX_CHAN_SEC channel.
* CNcomment:CRC模式通道类型为DMX_CHAN_SEC 时有效
*/
uapi_dmx_secure_mode secure_mode; /* Secure channel indication.CNcomment:安全通道标示 */
} uapi_dmx_chan_attr;
/* Scrambled flag of the channel data.CNcomment:通道数据的加扰标志 */
typedef enum {
UAPI_DMX_SCRAMBLED_FLAG_TS, /* TS data is scrambled.CNcomment:数据被TS级加扰 */
UAPI_DMX_SCRAMBLED_FLAG_PES, /* PES data is scrambled.CNcomment:数据被PES级加扰 */
UAPI_DMX_SCRAMBLED_FLAG_NO, /* Data is not scrambled.CNcomment:数据未被加扰 */
UAPI_DMX_SCRAMBLED_FLAG_MAX
} uapi_dmx_scrambled_flag;
/* Defines the channel status.CNcomment:定义通道状态结构体 */
typedef struct {
td_bool is_opened; /* Channel is open or closed.CNcomment:通道打开还是关闭 */
td_u32 ts_cnt; /* TS packet CountCNcomment: 视频通道TS包计数 */
td_u32 cc_disc_cnt; /* CC Discontinuity CountCNcomment:CC不连续计数 */
} uapi_dmx_chan_status;
/* Filter attribute.CNcomment:过滤器属性 */
typedef struct {
td_u32 filter_depth; /* Depth of a filter..CNcomment:过滤器深度 */
td_u8 match[DMX_FILTER_MAX_DEPTH]; /* Matched bytes of a filter.The data is compared by bit.
* CNcomment:过滤器匹配字节,按bit比较
*/
td_u8 mask[DMX_FILTER_MAX_DEPTH]; /* Masked bytes of a filter. The conditions are set by bit.
* 0: no mask. Comparison is required. 1: mask. Comparison is not required.
* CNcomment:过滤器屏蔽字节,按bit设置, 0:没有mask要进行比较,
* 1:mask起作用不进行比较 */
td_u8 negate[DMX_FILTER_MAX_DEPTH]; /* Negated bytes of a filter. 0: not negated; 1: negated.
* CNcomment:过滤器取反字节,按byte设置, 0:不取反,1:取反
*/
} uapi_dmx_filter_attr;
/* Type of the DEMUX data packet..CNcomment:DEMUX数据包的类型 */
typedef enum {
UAPI_DMX_DATA_TYPE_WHOLE = 0, /* The data segment contains a complete data packet.
* CNcomment:此段数据包含完整的数据包, 对于SECTION每个包都是完整的
*/
UAPI_DMX_DATA_TYPE_HEAD, /* The data segment contains the head of a data packet,
* but the data packet may not be complete.
* CNcomment:此段数据包含数据包的起始,但是不一定是完整的包, 只用于PES数据
*/
UAPI_DMX_DATA_TYPE_BODY, /* This type is valid only for the PES data.The data segment contains the body
* of a data packet.
* CNcomment:此段数据包含数据包的内容,不包含起始,可能有结尾, 只用于PES数据
*/
UAPI_DMX_DATA_TYPE_TAIL, /* This type is valid only for the PES data.The data segment contains the tail
* of a data packet, and is used to identify the end of a data packet.
* CNcomment:此段数据包含数据包的结尾,用于指示可识别的包结束, 只用于PES数据
*/
UAPI_DMX_DATA_TYPE_MAX
} uapi_dmx_data_type;
/* DEMUX data packet.CNcomment:DEMUX数据包结构 */
typedef struct {
td_u8 *data; /* Data pointer.CNcomment:数据指针 */
td_u32 size; /* Data length.CNcomment:数据长度 */
uapi_dmx_data_type data_type; /* Data packet type.CNcomment:数据包的类型 */
} uapi_dmx_data;
/* type of record.CNcomment: 录制类型 */
typedef enum {
UAPI_DMX_REC_TYPE_SELECT_PID, /* Record selected pid ts data.CNcomment: 录制指定PID TS数据 */
UAPI_DMX_REC_TYPE_ALL_PID, /* Record all pid ts data.CNcomment: 录制全码流TS数据 */
UAPI_DMX_REC_TYPE_ALL_DATA, /* Record raw data,TLV etc.CNcomment: 录制原始数据如TLV等 */
UAPI_DMX_REC_TYPE_MAX
} uapi_dmx_rec_type;
/* type of index.CNcomment: 索引类型 */
typedef enum {
UAPI_DMX_REC_INDEX_TYPE_NONE, /* No index is created.CNcomment: 不建索引 */
UAPI_DMX_REC_INDEX_TYPE_VIDEO, /* Video index .CNcomment: 视频索引 */
UAPI_DMX_REC_INDEX_TYPE_AUDIO, /* Audio index .CNcomment: 音频索引 */
UAPI_DMX_REC_INDEX_TYPE_MAX
} uapi_dmx_rec_index_type;
/* TS stream type..CNcomment: ts码流的类型 */
typedef enum {
UAPI_DMX_TS_PACKET_188, /* ts stream packet size of 188 bytes.CNcomment: ts码流包大小为188字节 */
UAPI_DMX_TS_PACKET_192, /* ts stream packet size of 192 bytes.CNcomment: ts码流包大小为192字节 */
UAPI_DMX_TS_PACKET_MAX
} uapi_dmx_ts_packet_type;
/* buffer attach type..CNcomment: buffer对接类型 */
typedef enum {
UAPI_DMX_BUFFER_ATTACH_TYPE_TSR2RCIPHER, /* tsr2rcipher encrypt/decrypt.CNcomment: tsr2rcipher加解密 */
UAPI_DMX_BUFFER_ATTACH_TYPE_CIPHER, /* cipher encrypt/decrypt.CNcomment: cipher加解密 */
UAPI_DMX_BUFFER_ATTACH_TYPE_MAX
} uapi_dmx_buffer_attach_type;
/* record attribute.CNcomment: 录制属性 */
typedef struct {
td_u32 dmx_id;
td_u32 rec_buf_size; /* Buffer size used by recordCNcomment: 录制缓存大小 */
uapi_dmx_rec_type rec_type; /* Record typeCNcomment: 录制类型 */
td_bool descramed; /* TD_TRUE is the descrambled TS. TD_FALSE is the original TS.
* CNcomment: TD_TRUE表示录制解扰后的TS流TD_FALSE表示录制原始流
*/
uapi_dmx_rec_index_type index_type; /* Index typeCNcomment: 索引类型 */
td_u32 index_src_pid; /* The index information is formed according to the PID.
* when indexing video, it has to be set to the video of PID.
* when indexing audio, it has to be set to the audio of PID.
* CNcomment: 根据此PID生成索引数据视频索引时设置为视频的PID
* 音频索引时设置为音频的PID
*/
uapi_vcodec_type video_codec_type; /* Video encoding protocol. The protocol needs to be set only when
* the index type is UAPI_DMX_REC_INDEX_TYPE_VIDEO.
* CNcomment: 视频索引时设置视频的编码类型
*/
uapi_dmx_secure_mode secure_mode; /* Secure record indication.CNcomment:安全录制标示 */
uapi_dmx_ts_packet_type ts_packet_type; /* TS stream type of recorded TS.UAPI_DMX_TS_PACKET_192 is not
* supported for full stream recording.
* CNcomment: 录制生成文件中码流的TS类型。全码流录制时不支持
* UAPI_DMX_TS_PACKET_192
*/
} uapi_dmx_rec_attr;
/* record data.CNcomment: 录制数据 */
typedef struct {
td_u8 *data_addr; /* Data address .CNcomment: 数据地址 */
td_u32 len; /* Data length .CNcomment: 数据长度 */
td_bool last_data_flag; /* Last Data Flag.CNcomment: 最后数据包标记 */
td_mem_handle buf_handle; /* Es Buffer handle.CNcomment: Es Buffer句柄 */
} uapi_dmx_rec_data;
/* index data.CNcomment: 索引数据 */
typedef struct {
uapi_video_frame_type frame_type; /* it is meaningless when indexing audio.CNcomment: 音频索引时无意义 */
td_s64 pts_us;
td_u64 global_offset;
td_u32 frame_size; /* it is meaningless when indexing audio.CNcomment: 音频索引时无意义 */
td_u32 data_time_ms;
} uapi_dmx_rec_index;
/* index and record data.CNcomment: 索引数据和录制数据 */
typedef struct {
td_u32 index_num; /* Number of index.CNcomment: 索引数据个数 */
td_u32 rec_data_count; /* Number of record data block.
* CNcomment: 录制数据块个数,一般为1个只有在当前录制数据一部分在录制buffer尾部
* 一部分在头部的时候会分成两个block 分别获取上来
*/
uapi_dmx_rec_index index[DMX_MAX_IDX_ACQUIRED_EACH_TIME];
uapi_dmx_rec_data rec_data[DMX_MAX_REC_DATA_PARTS]; /* Recorded data can be reported in 2 parts at most.
* CNcomment: 录制数据最多分成两个block上报
*/
} uapi_dmx_rec_data_index;
/* record buffer status.CNcomment: 录制缓冲区状态结构 */
typedef struct {
td_u32 buffer_size; /* Buffer size.CNcomment:缓冲区大小 */
td_u32 used_size; /* Used buffer.CNcomment:缓冲区已使用大小 */
} uapi_dmx_rec_buf_status;
/* Repeat CC mode of channel.CNcomment:通道的CC重复模式 */
typedef enum {
UAPI_DMX_CHAN_CC_REPEAT_MODE_RSV = 0x0, /* Receive CC repeat ts packet.CNcomment:接收cc重复的ts包 */
UAPI_DMX_CHAN_CC_REPEAT_MODE_DROP = 0x1, /* Drop CC repeat ts packet.CNcomment:丢弃cc重复的ts包 */
UAPI_DMX_CHAN_CC_REPEAT_MODE_MAX = 0xFF
} uapi_dmx_chan_cc_repeat_mode;
typedef struct {
td_handle chan; /* The channel handle.CNcomment:通道句柄 */
uapi_dmx_chan_cc_repeat_mode cc_repeat_mode; /* Repeat CC mode of channel.CNcomment:通道的CC模式 */
} uapi_dmx_chan_cc_repeat_set;
/* PUSI (Payload Unit Start Index) config structure.CNcomment: PUSI 配置结构体 */
typedef struct {
td_bool pusi; /* Value of Pusi, Default is TD_FALSE means receive ts packet without checking PUSI.
* CNcomment:NoPusiEn 的值,默认为 TD_FALSE 表示接收TS包的时候不检测PUSI标志
*/
} uapi_dmx_pusi_set;
/* TEI (Transport Error Index) config structure.CNcomment: TEI 配置结构体 */
typedef struct {
td_u32 dmx_id; /* The Subdiviece ID.CNcomment:Demux 子设备ID */
td_bool tei; /* Value of bTei, Default is TD_FALSE means receive ts packet even TEI equal 1.
* CNcomment:TEICfg 的值,默认为 TD_FALSE 表示接收TEI为1 的 TS包仍然接收
*/
} uapi_dmx_tei_set;
typedef enum {
UAPI_DMX_INVOKE_TYPE_CHAN_CC_REPEAT_SET = 0, /* dmx set channel extra attr, param:uapi_dmx_chan_cc_repeat_set.
* CNcomment:设置通道附加属性使用参数uapi_dmx_chan_cc_repeat_set
*/
UAPI_DMX_INVOKE_TYPE_PUSI_SET, /* dmx set PUSI flag, param:uapi_dmx_pusi_set.
* CNcomment: 设置 NoPusiEn 标志使用参数uapi_dmx_pusi_set
*/
UAPI_DMX_INVOKE_TYPE_TEI_SET, /* dmx set TEI flag, param:uapi_dmx_tei_set.
* CNcomment:设置Demux 子设备TEICfg 标志使用参数uapi_dmx_tei_set
*/
UAPI_DMX_INVOKE_TYPE_TSI_ATTACH_TSO, /* Attach TSI with TSO, param:TSI_ATTACH_TSO.
* CNcomment: 将TSI 与 某个 TSO 绑定,即: TSI 的码流来自 TSO
* 使用参数uapi_dmx_tei_set
*/
UAPI_DMX_INVOKE_TYPE_MAX
} uapi_dmx_invoke_type;
/* Define cb context type.CNcomment:定义回调上下文的类型 */
typedef enum {
UAPI_DMX_CB_CONTEXT_TYPE_SHARED = 0, /* public shared context thread.CNcomment:共享的公共上下文 */
UAPI_DMX_CB_CONTEXT_TYPE_PRIVATE, /* private context thread.CNcomment:私有上下文 */
UAPI_DMX_CB_CONTEXT_TYPE_MAX
} uapi_dmx_cb_context_type;
/* Declare section/pes/post cb function interface.CNcomment:声明section/pes/post通道的回调函数接口 */
typedef td_s32 (*uapi_dmx_chan_buf_cb_func)(td_handle chan, td_u32 acquire_num, uapi_dmx_data *buffer,
td_void *user_data, td_u32 user_data_len);
/* Define cb descriptor.CNcomment:定义回调描述信息 */
typedef struct {
uapi_dmx_cb_context_type context_type; /* cb context type.CNcomment:回调上下文类型 */
uapi_dmx_chan_buf_cb_func chan_buffer_cb; /* section/pes/post cb function.
* CNcomment:section/pes/post通道回调函数
*/
td_void *user_data; /* user private data.CNcomment:用户私有信息 */
td_u32 user_data_len; /* user data length.CNcomment:用户信息长度> */
} 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大小的配置默认大小为16Kbuffer大小的单位为字节
* 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__ */