filter.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:6k
- /*****************************************************************************
- File Name: filter.h
- Description: Private Section filter
- COPYRIGHT (C) 2004 STMicroelectronics
- *****************************************************************************/
- #ifndef __FILTER_H
- #define __FILTER_H
- /* Includes --------------------------------------------------------------- */
- #include "stddefs.h" /* STAPI includes */
- #include "stpti.h"
- #include "stpti_hal.h"
- /* defines ----------------------------------------------------------------- */
- typedef enum
- {
- SECTION,
- NUM_FILTERS
- };
- #define KB_FILTER_TS_SIZE 188
- #define KB_FILTER_DSS_SIZE 127
- #define KB_FILTER_BUFFER_SIZE (KB_FILTER_DSS_SIZE * KB_FILTER_TS_SIZE)
- #define KB_FILTER_SIZE 16
- /* PSI fields within section filter */
- #define KB_FILTER_TABLE_ID(_f_) (_f_[0])
- #define KB_FILTER_PROGRAM_NUM_1(_f_) (_f_[1])
- #define KB_FILTER_PROGRAM_NUM_2(_f_) (_f_[2])
- #define KB_FILTER_VERSION_NUM(_f_) (_f_[3])
- #define KB_FILTER_SECTION_NUM(_f_) (_f_[4])
- /* Data extraction macros */
- #define KB_FILTER_EXTRACT_32(_X) ((*(_X+0) << 24) |
- (*(_X+1) << 16) |
- (*(_X+2) << 8) |
- (*(_X+3) << 0))
- #define KB_FILTER_EXTRACT_24(_X) ((*(_X+0) << 16) |
- (*(_X+1) << 8) |
- (*(_X+2) << 0))
- #define KB_FILTER_EXTRACT_16(_X) ((*(_X+0) << 8) |
- (*(_X+1) << 0))
- #define KB_FILTER_EXTRACT_8(_X) (*(_X))
- #define KB_FILTER_EXTRACT_4T(_X) ((*(_X) >> 4) & 0xf)
- #define KB_FILTER_EXTRACT_4B(_X) (*(_X) & 0xf)
- /* structures ------------------------------------------------------------ */
- typedef struct _KB_FILTER
- {
- STPTI_Slot_t SlotHandle;
- STPTI_Buffer_t BufferHandle;
- STPTI_Signal_t SignalHandle;
- STPTI_Filter_t Filter;
- STPTI_FilterData_t FilterData;
- U8 FilterBytes[KB_FILTER_SIZE];
- U8 FilterMasks[KB_FILTER_SIZE];
- U8 Buffer[KB_FILTER_BUFFER_SIZE];
- } KB_FILTER;
- /* Valid Tables: */
- #define KB_FILTER_SI_VIDEO_STREAM 0x02
- #define KB_FILTER_SI_AUDIO_STREAM 0x03
- #define KB_FILTER_SI_HIERACHY 0x04
- #define KB_FILTER_SI_REGISTRATION 0x05
- #define KB_FILTER_SI_DATA_STREAM_ALIGNMENT 0x06
- #define KB_FILTER_SI_TARGET_BACKGROUND_GRID 0x07
- #define KB_FILTER_SI_VIDEO_WINDOW 0x08
- #define KB_FILTER_SI_CA 0x09
- #define KB_FILTER_SI_LANGUAGE 0x0A /* PMT */
- #define KB_FILTER_SI_SYSTEM_CLOCK 0x0B
- #define KB_FILTER_SI_MULTIPLEX_BUFFER_USAGE 0x0C
- #define KB_FILTER_SI_COPYRIGHT 0x0D /* PMT */
- #define KB_FILTER_SI_MAXIMUM_BITRATE 0x0E
- #define KB_FILTER_SI_PRIVATE_DATA_INDICATOR 0x0F
- #define KB_FILTER_SI_SMOOTHING_BUFFER 0x10
- #define KB_FILTER_SI_STD 0x11
- #define KB_FILTER_SI_IBP 0x12
- #define KB_FILTER_SI_NETWORK_NAME 0x40
- #define KB_FILTER_KB_FILTER_SI_SERVICE_LIST 0x41
- #define KB_FILTER_SI_STUFFING 0x42 /* EIT, SDT */
- #define KB_FILTER_SI_SATELLITE_DELIVERY 0x43
- #define KB_FILTER_SI_CABLE_DELIVERY 0x44
- #define KB_FILTER_SI_BOUQUET_NAME 0x47 /* SDT */
- #define KB_FILTER_SI_SERVICE 0x48 /* SDT */
- #define KB_FILTER_SI_COUNTRY_AVAILABILITY 0x49 /* SDT */
- #define KB_FILTER_SI_LINKAGE 0x4A /* EIT, SDT */
- #define KB_FILTER_SI_NVOD_REFERENCE 0x4B /* SDT */
- #define KB_FILTER_SI_TIME_SHIFTED_SERVICE 0x4C /* SDT */
- #define KB_FILTER_SI_SHORT_EVENT 0x4D /* EIT */
- #define KB_FILTER_SI_EXTENDED_EVENT 0x4E /* EIT */
- #define KB_FILTER_SI_TIME_SHIFTED_EVENT 0x4F /* EIT */
- #define KB_FILTER_SI_COMPONENT 0x50 /* EIT */
- #define KB_FILTER_SI_MOSAIC 0x51 /* SDT, PMT */
- #define KB_FILTER_SI_STREAM_IDENTIFIER 0x52 /* PMT */
- #define KB_FILTER_SI_CA_IDENTIFIER 0x53 /* EIT, SDT */
- #define KB_FILTER_SI_CONTENT 0x54 /* EIT */
- #define KB_FILTER_SI_PARENTAL_RATING 0x55 /* EIT */
- #define KB_FILTER_SI_TELETEXT 0x56 /* PMT */
- #define KB_FILTER_SI_TELEPHONE 0x57 /* EIT, SDT */
- #define KB_FILTER_SI_LOCAL_TIME_OFFSET 0x58 /* TOT */
- #define KB_FILTER_SI_SUBTITLING 0x59 /* PMT */
- #define KB_FILTER_SI_TERRESTRIAL_DELIVERY 0x5A
- #define KB_FILTER_SI_MULTILINGUAL_NETWORK_NAME 0x5B
- #define KB_FILTER_SI_MULTILINGUAL_BOUQUET_NAME 0x5C
- #define KB_FILTER_SI_MULTILINGUAL_SERVICE_NAME 0x5D /* SDT */
- #define KB_FILTER_SI_MULTILINGUAL_COMPONENT 0x5E /* EIT */
- #define KB_FILTER_SI_PRIVATE_DATA_SPECIFIER 0x5F /* EIT, SDT, PMT */
- #define KB_FILTER_SI_SERVICE_MOVE 0x60 /* PMT */
- #define KB_FILTER_SI_SHORT_SMOOTHING_BUFFER 0x61 /* EIT */
- #define KB_FILTER_SI_FREQUENCY_LIST 0x62
- #define KB_FILTER_SI_PARTIAL_TRANSPORT_STREAM 0x63
- #define KB_FILTER_SI_DATA_BROADCAST 0x64 /* EIT, SDT */
- #define KB_FILTER_SI_CA_SYSTEM 0x65 /* PMT */
- #define KB_FILTER_SI_DATA_BROADCAST_ID 0x66 /* PMT */
- typedef struct _KB_FILTERPATData
- {
- U16 PgmPid;
- U16 PmtPid;
- }KB_FILTERPATData;
- typedef struct _KB_FILTERSDTData
- {
- U16 serID;
- char ServiceName_p[50]; /* not null terminated */
- }KB_FILTERSDTData;
- /* Global ----------------------------------------------------------------- */
- extern KB_FILTER Filter[NUM_FILTERS];
- /* Prototypes ------------------------------------------------------------- */
- extern ST_ErrorCode_t KB_FilterSetup( KB_FILTER *Filter_p );
- extern ST_ErrorCode_t KB_FilterStart( KB_FILTER *Filter_p, STPTI_Pid_t Pid, U8 TableId );
- extern void KB_FilterCreate(KB_FILTER *Filter_p, U32 TableId, U32 Program, U32 Version, U32 Section);
- extern void KB_FilterPMTDump( U16 PmtPid, U16 ProgNo,U16 *pVidPid,U16 *pAudPid,U16 *pPCRPid );
- extern void KB_FilterPATDump(UINT16 serID,UINT16 *pmtPID);
- extern BOOL KB_FilterSDTDump(STTST_Parse_t *pars_p, char *Result );
- extern KB_FILTERPATData g_KB_PATData[100];
- extern KB_FILTERSDTData g_KB_SDTData[100];
- extern int g_KB_SDTLen ;
- BOOL KB_FILTERInitCommand(void);
- #endif /* __FILTER_H */
- /* EOF --------------------------------------------------------------------- */