123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899 |
- /*! \addtogroup scan
- * @{
- */
- /******************************************************************************/
- /**
- *
- * \file mid_scan.h
- *
- * \brief middle-ware of digital TV scan.
- *
- *
- * \note Copyright (c) 2008 Sunplus Technology Co., Ltd. \n
- * All rights reserved.
- *
- * \author EMI
- *
- ******************************************************************************/
- #ifndef _MID_SCAN_H_2008_03_18
- #define _MID_SCAN_H_2008_03_18
- //#include "types.h"
- //#include "config_sys.h"
- #include "mid_common.h"
- #include "dvb_dr_dvb.h"
- #include "cdbi.h"
- // scan capabilities
- #define MID_SCAN_CAPS_MAIN_SYSTEM (1<<0) ///< main DTV system
- #define MID_SCAN_CAPS_SUPPORT_NIT (1<<1) ///< additional support NIT info
- #define MID_SCAN_CAPS_SUPPORT_LCN (1<<2) ///< additional support LCN
- #define MID_SCAN_CAPS_SUPPORT_AC3 (1<<3) ///< additional support AC3
- #define MID_SCAN_CAPS_SUPPORT_CA_SYSTEM (1<<4) ///< additional support CA system
- #define MID_SCAN_CAPS_SUPPORT_TEMPORARY_SERVICE (1<<5) ///< additional support temporary service
- #define MID_SCAN_CAPS_SUPPORT_MHEG5 (1<<6) ///< additional support MHEG5
- #define MID_SCAN_CAPS_SUPPORT_DTG_CERTIFICATION (1<<7) ///< additional support DTG certification
- //BRAD 090928 MOD+ add new capability
- #define MID_SCAN_CAPS_SUPPORT_DEL_SRV_NOT_IN_SDT (1<<8) ///< additional support for removing service not in SDT
- #define MID_SCAN_CAPS_SUPPORT_ADD_SRV_IN_SDT_ONLY (1<<9) ///< additional support for keeping service only in SDT
- #define MID_SCAN_CAPS_SUPPORT_ADD_SRV_IN_SDT_PAT_ONLY (1<<10) ///< additional support for keeping service in SDT and PAT without PMT
- //BRAD MOD-
- #define MID_SCAN_CAPS_SUPPORT_LCN_VER2 (1<<11) ///< additional support LCN in LCD version 2
- #define MID_SCAN_CAPS_SUPPORT_HD_SIMUALCAST_LCN (1<<12) ///< additional support LCN in HD simulcast LCD
- //BRAD MOD+ for mantis 75250
- #define MID_SCAN_CAPS_SUPPORT_14BIT_LCN (1<<13) ///< additional support 14-bits LCN
- //BRAD MOD-
- #define MID_SCAN_CAPS_SUPPORT_EBOOK_PDSD (1<<14) ///< additional support for check private_dada_specifier_descriptor = 0x00_00_00_28
- #define MID_SCAN_CAPS_SUPPORT_NORDIG_PDSD (1<<15) ///< additional support for check private_dada_specifier_descriptor = 0x00_00_00_29
- //zhaorui 100108 added for mantis 76788 +
- #define MID_SCAN_CAPS_SUPPORT_MULTI_SERVICE_NAME (1<<16) ///< additional support multilingual service name //zhaorui 100108 added
- //zhaorui 100108 added end -
- #define MID_SCAN_CAPS_SUPPORT_ONE_SEG (1<<17) //added for Brazil for support oneseg scan
- #define MID_SCAN_CAPS_SUPPORT_COUNTRY_AVAILABILITY (1<<18) ///< additional support country availability descriptor //zhaorui 100925 add for mantis 0105229
- /* add by william.lee @2011/1/25 for support DVB-C */
- #define MID_SCAN_CAPS_SUPPORT_DVB_T (1<<19)
- #define MID_SCAN_CAPS_SUPPORT_DVB_C (1<<20)
- #define MID_SCAN_CAPS_SUPPORT_DVB_S (1<<21)
- /* add end */
- #define MID_SCAN_CAPS_SUPPORT_DYNAMIC_PDSD (1<<22) ///< DVB-C, dynamic check the PDSD(private_dada_specifier_descriptor) //junluo 20110825 add for Orion DVB_C spec
- #define MID_SCAN_CAPS_SUPPORT_DVB_SBTVD (1<<23)
- #define MID_SCAN_CAPS_SUPPORT_NO_CHECK_PDSD (1<<24)
- /* Scan T2 if DVB-T in current freq failed */
- #define MID_SCAN_CAPS_SUPPORT_DVB_T2_IMMEDIATE (1 << 25)
- /* After Scanning all DVB-T channel, the failed ones will be scaned by T2 */
- #define MID_SCAN_CAPS_SUPPORT_DVB_T2_LATER (1 << 26)
- /*parser TP after one TP found */
- #define MID_SCAN_CAPS_SUPPORT_BLIND_SCAN_METHOD_1 (1 << 27)
- /*parser TPs after all TP found */
- #define MID_SCAN_CAPS_SUPPORT_BLIND_SCAN_METHOD_2 (1 << 28)
- #define MID_SCAN_CAPS_SUPPORT_NORDIG_CERTIFICATION (1<<29) ///< additional support NRODIG certification
- #define MID_SCAN_CAPS_SUPPORT_NIT_SCAN (1 << 30) ///< additional support receive all NIT info zhongbaoxing added @20130307
- /*parser TP after some TP found */
- #define MID_SCAN_CAPS_SUPPORT_BLIND_SCAN_METHOD_3 (1 << 31)
- #define MID_SCAN_CAPS_EXT_SUPPORT_ASTRA_LCN (1 << 0) //support DVB-S ASTRA LCN
- #define MID_SCAN_CAPS_EXT_SUPPORT_DRA_AUDIO (1 << 1)// support DTMB DRA AUDIO STREAM
- #define MID_SCAN_CAPS_EXT_SCAN_ONLY_NIT_OTHER (1 << 2) // Some operators ,e.g. YouSee, might use only NITother and omit NITactual during NIT scan
- #define MID_SCAN_CAPS_EXT_SUPPORT_KDG_LCN (1 << 3) // support DVB-C KDG LCN
- #ifdef CONFIG_SUPPORT_FAST_SCANNING
- #define MID_SCAN_CAPS_EXT_SUPPORT_M7_FAST_SCAN (1 << 4)
- #define MAX_FST_BAD_TIME 1000 ///< 1000ms, FST delay time
- #define MAX_FNT_BAD_TIME 1000 ///< 1000ms, FNT delay time
- #endif
- #define MID_SCAN_CAPSEX_SUPPORT_CHECK_LCNV2_PDSD (1 << 5)
- /* End define */
- #define SCAN_THREAD_DELAY_TIME 10 ///< 10ms, the delay time decision is depend with the following max PSI bad times
- #define MAX_PAT_BAD_TIME 1000 ///From 500msec change to 1000msec, < 500ms, PAT delay time
- #define MAX_SDT_BAD_TIME 800 ///< 800ms, SDT delay time
- //[kiwi 20080730] modify MAX_NIT_BAD_TIME value from 800 -> 1500
- /* modify by kun.li @2011/6/9 */
- #if 0
- #define MAX_NIT_BAD_TIME 1500 ///< 1500ms, NIT delay time
- #else
- #define MAX_NIT_BAD_TIME 1300
- #endif
- /* modify end */
- #define MAX_CAT_BAD_TIME 500 ///< 500ms, CAT delay time
- #define MAX_BAT_BAD_TIME 1000///< 1000ms, BAT delay time
- #define MAX_PMT_BAD_TIME 500 ///< 500ms, PMT delay time
- #ifdef SUPPORT_ASTRA_LCN
- #define MAX_SGT_BAD_TIME 1000 ///< 5000ms, SGT delay time
- #endif
- #define MAX_PMT_SCAN_NUM 5 ///< Scan number of PMT in one loop
- #define MAX_NAME_LEN 256 ///< Scan prog name length of SDT
- #define MAX_CHNLIST_NAME_LEN 40 ///< ASTRA required 31 bytes, Ghana Spec required 23 bytes
- #ifdef CONFIG_DVB_SYSTEM_DVBS_SUPPORT
- typedef INT32 (*BlindScanChannelInfoCallback)(UINT32 freq_KHz, UINT32 symbol, UINT32 standard);
- typedef INT32 (*BlindScanUpdateUICallback)(UINT32 u32Progress, UINT32* UserSearchState, UINT32 reserve);
- #endif
- //JennyLee 20100624 added for mantis 86055 [start]
- #ifdef SUPPORT_TRD //Target Region Descriptor
- typedef struct _mid_scan_trd_info
- {
- UINT8 u8RegionDepth;
- char u8CountryCode[3];
- UINT8 u8PrimaryCode;
- UINT8 u8SecondayCode;
- UINT16 u16TertiaryCode;
- } MID_ScanTrdInfo_t;
- #endif // #ifdef SUPPORT_TRD
- //JennyLee 20100624 added for mantis 86055 [start]
- //#define LCN_INDICATOR 0x8000
- //#define LCN_MASK 0x3FFF //runqian modify 091228 for mantis 0075769
- //#ifdef SUPPORT_SDHD_SIMULCAST //yukai 110214 added for mantis 0124070
- typedef struct mid_scan_simulcast_linkageinfo
- {
- UINT16 i_original_network_id;
- UINT16 i_transport_stream_id;
- UINT16 i_service_id;
- UINT8 linkage_type;
- }MID_Scan_Simulcast_LinkageInfo_t;
- //#endif
- #if (defined(SUPPORT_LCN_VER2) || defined(SUPPORT_ASTRA_LCN))
- //#define MAX_LCN_VER2_DATA 10
- #define MAX_CHNLIST_NUM 10
- #endif
- /**
- * \brief general pid strcucture
- */
- typedef struct _mid_scan_pid_info
- {
- unsigned short usPid; ///< pid
- unsigned short usCompTag; ///< component tag, for ac3 audio, the tag is PES stream id
- unsigned short usCodec; ///< codec or format
- char Lang[4]; ///< store ISO_639_LANGUAGE info
- struct _mid_scan_pid_info *next; ///< link to next unit
- }MID_ScanPidInfo_t; ///< general pid strcucture
- /**
- * \brief ecm/emm pid strcuture
- */
- typedef struct _mid_scan_exm_info // ECM & EMM
- {
- unsigned short usPid; ///< pid
- unsigned short usCaSysId; ///< CA_system_id
- struct _mid_scan_exm_info* next; ///< link to next unit
- }MID_ScanExMPidInfo_t; ///< ecm/emm pid strcuture
- /**
- * \brief multi service name strcuture for matis 76788
- */
- // zhaorui 100108 added
- typedef struct _mid_scan_multi_name_info
- {
- char Lang[3]; ///< store ISO_639_LANGUAGE info
- char ucCarrierName[MAX_NAME_LEN]; ///< carrier name info
- char ucServiceName[MAX_NAME_LEN]; ///< service name info
- struct _mid_scan_multi_name_info *next; ///< link to next unit
- }_mid_scan_multi_name_info; ///< multi service name strcuture
- /**
- * \brief desc. lcn2 data strcuture
- */
- #if (defined(SUPPORT_LCN_VER2) || defined(SUPPORT_ASTRA_LCN))
- //typedef struct _mid_scan_lcn_v2_info
- typedef struct _mid_scan_multi_lcn_info
- {
- UINT8 channel_list_id; ///< channel list id
- UINT8 country_code[3]; ///< country code
- UINT8 visible_service_flag; ///< visible flag of the service
- UINT16 lcn; ///< store lcn
- UINT8 channel_list_name[MAX_CHNLIST_NAME_LEN];
- UINT8 channel_list_name_length;
- }MID_ScanMultiLCNInfo_t; ///< desc. lcn2 data strcuture
- typedef struct _mid_scan_sing_srv_lcn_info
- {
- UINT16 usONID;
- UINT16 usTSID;
- UINT16 usSrvID;
- UINT16 usLCN;
- bool bVisible;
- UINT8 ucServType;
- }MID_ScanSingSrvLCNInfo_t, *PMID_ScanSingSrvLCNInfo_t;
- typedef struct _mid_scan_multi_srv_lcn_info
- {
- UINT8 channel_list_id; ///< channel list id
- UINT8 channel_list_name[MAX_CHNLIST_NAME_LEN];
- UINT32 uiSrvCnt;
- PMID_ScanSingSrvLCNInfo_t pLCNList;
- struct _mid_scan_multi_srv_lcn_info *pNextChnList;
- }MID_ScanMultSrvLCNInfo_t, *PMID_ScanMultSrvLCNInfo_t;
- typedef struct _MID_ScanMultSrvLCNInfoNode_t
- {
- struct _MID_ScanMultSrvLCNInfoNode_t *pNext;
- PMID_ScanMultSrvLCNInfo_t pstMultiSrvLCNInfo;
- }MID_ScanMultSrvLCNInfoNode_t, *PMID_ScanMultSrvLCNInfoNode_t;
- #endif
- typedef struct _MID_ScanSpecialSpec
- {
- dvbsi_special_spec eSpecialSpec; /// mid scan => ap
- bool changeCapabilitie; /// ap => mid scan
- }MID_ScanSpecialSpec;
- typedef struct _MID_Scan_AllTSID_info
- {
- unsigned int uiTSIDNum;
- unsigned short *pTSIDList;
- }MID_Scan_AllTSID_info;
- typedef struct _MID_Scan_FreqList_info
- {
- dvbpsi_freqlist_codingtype_e coding_type;
- unsigned int uiFreqNum;
- dvbpsi_frequency_t *pFreqList;
- }MID_Scan_FreqList_info;
- /**
- * \brief DVB service info
- */
- typedef struct _mid_scan_dvb_service_info
- {
- // carrier related
- int iCarrierIndex; ///< carrier index
- char szCarrierName[MAX_NAME_LEN]; ///< carrier name, max size MAX_NAME_LEN
- char szProviderName[MAX_NAME_LEN]; ///< carrier name, max size MAX_NAME_LEN
- // transponder related
- unsigned short usNetId; ///< network id
- unsigned short usOrigNetId; ///< original network id
- unsigned short usTsId; ///< transport stream id for sdt nit
- unsigned short usTsId_pat; ///< transport stream id for pat
- #ifdef NIT_SCAN_SUPPORT
- UINT32 usFreq;
- #endif
- #ifdef CONFIG_SUPPORT_FAST_SCANNING
- bool bFST;
- unsigned short usOrbitalPos;
- unsigned char ucWestEastFlag;
- unsigned char ucModulationSystem;
- unsigned int uiFreq;
- unsigned int uiPolarization;
- unsigned int uiSymbRate;
- #endif
- #ifdef CONFIG_ISDB_SYSTEM
- unsigned char usRemoteControlKeyId;//yhong 2010.10.29 for 0109549, add oneseg flag to DB.
- unsigned char ucIsOneSeg; //Only use 1b, 1=Oneseg//yhong 2010.10.29 for 0109549, add oneseg flag to DB.
- #endif
- // service related
- unsigned char ucServiceFlag; ///< SERVICE_HIDE, SERVICE_TEMP, SERVICE_SCRAMBLED, ... ?
- unsigned char ucServiceType; ///< service type, TV, Radio,...?
- unsigned char ucSDTServiceType; ///< service_type from SDT
- unsigned char ucRunningStatus; ///< running status
- unsigned short usServiceId; ///< service id
- unsigned short usProgNo; ///< program number
- #ifdef CONFIG_DTMB_SYSTEM
- unsigned short usSDTOrder; ///< SDT order
- #endif
- unsigned short usPMTPid; ///< pmt pid
- unsigned short usPcrPid; ///< pcr pid
- char szProgNameLang0[MAX_NAME_LEN]; ///< program name lang 1 : english
- // multi service name //zhaorui 100108 added for mantis 76788
- int iMulProNameNum; ///< multilingual service name number
- _mid_scan_multi_name_info *pstMulProName; ///< multilingual service name pointer
- // video related
- int iVideoNum; ///< video count
- MID_ScanPidInfo_t *pstVideoPID; ///< head of Vidoe PID linked list
- // audio related
- int iAudioNum; ///< audio count
- MID_ScanPidInfo_t *pstAudioPID; ///< head of Audio PID linked list
- // teletext related
- int iTTXNum; ///< teletext count
- MID_ScanPidInfo_t *pstTTXPID; ///< head of Teletext PID linked list
- // subtitle related
- int iSubtitleNum; ///< subtitle count
- MID_ScanPidInfo_t *pstSubtitlePID; ///< head of Subtitle PID linked list
- // CAT related, EMM
- int iEmmNum; ///< EMM count
- MID_ScanExMPidInfo_t *pstEmmPid; ///< head of EMM PID linked list
- // ECM
- int iGlobEcmNum; ///< globle ECM count
- MID_ScanExMPidInfo_t *pstGlobEcmPid; ///< head of globle ECM PID linked list
- int iVidEcmNum; ///< VID ECM count
- MID_ScanExMPidInfo_t *pstVidEcmPid; ///< head of VID ECM PID linked list
- int iAudEcmNum1; ///< Audio ECM1 count
- MID_ScanExMPidInfo_t *pstAudEcmPid1; ///< head of Audio ECM1 PID linked list
- int iAudEcmNum2; ///< Audio ECM2 count
- MID_ScanExMPidInfo_t *pstAudEcmPid2; ///< head of Audio ECM2 PID linked list
- #ifdef SUPPORT_LCN
- unsigned short usOrgLcn; ///< original LCN carried in LCN descriptor in NIT,
- ///< We may get some programs with the same LCN value in other TPs,
- ///< application should change the LCN value(800 later) by LCN decision tree.
- #endif // #ifdef SUPPORT_LCN
- char szProgNameLang1[MAX_NAME_LEN]; ///< program name lang 2 : wel
- char szProgNameLang2[MAX_NAME_LEN]; ///< program name lang 3 : gla/gae
- // other undefined private PIDs : MHEG5 used
- int iPrivateNum; ///< private data count
- MID_ScanPidInfo_t *pstPrivatePID; ///< head of private data PID linked list
- char szProgNameLang3[MAX_NAME_LEN]; ///< program name lang 1 : english
- char szlangCode3[MAX_NAME_LEN]; ///< program name lang 1 : english
- //[kiwi 20090122] +
- #ifdef SUPPORT_HIERARCHY_MODE
- int iHierarchyMode; ///< hierarchy mode 0:NONE 1:MODE_1 2:MODE_2 3:MODE_4 4:MODE_AUTO
- #endif
- //[kiwi 20090122] -
- #if (defined(SUPPORT_LCN_VER2) || defined(SUPPORT_ASTRA_LCN))
- //MID_ScanLcnV2Info_t stLcnV2Data[MAX_LCN_VER2_DATA];
- MID_ScanMultiLCNInfo_t stMultiLCNData[MAX_CHNLIST_NUM];
- #endif
- #ifdef SUPPORT_HD_SIMULCAST_LCN
- unsigned short usHDSimulLcn; ///< LCN carried in HD simulcast LCN descriptor in NIT,
- #endif
- #ifdef SUPPORT_EPG_SERIES //Mika 091203 added for series rec.
- unsigned char ucDefAuthority[32]; ///< default authority descriptor
- #endif
- #ifdef SUPPORT_SUPPORT_COUNTRY_AVAILABILITY //zhaorui 100925 add for mantis 0105229
- dvbpsi_country_avail_dr_t *pstCountryAvail;
- #endif
- //#ifdef SUPPORT_SDHD_SIMULCAST //yukai 20110213 added for mantis 0124070
- MID_Scan_Simulcast_LinkageInfo_t stSimulcastInfo;
- //#endif
- #ifdef SUPPORT_TRD //JennyLee 20100624 added
- MID_ScanTrdInfo_t stTrdInfo[MAX_SRV_TRD];
- #endif
- #ifdef SUPPORT_NETWORK_UPDATE_RESCAN
- unsigned char ucNitVersion;
- #endif
- #ifdef SUPPORT_MONITOR_ONLY_NIT_OTHER
- unsigned char ucNetTableId;
- #endif
- MID_Scan_AllTSID_info stAllTSID; // all TS ID loaded in current network
- MID_Scan_FreqList_info stFreqList; // all Freqs loaded in the frequency list descriptor
- unsigned char ucOtherFreqFlag; // other_frequency_flag defined in T & T2 delivery system descriptor, current we only consider T(2014/11/17)
-
- #ifdef CONFIG_DVB_SYSTEM_DVBT2_SUPPORT
- unsigned char usPlpInfo; //< the total PLP num for DVB-T2
- unsigned char usPlpId; //< the PLP ID for DVB-T2
- #endif
- DBCIProtection_t usCIShunningData; //< the usCIShunningData
- }MID_ScanDVBServiceInfo_t; ///< DVB service info
- /**
- * \brief Scan DVB tp info structure
- */
- typedef struct _mid_scan_dvb_tp_info
- {
- #ifdef SUPPORT_TRD
- dvbpsi_target_region_name_dr_t *pst_trd_name_info;
- #endif
- }MID_ScanDVBTpInfo_t; ///< Scan DVB tp info structure
- /**
- * \brief Scan OFDM parameter structure
- */
- typedef struct _MID_ScanOFDMParam_t
- {
- UINT32 frequency; ///< Frequency
- unsigned short bandwidth; ///< Bandwidth
- #ifdef SUPPORT_HIERARCHY_MODE
- DRV_Frontend_Hierarchy_t HierarchyMode; ///< Hierarchy mode
- #endif
- UINT32 ScanMode;
- #ifdef CONFIG_DVB_SYSTEM_DVBT2_SUPPORT
- UINT8 u32plp_id; //plp index
- UINT8 u32plp_totle; //plp index
- #endif
- #ifdef SUPPORT_FREEVIEW_NZ
- UINT16 u16cell_id;
- #endif
- }MID_ScanOFDMParam_t; ///< Scan OFDM parameter structure
- /**
- * \brief Scan QPSK parameter structure
- */
- typedef struct _MID_ScanQPSKParam_t
- {
- UINT32 frequency; ///< Frequency
- UINT32 freq_end;
- UINT32 symrate; ///< Symrate
- UINT32 polarization; ///< Polarization
- UINT32 fe_type; ///< dvb-s or dvb-s2
- UINT32 Diseqc_Bank;
- }MID_ScanQPSKParam_t; ///< Scan QPSK parameter structure
- /**
- * \brief Scan QAM parameter structure
- */
- typedef struct _MID_ScanQAMParam_t
- {
- UINT32 frequency; ///< Frequency
- UINT32 symbrate; ///< Symrate
- UINT16 modulation; ///< Modulation
- UINT32 network_id; /// network id;
- }MID_ScanQAMParam_t; ///< Scan QAM parameter structure
- /**
- * \brief Scan TDSOFDM parameter structure
- */
- typedef struct _MID_ScanTDSOFDMParam_t
- {
- UINT32 frequency; ///< Frequency
- UINT16 bandwidth; ///< Bandwidth
- UINT32 dDemodPara;
- }MID_ScanTSDOFDMParam_t; ///< Scan TDSOFDM parameter structure
- /**
- * \brief Scan BSTOFDM parameter structure
- */
- typedef struct MID_ScanBSTOFDMParam_t
- {
- UINT32 frequency; ///< Frequency
- UINT16 bandwidth; ///< Bandwidth
- #ifdef SUPPORT_HIERARCHY_MODE
- DRV_Frontend_Hierarchy_t HierarchyMode;
- #endif
- }MID_ScanBSTOFDMParam_t; ///< Scan BSTOFDM parameter structure
- /**
- * \brief Scan tuner type
- */
- typedef enum _MID_ScanTunerType_e
- {
- TUNER_QPSK = 0, ///< QPSK
- TUNER_QAM, ///< QAM
- TUNER_OFDM, ///< OFDM
- TUNER_TDS_OFDM, ///< TDS OFDM
- TUNER_BST_OFDM, ///< BST OFDM
- }MID_ScanTunerType_e; ///< Scan tuner type
- /**
- * \brief Scan parameter structure
- */
- typedef struct _MID_ScanParam_t
- {
- MID_ScanTunerType_e enType; ///< Scan tuner type
- union
- {
- MID_ScanOFDMParam_t ofdm; ///< Scan OFDM parameter
- MID_ScanQPSKParam_t qpsk; ///< Scan QPSK parameter
- MID_ScanQAMParam_t qam; ///< Scan QAM parameter
- MID_ScanTSDOFDMParam_t tdsofdm; ///< Scan TSDOFDM parameter
- MID_ScanBSTOFDMParam_t bstofdm;
- }u; ///< Scan parameter
- UINT32 u32ScanFlag; ///< Scan flag for return value
- char szServiceLang[4]; ///< Service language
- }MID_ScanParam_t; ///< Scan parameter structure
- /**
- * \brief Scan status structure
- */
- typedef struct _MID_ScanStatus_t
- {
- UINT8 bIsScanning; ///< It indicate whether we are scanning now
- UINT16 u16SignalStrength; ///< Signal strenth
- UINT16 u16SignalQuality; ///< Signal quality
- }MID_ScanStatus_t; ///< Scan status structure
- /**
- * \brief Scan program result
- */
- typedef struct _MID_ScanProgramResult_t
- {
- char szProgName[32]; ///< Scan program result to store program name
- }MID_ScanProgResult_t; ///< Scan program result
- /**
- * \brief Scan Callback type
- */
- typedef enum _MID_ScanCallbackType_e
- {
- MID_SCAN_CALLBK_TYPE_REQUEST_NEXT_TP = 0, ///< request ap layer give the next TP parameter : pParam is point to the structure MID_ScanParam_t
- MID_SCAN_CALLBK_TYPE_LOCKED_TP = 1, ///< TP lock ok or failed? (*pParam) is a value of DRV_Status_t
- MID_SCAN_CALLBK_TYPE_GOT_PMT = 2, ///< Got a PMT. (*pParam) is a value of the PMT program number
- MID_SCAN_CALLBK_TYPE_SERVICE_INFO = 3, ///< Got a service. pParam is a pointer to MID_ScanDVBServiceInfo_t structure
- MID_SCAN_CALLBK_TYPE_UNDEFINED_SERVICE_INFO = 4, ///< Got a service exist in SDT but not exist in PAT. pParam is a pointer to MID_ScanDVBServiceInfo_t structure
- MID_SCAN_CALLBK_TYPE_CARRIER_INFO = 5, ///< Got carrier info. pParam is a pointer to MID_ScanDVBServiceInfo_t structure
- MID_SCAN_CALLBK_TYPE_PROGRESS = 6, ///< Got scan progress. pParam is a pointer to MID_ScanDVBServiceInfo_t structure
- MID_SCAN_CALLBK_TYPE_TP_INFO = 7, ///< Got a traget region name information
- MID_SCAN_CALLBK_TYPE_SPECIAL_SPEC = 8, /// the special spec
- MID_SCAN_CALLBK_TYPE_T2_INFO = 9, ///< T2 scan info
- MID_SCAN_CALLBK_TYPE_T2_ONE_TP_SCAN_FINISH = 10, ///< T2 one TP scan finish
- MID_SCAN_CALLBK_TYPE_REQUEST_NEXT_BLIND_INFO= 11,
- MID_SCAN_CALLBK_TYPE_LOCK_NEW_TP = 12,
- MID_SCAN_CALLBK_TYPE_RESET_BS_SCAN_TBL = 13, /// < Set the Scan Tbl to collected Tp
- #ifdef SUPPORT_ASTRA_LCN //DVB-S Spec (ASTRA LCN)
- MID_SCAN_CALLBK_TYPE_ASTRA_LCN_INFO = 16,
- #endif
- MID_SCAN_CALLBK_TYPE_BLIND_NO_SERVICE = 14,
- MID_SCAN_CALLBK_TYPE_REQUEST_NEXT_BS_LOST_TP= 17, ///Get blind scan Lost TP
- MID_SCAN_CALLBK_TYPE_BS_LOST_TP_TRY = 18, ///try lost TP
- MID_SCAN_CALLBK_TYPE_BLIND_CANDIDATE_TABLE = 19, ///candidate TP
- #ifdef NIT_SCAN_SUPPORT
- MID_SCAN_CALLBk_TYPE_NIT_SCAN_SERVICE_INFO = 20,
- MID_SCAN_CALLBK_TYPE_FINISH = 21,
- #endif
- }MID_ScanCallbkType_e; ///< Scan Callback type
- typedef enum
- {
- MID_SCAN_BLIND_RET_NO_ACTION = 0, // blind scan is running, should do nothing
- MID_SCAN_BLIND_RET_ERROR, // blind scan fail
- MID_SCAN_BLIND_RET_LOCK, // Channel found, lock channel and scan
- MID_SCAN_BLIND_RET_NEW, // blind scan new channel
- MID_SCAN_BLIND_RET_EXCEED, // blind scan exceed range
- MID_SCAN_BLIND_RET_PAUSE, // blind scan pause
- }MID_ScanBlindRetType_e;
- typedef enum _MID_Manual_FE_Type_e
- {
- MANUAL_FE_QAM = 1 << 0, ///< QAM
- MANUAL_FE_OFDM = 1 << 1, ///< OFDM
- MANUAL_FE_T2 = 1 << 2, ///< T2
- MANUAL_FE_QPSK = 1 << 3, ///< QPSK
- }MID_Manual_FE_Type_e;
- typedef enum
- {
- MID_SCAN_STATE_ONLY_DVBT = 1, //only dvb-t state
- MID_SCAN_STATE_ONLY_DVBT2 = 2, //only dvb-t2 state
- MID_SCAN_STATE_TOGETHER_DVBT = 3, //current state is dvb-t(scan dvb-t/t2 same time)
- MID_SCAN_STATE_TOGETHER_DVBT2 = 4, //current state is dvb-t2(scan dvb-t/t2 same time)
- MID_SCAN_STATE_SEPARATE_DVBT = 5, //current state is dvb-t(scan dvb-t/t2 separate time)
- MID_SCAN_STATE_SEPARATE_DVBT2 = 6, //current state is dvb-t2(scan dvb-t/t2 separate time)
- MID_SCAN_STATE_NONE = 7, //default dvb-t
- } MID_DVB_T_T2_ScanMode_e;
- #ifdef SCAN_FREQ_OFFSET_RANGE_ENLARGE//qiuwei20100208add
- typedef struct _dvb_Scan_FreqOffset_SetParam {
- unsigned int u32Step; ///< Scan frequency offset range enlarge steps
- unsigned int u32NegativeWayNum; ///< Scan frequency offset range enlarge negative way number
- unsigned int u32PositiveWayNum; ///< Scan frequency offset range enlarge positive way number
- }dvb_ScanFreqOffset;
- /*******************************************************************************************/
- /**
- * \fn unsigned int SP_DVBScanFreqGetVal( void )
- *
- * \param None.
- *
- * \return current scan freqency
- *
- * \note Description : To get current scan freq
- *
- * \note Restrictions: None.
- *
- ********************************************************************************************/
- unsigned int SP_DVBScanFreqGetVal( void );
- /*******************************************************************************************/
- /**
- * \fn void SP_DVBScanFreqOffsetSet( dvb_ScanFreqOffset *stFreqOffset )
- *
- * \param frequency offset return address.
- *
- * \return None.
- *
- * \note Description : To set Scan Freq Offset
- *
- * \note Restrictions: frequency offset return address can't be zero
- *
- ********************************************************************************************/
- void SP_DVBScanFreqOffsetSet( dvb_ScanFreqOffset *stFreqOffset );
- /*******************************************************************************************/
- /**
- * \fn UINT8 Dvb_GetFreqEnlargeEnable(void)
- *
- * \param None.
- *
- * \return TREU/FALSE by the scan freq enlarge enable or not
- *
- * \note Description : To get Scan Freq Enlarge enable or not
- *
- * \note Restrictions: None.
- *
- ********************************************************************************************/
- UINT8 Dvb_GetFreqEnlargeEnable(void);
- /*******************************************************************************************/
- /**
- * \fn void Dvb_SetFreqEnlargeEnable(UINT8 SetFreqEnlargeEnable)
- *
- * \param Enable or not of frequency enlarge
- *
- * \return None.
- *
- * \note Description : To set Scan Freq Enlarge enable
- *
- * \note Restrictions: None.
- *
- ********************************************************************************************/
- void Dvb_SetFreqEnlargeEnable(UINT8 SetFreqEnlargeEnable);
- #endif
- /**
- * \brief a callback function to obtain the next TP scan parameter
- *
- * return 0 means successful getting the next TP scan parameter
- * other return values means no next TP scan parameter, and the scan processer will auto terminate
- */
- typedef int (*iMidScanCallback)(MID_ScanCallbkType_e eCallbkType, void* pParam);
- /*************************************************************************************
- * Definition of SCAN module interfaces
- *************************************************************************************/
- /** \addtogroup DTV_scan DTV Scan
- * \brief Interfaces of DTV scan middle-ware.
- * <{ */
- /*******************************************************************************************/
- /**
- * \fn DRV_Status_t MID_ScanStart(UINT32 u32ScanCapabilities, UINT32 u32ScanCapabilitiesExt, iMidScanCallback pfGetScanParamCallbk)
- *
- * \param u32ScanCapabilities : The scan capabilities combined by MID_SCAN_CAPS_xxxxx
- * \param pfGetScanParamCallbk : a callback function to obtain the next TP scan parameter
- * callback function return 0 by ap layer means successful getting the next TP scan parameter
- * and other return values means no next TP scan parameter, and the scan processer will auto terminate.
- *
- * \return DRV_SUCCESS if successful, warning or error code if function failed
- *
- * \note Description : To trigger a thread for scan the programs of digital signal.
- *
- * \note Restrictions: None.
- *
- ********************************************************************************************/
- MID_Status_t MID_ScanStart(UINT32 u32ScanCapabilities, UINT32 u32ScanCapabilitiesExt, iMidScanCallback pfGetScanParamCallbk);
- /*******************************************************************************************/
- /**
- * \fn DRV_Status_t MID_ScanStop(void)
- *
- * \return DRV_SUCCESS if successful, warning or error code if function failed
- *
- * \note Description : To stop the scan processer while scanning.
- *
- * \note Restrictions:Once the module has been stop, calling this API a second time will
- * do nothing and will simply return a warning.
- ********************************************************************************************/
- MID_Status_t MID_ScanStop(void);
- /*******************************************************************************************/
- /**
- * \fn DRV_Status_t MID_ScanCheckStatus(MID_ScanStatus_t *pstScanStatus)
- *
- * \param pstScanStatus : the pointer to structure contains the scan status, signal strength, signal quality,.....
- *
- * \return DRV_SUCCESS if successful, warning or error code if function failed
- *
- * \note Description : To obtain the scan status while scanning.
- *
- * \note Restrictions : None.
- *
- ********************************************************************************************/
- MID_Status_t MID_ScanCheckStatus(MID_ScanStatus_t *pstScanStatus);
- /*******************************************************************************************/
- /**
- * \fn DRV_Status_t MID_ScanPause(void)
- *
- * \return DRV_SUCCESS if successful, warning or error code if function failed
- *
- * \note Description : To obtain the scan status while scanning.
- *
- * \note Restrictions : None.
- *
- ********************************************************************************************/
- MID_Status_t MID_ScanPause(void); //add by zhangjie for DVB-C 20100319
- /*******************************************************************************************/
- /**
- * \fn DRV_Status_t MID_ScanResume(void)
- *
- * \return DRV_SUCCESS if successful, warning or error code if function failed
- *
- * \note Description : To resume the scan processer while scanning.
- *
- * \note Restrictions:Once the module has been stop, calling this API a second time will
- * do nothing and will simply return a warning.
- ********************************************************************************************/
- MID_Status_t MID_ScanResume(void);//add by zhangjie for DVB-C 20100319
- /*******************************************************************************************/
- /**
- * \fn void MID_ScanGetManualSearchProgress(UINT16 *wCurrentCount, UINT16 *wTotalCount, UINT16 *wCurrentProgress)
- *
- * \param wCurrentCount: Current Program Count return address
- * \param wTotalCount: Total Program Count return address
- * \param wCurrentProgress: Current Scan Progress return address
- *
- * \return None.
- *
- * \note Description : To get scan current program count, total program count, and current scan progress
- *
- * \note Restrictions: wCurrentCount, wTotalCount, and wTotalCount address can't be zero
- *
- ********************************************************************************************/
- //Mika 100330 MOD for mantis 82627
- void MID_ScanGetManualSearchProgress(UINT16 *wCurrentCount, UINT16 *wTotalCount, UINT16 *wCurrentProgress);
- /*******************************************************************************************/
- /**
- * \fn void MID_ScanSetCountryCode(char *pszCountryCode)
- *
- * \param pszCountryCode: set the current country code to scan module
- *
- * \return None.
- *
- * \note Description : set the country code to scan module, to find the matched descriptor
- *
- ********************************************************************************************/
- void MID_ScanSetCountryCode(char *pszCountryCode);
- /*******************************************************************************************/
- /**
- * \fn void MID_ScanCheckCountryCode(char *pszCountryCode)
- *
- * \param pszCountryCode: the country code to be checked
- *
- * \return TRUE means country code matched, FALSE means country code not matched
- *
- * \note Description : check if the country code is matched or not
- *
- ********************************************************************************************/
- UINT8 MID_ScanCheckCountryCode(char *pszCountryCode);
- /*Add by william.lee @20110125 for sunpporting DTV manual search*/
- /*******************************************************************************************/
- /**
- * \fn DRV_Status_t MID_ScanManualSetFrontend(UINT32 frequence,UINT16 bandwidth)
- *
- * \param frequence: To be lock frequency
- * \param bandwidth: To be lock bandwidth
- * \param mode: bit[0] 0 for DVB-T, 1 for DVB-C
- * bit[1] 0 for DVB-T, 1 for DVB-T2
- *
- * \return TRUE if tuner success
- *
- * \note Description : Set tuner parameter for a specified frequency and bandwidth
- *
- ********************************************************************************************/
- MID_Status_t MID_ScanManualSetFrontend(UINT32 frequence,UINT16 bandwidth, UINT32 mode);
- /*add end*/
- int _ScanParsePidAddTail(MID_ScanPidInfo_t ** ppHead, MID_ScanPidInfo_t * pNew);
- void _ScanParseFreePidList(MID_ScanPidInfo_t ** ppPID);
- /*******************************************************************************************/
- /**
- * \fn void DVB_TpAdd_OtherType(MID_ScanParam_t * pstScanParam)
- *
- * \param pstScanParam: the Scan param
- *
- * \return none
- *
- * \note Description : none
- *
- ********************************************************************************************/
- void DVB_TpAdd_OtherType(MID_ScanParam_t * pstScanParam);
- /*******************************************************************************************/
- /**
- * \fn void DVB_Set_Scan_Status(DvbScanStatus_t EdvbscanType)
- *
- * \param EdvbscanType: the Status type param,-T,-T2
- *
- * \return none
- *
- * \note Description : none
- *
- ********************************************************************************************/
- void DVB_Set_Scan_Status(EDVBDeliveryType_t EdvbscanType);
- /*******************************************************************************************/
- /**
- * \fn void DVB_Set_Scan_Param2Driver(DvbScanStatus_t EdvbscanType)
- *
- * \param EdvbscanType: the Scan type param,-T,-T2
- *
- * \return none
- *
- * \note Description : none
- *
- ********************************************************************************************/
- void DVB_Set_Scan_Param2Driver(EDVBDeliveryType_t EdvbscanType);
- /*******************************************************************************************/
- /**
- * \fn DvbScanStatus_t DVB_Get_Scan_Status(void)
- *
- * \param none
- *
- * \return DvbScanStatus_t -T or -T2
- *
- * \note Description : none
- *
- ********************************************************************************************/
- EDVBDeliveryType_t DVB_Get_Scan_Status(void);
- /*******************************************************************************************/
- /**
- * \fn void MID_ScanManualSetPolling(void)
- *
- * \param none
- *
- * \return none
- *
- * \note Description : none
- *
- ********************************************************************************************/
- void MID_ScanManualSetPolling(void);
- void MID_ScanCleanNitCap(void);
- #ifdef CONFIG_DVB_SYSTEM_DVBS_SUPPORT
- void MID_ScanBlindScanChannelInfoCallback(BlindScanChannelInfoCallback pBlindScanChInfoCallback);
- void MID_ScanBlindScanUpdateUICallback(BlindScanUpdateUICallback pBlindScanUpdateUICallback);
- #endif
- #ifdef NIT_SCAN_SUPPORT
- UINT8 MID_ScanGetNitScanFlag(void);
- #endif
- bool MID_ScanIsScaning(void);
- #ifdef CONFIG_SUPPORT_FAST_SCANNING
- typedef enum
- {
- GET_FST_FNT_VERSION,
- SET_FST_FNT_VERSION,
- SET_FST_FOUND,
- } e_FAST_SCAN_OPERATION;
- typedef INT32 (*FastScanCallback)(e_FAST_SCAN_OPERATION op, UINT8 *param1, UINT8 *param2);
- void MID_ScanSetFastScanPid(UINT16 pid);
- void MID_ScanSetFastScanUpdateMode(bool bCheckVersion);
- void MID_ScanSetFastScanCallback(FastScanCallback pFastScanCallback);
- #endif
- /*! @} end of addtogroup DTV Scan*/
- #endif // #ifndef _MID_SCAN_H_2008_03_18
|