📄 psfdemux_common.h
字号:
/* * * Copyright (c) Sigma Designs, Inc. 2006. All rights reserved. * *//** @file psfdemux_common.h @brief common part of play_psfdemux @author Aurelia Popa-Radu @ingroup dccsamplecode*/#ifndef __PSFDEMUX_COMMON_H__#define __PSFDEMUX_COMMON_H__#define USING_LIBRMARIB 0#define ALLOW_LIBRMARIB ((USING_LIBRMARIB) && (EM86XX_MODE==EM86XX_MODEID_STANDALONE) && (EM86XX_CHIP == EM86XX_CHIPID_TANGO2) )//#define WITH_TIME_SHIFT /* pat, pmt and video, audio, pcr are saved as TS in output 8 *///#define RECORD_AV_TS /* video, audio, are saved as TS in output 8 *//**************************** compiling options ******************************/#if ((EM86XX_CHIP==EM86XX_CHIPID_TANGO2) && (EM86XX_REVISION > 3))#define USE_HW_FIXED_PID_ENTRY /* enable the PAT, CAT hardware filters instead of pid entries in the Pid Bank.*///#define USE_HW_PCR_PID_ENTRY /* enable the PCR hardware filter instead of pcr pid entries in the Pid Bank.*/#else/* EM8622 doesn't have PAT, CAT, PCR hw filters. Use the pid entries in the Pid Bank.*/#endif// identifier for the type of pid entry; it could be used also to identify the output where the data will be dumped#define PAT_PID_ENTRY 0#define PMT_PID_ENTRY 1#define VIDEO_PID_ENTRY 2#define AUDIO_PID_ENTRY 3#define PCR_PID_ENTRY 4#define CAT_PID_ENTRY 5#define ECM0_PID_ENTRY 6#define ECM1_PID_ENTRY 7#define BIFS_PID_ENTRY 10#define OD_PID_ENTRY 11#define TTX_PID_ENTRY 12#define RECIPHER_PID_ENTRY 13#ifdef MULTI2_EIGHT_KEYS#define DATA_ENTRY 9#define DATA_OUT 13#define DATA_SEC 8#endif // output masks for transport stream - where the pid data is saved to.#define TIME_SHIFT_FILE_NAME "8.out" /* generic name for the recorded file*/#define RECORD_OUTPUT_MASK (1 << 8) // output 8#define REPLICATED_AUDIO_OUTPUT_MASK (1 << 9) // output 9#define RECIPHER_FILE_NAME "recipher.ts" /* generic name for the recorded file*/#if defined (WITH_TIME_SHIFT) /*pat, pmt and video, audio, pcr are saved as TS in output 8 */#define REC_CNT 32#define MAX_RECORD_FILE_SIZE 0x80000000 /* 2GB */#define PAT_OUTPUT_MASK ((1 << PAT_PID_ENTRY) | RECORD_OUTPUT_MASK) // output 0, 8#define PMT_OUTPUT_MASK ((1 << PMT_PID_ENTRY) | RECORD_OUTPUT_MASK) // output 1, 8#define VIDEO_OUTPUT_MASK ((1 << VIDEO_PID_ENTRY) | RECORD_OUTPUT_MASK) // output 2, 8#define AUDIO_OUTPUT_MASK ((1 << AUDIO_PID_ENTRY) | REPLICATED_AUDIO_OUTPUT_MASK | RECORD_OUTPUT_MASK) // output 3, 9, 8#define PCR_OUTPUT_MASK ((1 << PCR_PID_ENTRY) | RECORD_OUTPUT_MASK) // output 4, 8#elif defined (RECORD_AV_TS) /* video, audio are saved as TS in output 8 */#define REC_CNT 32#define MAX_RECORD_FILE_SIZE 0x08000000 /* 128MB */#define PAT_OUTPUT_MASK (1 << PAT_PID_ENTRY) // output 0#define PMT_OUTPUT_MASK (1 << PMT_PID_ENTRY) // output 1#define VIDEO_OUTPUT_MASK ((1 << VIDEO_PID_ENTRY) | RECORD_OUTPUT_MASK) // output 2, 8#define AUDIO_OUTPUT_MASK ((1 << AUDIO_PID_ENTRY) | REPLICATED_AUDIO_OUTPUT_MASK | RECORD_OUTPUT_MASK) // output 3, 9, 8#define PCR_OUTPUT_MASK (1 << PCR_PID_ENTRY) // output 4#else /* no record in output 8 */#define REC_CNT 0#define MAX_RECORD_FILE_SIZE 0x08000000 /* 128MB */#define PAT_OUTPUT_MASK (1 << PAT_PID_ENTRY) // output 0#define PMT_OUTPUT_MASK (1 << PMT_PID_ENTRY) // output 1#define VIDEO_OUTPUT_MASK (1 << VIDEO_PID_ENTRY) // output 2#define AUDIO_OUTPUT_MASK ((1 << AUDIO_PID_ENTRY) | REPLICATED_AUDIO_OUTPUT_MASK) // output 3, 9#define PCR_OUTPUT_MASK (1 << PCR_PID_ENTRY) // output 4#endif#define CAT_OUTPUT_MASK (1 << CAT_PID_ENTRY) // output 5#define ECM0_OUTPUT_MASK (1 << ECM0_PID_ENTRY) // output 6#define ECM1_OUTPUT_MASK (1 << ECM1_PID_ENTRY) // output 7#define BIFS_OUTPUT_MASK (1 << BIFS_PID_ENTRY) // output 10#define OD_OUTPUT_MASK (1 << OD_PID_ENTRY) // output 11#define TTX_OUTPUT_MASK (1 << TTX_PID_ENTRY) // output 12#define RECIPHER_OUTPUT_MASK (1 << RECIPHER_PID_ENTRY) // output 13// identifier of the entry in match section table#define PAT_SECTION_ENTRY 0#define PMT_SECTION_ENTRY 1#define DSM_CC_SECTION_ENTRY 2#define CAT_SECTION_ENTRY 3#define ECM0_SECTION_ENTRY 4#define ECM1_SECTION_ENTRY 5#define BIFS_SECTION_ENTRY 6#define OD_SECTION_ENTRY 7#define PAT_SECTION_MASK (1 << PAT_SECTION_ENTRY)#define PMT_SECTION_MASK (1 << PMT_SECTION_ENTRY)#define DSM_CC_SECTION_MASK (1 << DSM_CC_SECTION_ENTRY)#define CAT_SECTION_MASK (1 << CAT_SECTION_ENTRY)#define ECM0_SECTION_MASK (1 << ECM0_SECTION_ENTRY)#define ECM1_SECTION_MASK (1 << ECM1_SECTION_ENTRY)#define BIFS_SECTION_MASK (1 << BIFS_SECTION_ENTRY)#define OD_SECTION_MASK (1 << OD_SECTION_ENTRY)#define MAX_DESCRIPTOR_NUMBER 5#define MAX_STREAM_NUMBER 100#define MAX_PROGRAM_NUMBER 30#define LOG2_4k 12#define LOG2_32k 15#define TS_FLAGS ( EMHWLIB_IGNORE_CONTINUITY_COUNTER_ERROR | EMHWLIB_IGNORE_ERROR_INDICATOR )#if defined(WITH_AACS)#define MAX_SP 6#define PACKET_SIZE 192#define AACS_IBC_CMD_MT 2#define AACS_IBC_CMD_PLAY_ITEM 4#define AACS_IBC_CMD_CACHE_CLIP 8#endifstruct PATInfo_type { RMuint32 count; /* number of programs in this PAT */ RMuint16 program_number[MAX_PROGRAM_NUMBER]; RMuint16 program_map_pid[MAX_PROGRAM_NUMBER]; RMuint8 version_number_current_next_indicator; /* version_number on bit 5..1, current_next_indicator on bit 0 */};struct PMTInfo_type { RMuint32 count; /* number of streams in this program */ RMuint16 stream_type[MAX_STREAM_NUMBER]; RMuint16 elementary_pid[MAX_STREAM_NUMBER]; RMuint16 stream_descriptor[MAX_STREAM_NUMBER][MAX_DESCRIPTOR_NUMBER]; RMuint32 descriptor_count[MAX_STREAM_NUMBER]; RMuint32 es_ecm_count; /* number of es ECMs in this program */ RMuint16 es_ecm_pid[MAX_STREAM_NUMBER]; /* for an elementary */ RMuint16 es_ca_system_id[MAX_STREAM_NUMBER]; /* for an elementary */ RMuint32 ecm_count; /* for whole program */ RMuint16 ecm_pid[MAX_STREAM_NUMBER]; /* for whole program */ RMuint16 ca_system_id[MAX_STREAM_NUMBER]; /* for whole program */ RMuint16 pcr_pid; RMuint16 program_number; RMuint8 version_number_current_next_indicator; /* version_number on bit 5..1, current_next_indicator on bit 0 */ RMbool update; RMbool mp4; /* dmb mp4 related fields */ RMuint16 bifsID; RMuint16 bifsPid; RMuint16 odID; RMuint16 odPid; RMuint16 mp4VideoID; RMuint16 mp4VideoPid; RMuint16 mp4AudioID; RMuint16 mp4AudioPid;};struct ESPidList_type { RMuint32 index; /* current index in the stream list */ RMuint16 pcr_pid; RMuint32 count; /* number of streams in this program */ RMuint16 stream_type[MAX_STREAM_NUMBER]; RMuint16 elementary_pid[MAX_STREAM_NUMBER]; RMuint16 es_ecm_pid[MAX_STREAM_NUMBER]; /* for an elementary */};struct DataPidList_type { RMuint32 index; // current entry, RMuint32 count; // number of data streams in the list RMuint32 share_ecm; // if 1, all data pid share the same ecm pid ecm_pids[0] RMuint16 data_pid_entries[MAX_STREAM_NUMBER]; // pid table entry number RMuint16 elementary_pids[MAX_STREAM_NUMBER]; // pid number for data streams RMuint16 ecm_pid_entries[MAX_STREAM_NUMBER]; // pid table entry number for associated ecm RMuint16 ecm_pids[MAX_STREAM_NUMBER]; // pid number for ecm streams RMuint16 cipher_indices[MAX_STREAM_NUMBER]; // which index in context->cipher_index[] to use};struct section_context_type { RMuint32 state; RMuint16 length; RMuint32 crc; RMbool private_section_with_crc;};#define VideoTypeToString(x) \ (x == 1)?"mpeg 1 video":\ (x == 2)?"mpeg 2 video":\ (x == 0x10)?"mpeg 4 video":\ (x == 0x1b)?"h264 video":\ (x == 0xea)?"vc1 video":"unknown"/* (x == 0x80)?"wsnet video":"unknown" */ #define AudioTypeToString(x) \ (x == 3)?"mpeg 1 audio":\ (x == 4)?"mpeg 2 audio":\ (x == 6)?"dts audio":\ (x == 0x0f)?"aac adts audio":\ (x == 0x80)?"hdmv_lpcm audio":\ (x == 0x81)?"ac3 audio":\ (x == 0xe6)?"wmats audio":\ (x == 0x82)?"dts audio":\ (x == 0x83)?"dolby lossless audio":\ (x == 0x84)?"dolby digital plus audio":\ (x == 0x85)?"dts hd audio":\ (x == 0x11)?"latm":"unknown"#define WAIT_KEY() \{ \ RMascii key; \ fprintf(stderr, "press key to continue\n"); \ while ( !(RMGetKeyNoWait(&key)) ); \} \#define WAIT_KEY_CLEANUP() \{ \ RMascii key; \ fprintf(stderr, "press key to continue or quit\n"); \ while ( !(RMGetKeyNoWait(&key)) ); \ if( key == 'q' || key == 'Q' ) \ goto cleanup; \} \ typedef void (*psfCallback) (RMuint8 *pBuffer1, RMuint32 size1, RMuint8 *pBuffer2, RMuint32 size2, RMstatus err, RMuint32 mask, void *context);/* We have different types of applications, selectable in command line: -app psf = pid_filter_section,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -