📄 dvb_eit.h
字号:
/**************************************************************************
(C)Copyright Cheertek Inc. 2002-2004,
D700, all right reserved.
Product : STB Firmware
****************************************************************************/
#ifndef _DVB_EIT_H
#define _DVB_EIT_H
#include "dvb_type.h"
#include "db_api.h"
/*! \file
* This module provides the EIT control API.
*
*/
#define EIT_TITLE_SIZE 1024
#define EIT_NAME_ARRAY_ENABLE
#define MAX_LEN_SHORT_EVENT_NAME 40 /**< Define the maximum length event satellite name. */
#define MAX_LEN_SHORT_EVENT_TEXT 250 /**< Define the maximum length event description. */
#define MAX_LEN_TITLE_TEXT 40
#define PRESENT_MASK 0x1
#define FOLLOWING_MASK 0x2
#define SCHEDULE_MASK 0x4
#define EXTENDED_MASK 0x8
#define INVALID_LINK_IDX 0xFFFF
/**
* Define the function error type.
*/
typedef enum
{
EN_EITDB_NO_ERROR, /**< No error. */
EN_EITDB_HEADER_NOT_EXIST, /**< EIT Database header doesn't exist. */
EN_EITDB_EVENT_NOT_EXIST, /**< EIT Database doesn't have this event. */
EN_EITDB_WRONG_PARAMETER, /**< Function gets wrong parameters. */
EN_EITDB_MEMORY_NULL, /**< The memory in EIT database is NULL. */
EN_EITDB_MEMORY_FULL, /**< The memory in EIT database is full. */
EN_EITDB_USER_ABORT, /**< User aborts this process. */
EN_EITDB_TIMEOUT, /**< the event's start time is ealier than current time.*/
EN_EITDB_EXIST, /**< EIT Database have this event already.*/
EN_EITDB_ADD, /**< add a event to Database. */
EN_EITDB_ERROR /**< Unknow EIT error. */
}EN_EITDB_STATUS;
/**
* Define the retrieve event type.
*/
typedef enum
{
EN_RETRIEVE_EVENT_PF, /**< Retrieve present and following events. */
EN_RETRIEVE_EVENT_S1, /**< Retrieve 1-4 days schedule events. */
EN_RETRIEVE_EVENT_S2, /**< Retrieve 5-7 days schedule events. */
EN_RETRIEVE_EVENT_ALL, /**< Retrieve present, following, and 7 days schedule events. */
EN_RETRIEVE_EVENT_STOP
}EN_RETRIEVE_EVENT_TYPE;
/**
* Define event compact info, refer EN 300 468
*/
typedef struct
{
u16 b4Level1 : 4; /**< content_nibble_level_1 in content descriptor(Tag:0x54). */
u16 b4Level2 : 4; /**< content_nibble_level_2 in content descriptor(Tag:0x54). */
u16 b8User : 8; /**< user_nibble in content descriptor(Tag:0x54). */
u16 b3RunningStatus : 3; /**< running_status in event information section. */
u16 b1FreeCaMode : 1; /**< free_CA_mode in event information section. */
u16 Reserved : 12; /**< Reserved bytes for future use. */
}_Pack_Struct_
ST_EIT_DESC_COMPACT;
#ifdef ATSC_SYSTEM
#define MAX_DIMENSION_NO 20
#define MAX_REGION_NO 8
typedef struct
{
u8 u8Dimension;
u8 u8Rating;
} ST_EIT_DES_RATING;
typedef struct
{
u8 u8Region;
u8 u8DimNo; // 20
ST_EIT_DES_RATING *pstRating; // 20
u8 *pu8DesText;
} ST_EIT_DES_REGION_RATING;
typedef struct
{
u8 u8RegionNo;
ST_EIT_DES_REGION_RATING *pstRegionRating; // 8
} ST_EIT_DES_CONTENT_ADVISORY;
#endif /* end if #ifdef ATSC_SYSTEM */
/**
* Define event info, refer EN 300 468, Note: don't change this structure's item order.
*/
typedef struct
{
#ifdef ATSC_SYSTEM
u32 u32StartTime; /*!< Event start time in GMT and unit is "second". */ //4
u32 u32AC3:1; /*!< Event AC3 or not */ //8
u32 u32ETMLocation:2;
u32 u32FoundETM:1;
u32 u32Reserved:8; /*!< Event duration and unit is "second". */ //8
u32 u32Duration:20; /*!< Event duration and unit is "second". */ //8
u16 u16EventId; /*!< event ID. */
// u16 u16TitleLen;
u8 au8LangCode[3];
u8 au8Name[MAX_LEN_TITLE_TEXT];
ST_EIT_DES_CONTENT_ADVISORY ContentInfo;
u8 *au8Text; /* ETM */
#else /* DVB_SI */
/* Main event */
u32 u32StartTime; /*!< Event start time in GMT and unit is "second". */ //4
u32 u32Duration; /*!< Event duration and unit is "second". */ //8
u16 u16EventId; /*!< event ID. */ //10
u16 b4Level1 : 4; /*!< content_nibble_level_1 in content descriptor(Tag:0x54). */
u16 b4Level2 : 4; /*!< content_nibble_level_2 in content descriptor(Tag:0x54). */
u16 b8User : 8; /*!< user_nibble in content descriptor(Tag:0x54). */ //12
#ifdef EIT_NAME_ARRAY_ENABLE
u8 au8Name[MAX_LEN_SHORT_EVENT_NAME];
#else
u8 *au8Name; /*!< event name in short event descriptor (Tag:0x4d)*/ //16
#endif
u8 *au8Text; /*!< pointer to extend or short event */ //20
u8 *pu8ShortEventDesc; /*!< event text in short event descriptor (Tag:0x4d)*/ //24
u8 *pu8ExtendEventDesc;/*!< extended event descriptor (Tag:0x4e)*/ //28
u16 u16ShortEventDescLength;/*!< short event descripto descriptor length */ //30
u16 u16ExtendEventDescLength;/*!< extended event descripto descriptor length */ //32
u8 au8LangCode[3]; /*!< ISO_639_language_code */ //35
u8 u8Rating; /*!< rating in parental rating descriptor(Tag:0x55). */ //36
#endif /* end #ifdef ATSC_SYSTEM */
}_Pack_Struct_
ST_EIT_EVENT;
/**
* Define EIT event database structure, Note: don't change this structure's item order.
*/
typedef struct
{
u16 u16PreEventIdx; /*2*/ /**< previous event index. */
u16 u16NextEventIdx; /*4*/ /**< next event index. */
ST_EIT_EVENT stEitEvent; /*320*/ /**< current event information. */
}_Pack_Struct_
ST_EIT_DB;
/*
Exist P, F, and S
---------- ----- ----- ------ ------ ----------------
| Header | -> | P | -> | F | -> | S1 | -> | S2 | ..... -> | INVALID_LINK |
---------- ----- ----- ------ ------ ----------------
Exist P and S
---------- ----- ------ ------ ----------------
| Header | -> | P | -> | S1 | -> | S2 | ..... -> | INVALID_LINK |
---------- ----- ------ ------ ----------------
Exist F and S
---------- ----- ------ ------ ----------------
| Header | -> | F | -> | S1 | -> | S2 | ..... -> | INVALID_LINK |
---------- ----- ------ ------ ----------------
Exist just P and F
---------- ----- ----- ----------------
| Header | -> | P | -> | F | -> | INVALID_LINK |
---------- ----- ----- ----------------
Exist only s event
---------- ------ ------ ----------------
| Header | -> | S1 | -> | S2 | ..... -> | INVALID_LINK |
---------- ------ ------ ----------------
*/
/**
* Define EIT header database structure.
*/
typedef struct
{
u16 u16HeadEventIdx; /*2*/ /**< Head index point to event database. */
u16 u16AllEventNum; /*4*/ /**< Event numbers in this service include PF and S numbers */
u8 u8PF_Ver; /*5*/ /**< present and following event version */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -