📄 psfdemux_common.h
字号:
-app dvb = dvbcsa_decryption, -app arib = multi2_decryption, -app aes0 = aes_cbc_decryption, encryption starting from start of TS payload -app aes1 = aes_ecb_decryption, encryption starting from end of TS payload -app pes = program_stream_parsing*/enum application_type { pid_filter_section, dvbcsa_decryption, multi2_decryption, aes_cbc_decryption, aes_ecb_decryption, aes_ofb_decryption, aes_ctr_decryption, aes_cfb_decryption, aes_nsa_decryption, program_stream_parsing, input_record,};struct dvb_csa_key { RMbool renew; /* TRUE when a new key is detected */ RMuint32 key_byte_counter; enum EMhwlibScramblingBits scrambling; RMuint8 key[8]; RMuint8 ecm_data[16]; /* storage for encrypted key from ecm_pid, needed to identify the clear key provided in table */ RMuint8 ecm_entry; /* for ECM0 or ECM1 */};struct aes_key { RMbool renew; /* TRUE when a new key is detected */ RMuint32 key_byte_counter; enum EMhwlibScramblingBits scrambling; RMuint8 key[16]; RMuint8 iv[16]; RMuint8 ecm_data[16]; /* storage for encrypted key from ecm_pid, needed to identify the clear key provided in table */ RMuint8 ecm_entry; /* for ECM0 or ECM1 */};/* ############## AES_CBC_PRECIPHER TEST CODE BEGIN ############### */struct aes_2keys_test { RMuint32 key_byte_counter; enum EMhwlibScramblingBits scrambling; RMuint8 key0[16]; RMuint8 iv0[16]; RMuint8 key1[16]; RMuint8 iv1[16];};/* ############## AES_CBC_PRECIPHER CODE TEST END ################# */struct dvb_arib_key { RMuint8 pair_key[16]; RMuint8 sys_key[32]; RMuint8 cbc_iv[8]; RMuint8 data[16]; RMuint32 cipher[64];};struct CATInfo_type { /* CAT packet */ RMuint32 count; /* number of CA provider & EMMs */ RMuint16 ca_system_id[MAX_STREAM_NUMBER]; RMuint16 emm_pid[MAX_STREAM_NUMBER]; RMuint8 version_number_current_next_indicator; /* version_number on bit 5..1, current_next_indicator on bit 0 */};struct MatchSectionEntry_type { struct PSFMatchSection_type section_entry; RMuint32 index; /* index allocated in section filter */};/* application specific structure based on struct EMhwlibPidEntryInfo_type */struct PidEntry_type { RMuint16 pid; /* 13 bit value */ enum EMhwlibPidInput_type input_type; RMuint32 flags; /* reserved bit field for ignore_error_indicator, ignore_continuity_counter, splicing_enable */ RMbool enable; /* if FALSE the pid entry is ignored */ RMuint32 output_mask[1]; /* 32 bit mask indicating the output buffers for this pid.*/ RMuint32 cipher_mask; /* indicates what cipher is enabled - bit mask. Only on cipher supported. */ RMuint32 cipher_index[1];/* indicates what cipher is used */ RMuint32 type; /* application use it to identify the pat, pmt, video, audio, pcr*/ RMuint32 index; /* pid entry index allocated in pid filter */};/* application specific structure based on struct EMhwlibPesEntry_type */struct PesEntry_type { RMuint8 stream_id; RMuint8 substream_id; enum EMhwlibPesInput_type input_type; RMbool enable; /* if FALSE the pes entry is ignored */ RMuint32 output_mask[1]; /* 32 bit mask indicating the output buffers for this pid.*/ RMuint32 cipher_mask; /* indicates what cipher is enabled - bit mask. Only on cipher supported. */ RMuint32 cipher_index[1];/* indicates what cipher is used */ RMuint32 index; /* index allocated in pes filter */};/* Different choices for application to receive data from one DemuxOutput.See more comments at the end of this file. */enum receive_data_mode { receive_data_dma_backward_compatible,/* backward compatibility - the new RMDemuxOutputPropertyId_ReadBufferCompletion is not called */ receive_data_dma_full_buffer, /* complete the dma buffer when it is full */ receive_data_dma_no_delay, /* complete the dma buffer as soon as the microcode sends data */ receive_data_dma_minimum_size, /* complete the dma buffer when the buffer has more than the threshold value */ receive_data_dma_exact_size, /* complete the dma buffer when the buffer has exact size of the threshold value */ receive_data_nodma_get_chunk256, /* get directly from demux output data fifo */ receive_data_nodma_rua_map /* get directly from demux output data fifo */};/* application specific structure based on DemuxOutput module properties */struct Output_type { enum EMhwlibDataType_type type; RMuint32 section_mask; /* the hardware section filter does and-logic for all sections marked with 1 in section mask */ /* number of buffers and size to allocate for DMA pool. Also in this application the DemuxOutput has bts_fifo_size = buffer_count*(1<<buffer_size_log2) */ RMuint32 buffer_count; RMuint32 buffer_size_log2; /* if partial_read is TRUE the microcode will signal event after one section/pes_packet is completed; if FALSE the event is signaled according to threshold's value */ RMbool partial_read; RMuint32 threshold; /* number of pts and inband entries for the pts and inband fifos of the DemuxOutput */ RMuint32 pts_count; RMuint32 inband_count; RMuint32 consumer_module_id; /* if 0 data will be saved in file; if not 0, the output will be consumed by specified video/audio/spu consumer */ psfCallback callback; /* variables needed for the file handle, name and maximum size of the data to be saved from this DemuxOutput */ RMascii filename[20]; FILE *f_out; RMuint32 f_out_size; /* the module id of this DemuxOutput */ RMuint32 demux_output_module_id; enum receive_data_mode receive_mode; /* default receive_data_dma_backward_compatible */ /* variables needed at close to free the memory allocated for DemuxOutput */ RMuint32 BitstreamProtectedAddr; RMuint32 UnprotectedAddr; /* variable needed for getting the data from DemuxOutput fifo with DMA transfers */ struct RUABufferPool *pDma; /* variables needed for getting the data directly from DemuxOutput fifo, without DMA transfers */ RMuint8 *pmapped_bts_fifo_base; RMuint32 fifo_container; RMuint32 bts_fifo_base; RMuint32 bts_fifo_size; FILE *f_pts_out; FILE *f_ibc_out;};/* * TODO -- * what is the best content and name of this struct */struct arib_key_band { /* * If this key is valid? */ RMbool new_key; /* * If the cipher table already setup? */ RMbool ciphertable_done; /* * Index of CipherTable */ RMuint32 index_cipher_table; /* * struct DemuxTask_Multi2Key_type * { * RMuint32 key_index; // entry of Multi2Table * RMuint8x32 system_key; // customer provide * RMuint8x32 data_key; // customer provide * RMuint8x8 iv; // customer provide * } */ struct DemuxTask_Multi2Key_type multi2_key; /* * Specifies the scrambling bits of the packets affected by the key */ enum EMhwlibScramblingBits scrambling; /* * Specifies if offset_value is used, is relative or absolute */ enum EMhwlibInbandOffset offset_control; /* * Offset in bytes */ RMuint32 offset_value; /* * CipherText of the multi2 key */ RMuint32 cipher_text[32]; /* 128bytes, 1024bits RSA */}; enum change_program_type { change_program_with_stop_all = 0, /* This method works always but data is lost at stop time. It is not good for PVR applications. */ change_program_with_av_stop, /* This method works in case the video and/or audio change codec. The method is good for PVR applications - no data lost. In order to not have freezing or skipping the programs should have either contiguos PCR values or we need to to detect the pcr discontinuity.*/ change_program_without_stop, /* This method works OK if the video and audio don't change codec. The method is good for PVR applications - no data lost. In order to not have freezing or skipping the programs should have either contiguos PCR values or we need to to detect the pcr discontinuity.*/ };struct context_per_task { RMuint32 id; RMuint32 input_port; RMuint32 sync_lock; enum DemuxSourceType SourceType; struct RUABufferPool *pDma; /* input dma pool */ struct RUA *pRUA; struct dcc_context *dcc_info;#if (ALLOW_LIBRMARIB) void *drm_handle; /* Dynamic library pointer */#endif RMuint32 demux_task; /* demux_task_moduleID */ enum application_type app_type; struct PesEntry_type *pes_table; RMuint32 pes_table_count; /* number of system strams entries used in current application */ struct PidEntry_type *pid_table; RMuint32 pid_table_count; /* number of pids used in current application */ struct Output_type *output_table; RMuint32 output_table_count;/* number of outputs used in current application */ struct MatchSectionEntry_type *match_section_table; RMuint32 match_section_table_count;/* number of sections used in current application */ RMuint32 cipher_index[8];/* max 8 cipher entries used in current application */ RMuint32 cipher_count; /* number of cipher entries used in current application */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -