source: svn/newcon3bcm2_21bu/dst/dmw/src/EPG/DMW_EpgBasePriv.h @ 22

Last change on this file since 22 was 22, checked in by phkim, 11 years ago
  1. phkim
  2. newcon3sk 를 kctv 로 브랜치 함
  • Property svn:executable set to *
File size: 7.0 KB
Line 
1/*
2        dmw_epgbasepriv.h
3       
4        EPG Middleware baseline implementation
5
6        Copyright 2004 Digital STREAM Technology, Inc.
7        All Rights Reserved
8
9        $Id: dmw_epgbasepriv.h  v1.00 2004/07 cafrii Exp $
10*/
11
12
13#ifndef __DMW_EPG_BASE_PRIV_H__
14#define __DMW_EPG_BASE_PRIV_H__
15
16//#include "DHL_PsiAPI.h"
17#include "DLIB_PSIP_Monitor.h"
18#include "DLIB_PSIP_Parser.h"
19#include "DLIB_PSI_Monitor.h"
20#include "DLIB_PSI_Parser.h"
21
22#if DMW_EPG_SUPPORT_ELAPSED_TIMER
23        #include "DMW_Timer.h"
24#endif
25
26
27#ifndef abs
28        #define abs(a) ((a)>=0?(a):-(a))
29#endif
30
31#if 0
32____Structures____()
33#endif
34
35
36struct DmcChannelInfo_t;        /* forward declaration */
37
38/*-----------------------------------------------------------------------
39          DmcSubChannelInfo
40       
41            Sub channel ÀÇ ¸ðµç PSIP Á¤º¸¸¦ ÀúÀåÇÏ´Â ±¸Á¶Ã¼
42*/
43typedef struct 
44{
45        struct DmcChannelInfo_t *parent;        /* back pointer to parent chInfo */
46        int index;              /* subchannel index.. 0 ~ chInfo->n_subchannel-1 */
47        BOOL active;    /* TRUE if this structure field data is valid */
48       
49        UINT16 source_id;       /* ÀÌ ¿ª½Ã vct¿¡ ³ª¿Í ÀÖÁö¸¸ ¿©±â¿¡ copy¸¦ µÐ´Ù. */
50       
51        /* ´õ ½±°Ô Á¢±ÙÇϱâ ÁÁ°Ô À̰÷¿¡ vctInfo »çº»À» µÎ´Â °ÍÀº ¾î¶³±î?
52                 union {
53                    tvctChannelPtr_t tvct_info;
54                    cvctChannelPtr_t cvct_info;
55                 } vct;
56        */
57        struct {
58                UINT16  short_name[7];
59                UINT16  major_channel_number;
60                UINT16  minor_channel_number;
61                UINT16  program_number;
62                BOOL    analog;
63        } vct_info;
64
65       
66        eitPtr_t eits[128];
67        /* UINT8 eit_exist[16]; */      /* ÇØ´ç eit°¡ TS»ó¿¡ Á¸ÀçÇÏ´ÂÁö¸¦ ³ªÅ¸³»´Â flag. MGT»óÀÇ Á¤º¸¿¡ ±âÃÊÇÑ´Ù. */
68        /* todo --> ±×³É chInfo->eit_pid Á¤º¸¸¦ º¸´Â°Ô ³´´Ù. */
69       
70        BOOL eit_complete;      /* ¸ðµç eit°¡ ´Ù ¼ö½ÅµÇ¸é TRUE */
71       
72        int n_ett[128];                                                 /* ettÀÇ °¹¼ö°¡ ¾Æ´Ï¶ó ¾Æ·¡ etts[k]ÀÇ element °¹¼ö (arrayÅ©±â) */
73        ettSectionPtr_t *etts[128];     /* ÇØ´ç eit-k¿¡ ¿¬°áµÇ¾î ÀÖ´Â ettµéÀÇ array pointerµé. */
74
75        BOOL ett_complete;      /* ¸ðµç ett°¡ ´Ù ¼ö½ÅµÇ¸é TRUE */
76
77        /* todo..
78                 ÇØ´ç ett°¡ Á¸ÀçÇÏ´ÂÁö ¾ÈÇÏ´ÂÁö¸¦ »¡¸® ¾Ë¾Æº¼¼ö ÀÖ´Â ¹æ¹ýÀ» ã¾Æº¸ÀÚ.   
79                 ÇöÀç ±¸Á¶·Î´Â chInfo->ett_pid°¡ ÀÖ´ÂÁö È®ÀÎÇØº¸°í,
80                 subchInfo->eits[]¿¡¼­ °¢ eventº°·Î ETM_locationÀ» È®ÀÎÇØºÁ¾ß ÇÑ´Ù.
81        */
82        ettSectionPtr_t channel_ett;
83        BOOL channel_ett_exist;         /* channel ett°¡ ¼ö½ÅµÇ¾îÁ®¾ß ÇÏ´Â °æ¿ì¿¡´Â TRUE */
84
85        /* cafrii 040726 add
86                 °¢ complete event message°¡ ºÒ·È´ÂÁö ¾Æ´ÑÁö¸¦ ÀúÀåÇÏ´Â flag.
87                 caller°¡ óÀ½ API¸¦ ºÎ¸£¸é ¸®¼ÂµÇ¾ú´Ù°¡ notifyµÇ¸é °¢°¢ setµÈ´Ù.
88                 µ¿ÀÏ event procÀÌ ¿©·¯¹ø ºÒ¸®´Â °ÍÀ» ¸·±â À§Çؼ­ÀÓ.
89        */
90        BOOL eit_complete_notified;
91        BOOL subchannel_complete_notified;
92       
93        BOOL subchannel_start_notified; /* cafrii 041123 add, À§¿Í µ¿ÀÏÇÑ ¸ñÀûÀÓ. */
94
95#if DMW_EPG_SUPPORT_ELAPSED_TIMER
96        /* cafrii 060814 add */
97        DMW_Counter counter;
98       
99#endif
100
101} DmcSubChannelInfo;
102
103
104/*
105         to access EIT:
106             subchInfo->eits[eit_index]
107         to access ETT:
108             if (subchInfo->etts[eit_index])
109               subchInfo->etts[eit_index][event_index_in_eit]
110*/
111
112#define MAX_RRT_IN_PTC 5
113
114#define CHANNEL_INFO_MAGIC 0x20040419
115
116/*-----------------------------------------------------------------------
117          DmcChannelInfo
118       
119            Physical Channel ÀÇ ¸ðµç PSIP Á¤º¸¸¦ ÀúÀåÇÏ´Â ±¸Á¶Ã¼
120            ³»ºÎ¿¡ Subchannel °¹¼ö ¸¸Å­ÀÇ SubchInfo ¸¦ Æ÷ÇÔÇÑ´Ù.
121*/
122typedef struct DmcChannelInfo_t
123{
124        UINT32 magic;   /* CHANNEL_INFO_MAGIC °ªÀ» °¡Á®¾ß ÇÔ. */
125       
126        struct DmcChannelInfo_t *prev, *next;
127       
128        int id;                         /* id of this PTC.. º¸Åë rf ¹øÈ£¸¦ »ç¿ëÇÑ´Ù. */
129        tDHL_TSD *tsd;                  /* stream source */
130       
131        /*-----------------
132                 table pointers
133        -----------------*/
134
135#if USE_EPG_MW_PSI_DOWNLOAD
136        MPEG_PAT *pat;
137        MPEG_PMT **pmtlist;
138
139        #define MAX_STATIC_PMT_LIST_SIZE 20
140        MPEG_PMT *pmtlist_static[MAX_STATIC_PMT_LIST_SIZE];
141#endif
142       
143        /* MGT
144                 °¡Àå ¸¶Áö¸·À¸·Î ¼ö½ÅµÇ¾î ÇöÀç À¯È¿ÇÑ mgt¿Í
145                 ±× ¹Ù·Î Á÷ÀüÀÇ À¯È¿Çß´ø mgt (mgt_old) µÎ°³¸¦ ÀúÀåÇÑ´Ù.
146        */
147        mgtSectionPtr_t mgt, mgt_old;
148       
149        /* VCT */
150        tvctPtr_t tvct;
151        cvctPtr_t cvct;
152
153#if DMW_EPG_SUPPORT_RRT
154        /* RRT
155                rrtSectionPtr_t rrts[MAX_RRT_IN_PTC];
156                 RRT´Â Àü ä³ÎÀ» ÅëÆ²¾î¼­ 1°³¸¸ Á¸ÀçÇØ¾ß ÇÑ´Ù.
157                 µû¶ó¼­ º°µµÀÇ global º¯¼ö·Î °ü¸®ÇÑ´Ù.
158        */
159#endif
160
161        /* STT */
162        BOOL stt_valid;                                 /* cafrii 050721 add, flat_stt °ªÀÌ ÇѹøÀÌ¶óµµ set µÇ¸é TRUE */
163        sttSection_t flat_stt;  /* cafrii 050330 change to flat_stt */
164                                /* sttÀÇ descriptor´Â ÇöÀç·Î¼­´Â »ç¿ëÇÒ ÀÏÀÌ ¾ø´Ù. */
165                                /* µû¶ó¼­ descriptor°¡ NULLÀÎ flat stt¸¦ ±â¾ïÇϵµ·Ï ÇÑ´Ù. */
166        UINT32 tick_stt_get;            /* ÀÌ stt¸¦ ¼ö½ÅÇÏ¿´À» ¶§ÀÇ System Time Tick */
167       
168        /*-----------------
169                 from mgt, various pids info.. ¹Ì¸® ÃßÃâÇØ ³õ´Â°Ô ÆíÇÏ´Ù.
170                 version ÀÇ ÃʱⰪÀº -1 (all bit 1) À¸·Î Á¤ÀÇÇϵµ·Ï ÇÑ´Ù.
171        */
172        UINT16 eit_pids[128];     
173        UINT8  eit_ver[128];
174       
175        UINT16 ett_pids[128];           /* event_ett */
176        UINT8  ett_ver[128];
177       
178        UINT16 channel_ett_pid;
179        UINT8  channel_ett_ver;
180
181        BOOLEAN tvct_exist_in_mgt, cvct_exist_in_mgt;   /* cafrii 041123 À̸§ º¯°æ */
182       
183        UINT8  tvct_ver;
184        UINT8  cvct_ver;
185        /*-----------------
186                 ÁÖÀÇ!! PID Á¤º¸°¡ mgt¿¡ ÀÖ´Ù°í ÇØ¼­ ±× tableÀÌ Á¸ÀçÇÏ´Â °ÍÀ» ÀǹÌÇÏÁö´Â ¾Ê´Â´Ù.
187                 subchannelÀÇ °¹¼ö´Â vct¿¡ ³ª¿Í Àִµ¥, ¾î´À vct°¡ »ç¿ëµÉÁö ¾Ë ¼ö ¾øÀ¸¹Ç·Î
188        */ 
189        int n_subchannel;
190        DmcSubChannelInfo *subchannel;
191
192        /* cafrii 040726 add */
193        BOOL channel_complete_notified;
194
195#if DMW_EPG_SUPPORT_ELAPSED_TIMER
196        /* cafrii 060814 add */
197        DMW_Counter counter;
198
199#endif
200       
201} DmcChannelInfo;
202
203extern DmcChannelInfo *g_EpgDB;
204
205void Dmc_EpgLockCoreDB(BOOL bLock);
206BOOL Dmc_EpgLockRrtDB(BOOL bLock, BOOL bWait);
207        /* cafrii 060714 add
208                 rrt db¸¦ À§ÇÑ º°µµÀÇ mutex ¿î¿ë.
209                 bWait°¡ FALSEÀ̸é ÇöÀç mutex »óŰ¡ lockÀÌ ºÒ°¡´ÉÇÒ °æ¿ì ±×³É return FALSEÇÑ´Ù.
210        */
211DmcChannelInfo *Dmc_GetChannelInfo(DmcChannelInfo *start, int rf);
212
213
214
215int DmwEpgBasePrint(int nLevel, char *fmt, ...);
216
217/* cafrii 041028 distinguish event etm and channel etm.. */
218#define MakeEventETMID(srcid, evtid) \
219                (       (((srcid) & 0xffff) << 16) | ((((evtid) & 0x3fff) << 2) | 0x2)   )
220
221#define MakeChannelETMID(srcid) \
222                (       (((srcid) & 0xffff) << 16)  )
223
224
225
226/* cafrii 050203 add */
227#define EPG_ONE_PART_CHANNEL_INDICATOR 1024
228        /*
229                 minor ¹øÈ£ ÀÚ¸®¿¡ ÀÌ °ªÀÌ µé¾î ÀÖÀ¸¸é majorÀÇ °ªÀ» OnePartChannel ¹øÈ£·Î ÇØ¼®ÇÏ¿© Æ©´×À» ÇÑ´Ù.
230                 DmcSubChannelInfo::vct_info ¿¡ ÀÖ´Â minor ¹øÈ£¿¡ ÀÌ °ªÀÌ »ç¿ëµÉ ¼ö ÀÖÀ½. */
231
232/*
233        major                minor
234        +-----------------+  +-----------------+
235        0000 0011 1111 xxxx  0000 00xx xxxx xxxx (low 10 bits)
236                       nnnn         nn nnnn nnnn (total 14 bits, 16383 max)
237*/
238
239#define EpgIsOnePartChannelNumber(major) ((major) >= 0x3f0)
240
241#define EpgConvertToOnePartChannelNumber(major,minor) \
242                ((((major) & 0x00F)<<10) + ((minor) & 1023))
243
244#define EpgMajorNumberInCVCT(ch)  (EpgIsOnePartChannelNumber((ch)->major_channel_number) ? \
245                               EpgConvertToOnePartChannelNumber((ch)->major_channel_number, (ch)->minor_channel_number) : \
246                               (ch)->major_channel_number)
247#define EpgMinorNumberInCVCT(ch)  (EpgIsOnePartChannelNumber((ch)->major_channel_number) ? \
248                               EPG_ONE_PART_CHANNEL_INDICATOR : (ch)->minor_channel_number)
249
250
251
252
253void RegisterEpgDebugSymbols(void);
254
255
256
257#endif /* __DMW_EPG_BASE_PRIV_H__ */
Note: See TracBrowser for help on using the repository browser.