⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 psfdemux_common.h

📁 Sample code for use on smp 863x processor.
💻 H
📖 第 1 页 / 共 3 页
字号:
	RMuint32		key_index[16];  /* max 16 key entries used in current application */	RMuint32		key_count;      /* number of key entries used in current application */	void			*pkey_table;	/* key table defined by this application */	RMuint32		key_table_size;	/* number of keys in the table defined by this application */	RMuint32		key_size;	/* size of the key */	enum EMhwlibVideoCodec  vcodec;         /* storage needed to uninit/init after demux connect */	RMbool                  enable_spu;     /* spu_hack needed because DCC interface has no independent spu support */		RMfile			file;	RMint64			fileSize;	RMstatus		file_status;	RMuint32		file_byte_counter;	RMuint8			*buf;	RMbool			buffer_used;	RMbool			send_inband;	RMuint32		nTimes;		struct playback_cmdline *play_opt;	struct display_cmdline  *disp_opt;	struct video_cmdline    *video_opt;	struct audio_cmdline    *audio_opt;	struct demux_cmdline    *demux_opt;	struct audio_cmdline    *audio_opt_table;	RMuint32                audioInstances;	RMuint32                wait_eos_state; /* used as state machine to detect when all EOS events per task came */	RMuint32                ts_skip;	RMbool			pat;            /* TRUE when a new PAT is found */	RMbool			cat;	RMbool			ecm;	RMbool			pmt;            /* TRUE when a new PMT is found */	enum change_program_type change_program_method; /* */	RMuint32		pmt_index;      /* index of the current PMT in the pat_info */	RMuint32		av_flags;       /* value used to mark if the application program the video audio from commnad line */	RMuint16		video_pid;	RMuint16                od_pid;         /* od pid number for DMB playback, needed by demux video data */	RMuint16		pcr_pid;	RMuint16		audio_pid;	RMuint16		audio_subid;    /* needed for PES */	RMuint16		spu_subid;      /* needed for PES parsing */ 	RMuint32		emm_pid; 	RMuint32		ecm_pid[MAX_STREAM_NUMBER];	RMuint16		teletext_pid;#ifndef USE_HW_FIXED_PID_ENTRY 	RMuint32		pat_pidentry;   /* index of the PAT pid entry allocated in hw pid table */	RMuint32		cat_pidentry;	/* index of the CAT pid entry allocated in hw pid table	*/#endif	RMuint32		pmt_pidentry;   /* index of the PMT pid entry allocated in hw pid table */	RMuint32		video_pidentry; /* index of the video pid entry allocated in hw pid table */	RMuint32		audio_pidentry; /* index of the audio pid entry allocated in hw pid table */	RMuint32		pcr_pidentry;   /* index of the PCR pid entry allocated in hw pid table */ 	RMuint32		ecm_pidentry[MAX_STREAM_NUMBER];	/* index of the ecm video entry allocated in hw pid table	*/	RMuint32		teletext_pidentry; /* index of the ttx pid entry allocated in hw pid table */	struct PATInfo_type     pat_info; 	struct CATInfo_type	cat_info;	struct PMTInfo_type     pmt_info[MAX_PROGRAM_NUMBER];	struct ESPidList_type   VideoPidList;	struct ESPidList_type   AudioPidList;	struct ESPidList_type   TeletextPidList;	struct DataPidList_type DataPidList;	struct arib_key_band    arib_key_table[16];	/* EVEN/ODD key	*/	RMuint8			prev_encrypted_key[16];	RMuint32		recipher_mode;          /* mode=0 no recipher; mode >=1 recipher */ 	RMuint32		recipher_cipher_entry;  /* entry in cipher table used for encryption */	RMuint32		recipher_even_key_index;	RMuint32		recipher_odd_key_index;	RMuint8			recipher_even_key[32];	RMuint8			recipher_odd_key[32];	RMuint8			recipher_iv[32];	RMuint32		recipher_xpu_key;  /* commandline key index for key stored in xpu */#if (EM86XX_CHIP != EM86XX_CHIPID_TANGO2)	RMuint8			current_ecm_key;#endif	FILE                    *stcd;         /* file used for stc_compensation */#ifdef WITH_AACS	RMuint32 		aacs_xtask_pid; /* PID of AACS xtask */	RMuint32 		aacs_context;	/* Context for AACS xtask */	RMuint32		mt_spn[MAX_SP]; /* SPN for all SPs */	RMuint32 		mt_index;	/* Current IbC */	RMuint32		mt_enabled;	/* Mt enabled */	RMuint32		sk_enabled;	/* Segment Key enabled */	RMuint32		sk_plid;		/* PlayList ID */	RMuint32		sk_item;		/* PLayItem ID */	RMuint32		clip_id;			/*Clip_id*/	RMuint32		dir;				/*Dir*/	RMuint32		cahce_clip_enabled; /*cache clip enabled*/#endif /* WITH_AACS */#ifdef MULTICAST	RMsocket multicastSocket; /* used by play_psfdemux_multicast */	RMuint32 nMulticastStreams;	RMuint32 MulticastCurrent;	enum AudioDecoder_Codec_type MulticastACodec[MAX_MULTICAST_STREAMS];	enum VideoDecoder_Codec_type MulticastVCodec[MAX_MULTICAST_STREAMS];	enum MPEG_Profile MulticastMPEGProfile[MAX_MULTICAST_STREAMS];	char *MulticastAddress[MAX_MULTICAST_STREAMS];	unsigned long MulticastPort[MAX_MULTICAST_STREAMS];#endif/* ############## AES_CBC_PRECIPHER CODE BEGIN ############ */	RMbool dtcpip_streaming;	RMbool test_aes_precipher;/* ############## AES_CBC_PRECIPHER CODE END  ############# */	RMbool monitor;	RMuint64 readSpeed;	RMuint64 readTime;	RMuint32 tries;	RMuint32 bitrate;	RMuint64 meanBitrate;	RMuint32 meanCount;	RMbool isTrickMode;	RMbool isIFrameMode;	RMbool isRewinding;	RMbool FirstSystemTime;	RMbool sendVideoData;	RMbool sendAudioData;	RMbool sendVideoPTS;	RMbool sendAudioPTS;	struct timeval last;	RMuint64 lastSTC;	RMuint32 audioDemuxOutputIndex[MAX_AUDIO_DECODER_INSTANCES];	RMuint32 videoDemuxOutputIndex;	RMuint32 pcr_disc; /* threshold in ms for PCR discontinuity */	enum EMhwlibTransportPriority_type audio_ts_priority;	RMuint32		section_filter_based_on_new_version;	RMuint32 prebuf_level;	void **dmabuffer_array;	RMuint32 dmabuffer_index;	RMuint32 VCXOModuleID;};enum key_type {	WRONG_KEY,	PAIR_KEY,	EVEN_KEY,	ODD_KEY};enum key_setup_ways {	INBAND_COMMAND,	OUTBAND_COMMAND,	XTASK_CLEAR,	XTASK_CIPHER,};/****************************** prototypes ******************************/RMstatus ParsePAT(RMuint8 *pBuffer1, RMuint32 size1, RMuint8 *pBuffer2, RMuint32 size2, struct PATInfo_type *out);RMstatus ParsePMT(RMuint8 *pBuffer1, RMuint32 size1, RMuint8 *pBuffer2, RMuint32 size2, struct PMTInfo_type *out);RMstatus ParseCAT(RMuint8 *pBuffer1, RMuint32 size1, RMuint8 *pBuffer2, RMuint32 size2, struct CATInfo_type *out);void ParseCADescriptor(RMuint8 *p, RMuint16 *ca_sys_id, RMuint16 *ecm_pid);void PATCallback(RMuint8 *pBuffer1, RMuint32 size1, RMuint8 *pBuffer2, RMuint32 size2, RMstatus err, RMuint32 mask, void *context_in);void PMTCallback(RMuint8 *pBuffer1, RMuint32 size1, RMuint8 *pBuffer2, RMuint32 size2, RMstatus err, RMuint32 mask, void *context_in);void CATCallback(RMuint8 *pBuffer1, RMuint32 size1, RMuint8 *pBuffer2, RMuint32	size2, RMstatus	err, RMuint32 mask, void *context_in);void ECMCallback(RMuint8 *pBuffer1, RMuint32 size1, RMuint8 *pBuffer2, RMuint32 size2, RMstatus err, RMuint32 mask, void *context_in);void TTXCallback(RMuint8 *pBuffer1, RMuint32 size1, RMuint8 *pBuffer2, RMuint32 size2, RMstatus err, RMuint32 mask, void *context_in); RMuint16 GetEMMPid(struct context_per_task *context, RMuint16 ca_id);RMstatus InitTableVariables(struct context_per_task *context);RMstatus DvbKeyInband(struct context_per_task *context, RMuint8 ecm_entry, enum EMhwlibScramblingBits scrambling, RMuint8 *pkey, RMuint32 key_size);RMstatus DvbKeyOutband(struct context_per_task *context, RMuint8 ecm_entry, enum EMhwlibScramblingBits scrambling, RMuint8 *pkey, RMuint32 key_size);RMstatus DvbKeyXtask(struct context_per_task *context, RMuint8 ecm_entry, enum EMhwlibScramblingBits scrambling, RMuint8 *pkey);RMstatus AESKeyInband(struct context_per_task *context, RMuint8 ecm_entry, enum EMhwlibScramblingBits scrambling, RMuint8 *pkey, RMuint8 *piv, RMuint32 key_size);RMstatus AESKeyOutband(struct context_per_task *context, RMuint8 ecm_entry, enum EMhwlibScramblingBits scrambling, RMuint8 *pkey, RMuint8 *piv, RMuint32 key_size);RMstatus Multi2KeyInband(struct context_per_task *context, RMuint32 index, enum key_type key_type);RMstatus Multi2KeyOutband(struct context_per_task *context, RMuint32 index, enum key_type key_type);/* ############## AES_CBC_PRECIPHER CODE BEGIN ############ */RMstatus AESKeyPrecipherInband(struct RUA *Context_RUA,RMuint32 Context_demux_task,enum EMhwlibScramblingBits scrambling, RMuint8 *pkey, RMuint8 *piv, RMuint32 key_size,RMuint32 inband_state);/* ############## AES_CBC_PRECIPHER CODE END ############## */RMstatus Multi2KeyXtask(struct context_per_task *context, RMuint32 index, enum key_type	key_type);RMstatus Multi2KeyXtaskEncrypted(struct context_per_task *context, RMuint32 index, enum key_type key_type);RMstatus Multi2KeySetup(struct context_per_task *context, enum key_setup_ways ways, RMuint32 index, enum key_type key_type);RMstatus InitKeyAndCipherTable(struct context_per_task *context);RMstatus FreeKeyAndCipherTable(struct context_per_task *context);RMstatus InitKeyAndCipherTableForRecipher(struct context_per_task *context);RMstatus FreeKeyAndCipherTableForRecipher(struct context_per_task *context);#ifdef USE_XPU_WRITE_KEY#include "../rmdemuxwritekey/rmdemuxwritekeyapi.h"RMstatus SetAesCbcOfbKeyThroughXPU(struct context_per_task *context, RMuint32 key_index, RMuint32 key_size );RMstatus SetRecipherKeyThroughXPU(struct context_per_task *context, union Demux_Cipher_Key *pKey, enum EMhwlibCipher cipher_type, RMuint32 key_index, RMuint32 key_sizex );#endif#if 0void DumpMulti2Key(struct DemuxTask_Multi2Key_type *multi2_key, RMuint32 c_index);void PrivateSectionCallback(RMuint8 *pBuffer1, RMuint32 size1, RMuint8 *pBuffer2, RMuint32 size2, RMstatus err, void *context);RMstatus DvbKeyXtaskEncrypted(struct context_per_task *context, enum EMhwlibScramblingBits scrambling, RMuint8 *pkey);#endif/* The properties related to receiving data from DemuxOutput modules are: - RMDemuxOutputPropertyId_Threshold affecting the demux microcode - RMGenericPropertyId_ReadBufferCompletion affecting the DMA transfer from DRAM output data fifo to the DMA buffers. If the property RMGenericPropertyID_ReadBufferCompletion is not called the DMAtransfers for DemuxOutput are set by default for backward compability:    - EMhwlibReadBufferCompletionMode_NoDelay, if data type is "access unit", as      PSI, DSM_CC, VPES, APES, RDI    - EMhwlibReadBufferCompletionMode_Full, for all the other data types. <--------------demux microcode---------><-----------DMA transfers-------------->+-----------------------+---------------+------------------------+-------------+|RMDemuxOutputPropertyId|  DemuxTask    |  RMGenericPropertyId_  |  DemuxTask  ||       _Threshold      |   events      | _ReadBufferCompletion  |  DMA event  |+-------------+---------+SOFT_IRQ_EVENT +------------+-----------+SOFT_IRQ_XFER||partial_read |threshold|    _DEMUX_    |  mode      | threshold |RECEIVE_EVENT|+-------------+---------+---------------+------------+-----------+-------------+ |   FALSE     |         |               |            |           | event when  || (threshold  |         | FILLING when  | No_Delay   | Ignored   | size >= thr1|| is used to  | thr1!=0 |  data >=thr1  | Full       | Ignored   | buffer full ||   trigger   |         |               | ExactSize  | thr2      | size == thr2||   events)   |         |               | MinSize    | thr2      | size >= thr2|+-------------+---------+---------------+------------------------+-------------+ |   TRUE      |         |  SECTION_END  |            |           | event when  || (only for   |         |   PES_END     | No_Delay   | Ignored   | size > 0    || filter of   | Ignored | when complete | Full       | Ignored   | buffer full ||sections and |         | section or PES| ExactSize  | thr2      | size == thr2||PES packets) |         |  is written   | MinSize    | thr2      | size >= thr2|+-------------+---------+---------------+------------------------+-------------+Note. From demux point of view the "partial_read" has same meaning as "disablethreshold and send data and associated interrupt only when the output has acomplete section or PES packet."*/#endif // __PLAY_PSFDEMUX_COMMON_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -