source: svn/newcon3bcm2_21bu/dst/dmw/src/Channel/DMW_ChannelDemux.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 7.8 KB
Line 
1/*     
2        DMW_ChannelDemux.h
3
4        header file for ChannelDemux module
5        various advanced Table Reception API
6*/
7
8#ifndef __DMW_CHANNELDEMUX_H__
9#define __DMW_CHANNELDEMUX_H__
10
11#ifndef __DMW_PLATFORM_H__
12#include "DMW_Platform.h"
13#endif
14
15
16
17#if (DHL_SUPPORTED==DHL_CB2)
18        #include "DLIB_PSI_Monitor.h"
19        #include "DLIB_PSIP_Monitor.h"
20        #include "DLIB_PSI_Parser.h"
21        #include "DLIB_PSIP_Parser.h"
22
23#else
24        #include "ATSC_PSIP.h"
25
26#endif
27
28
29
30
31
32
33// cafrii 060306 add bytebuf I/O
34
35struct byteBuf
36{
37        UINT8*  buffer;
38        UINT32  bufSize;
39        UINT32  offset;
40        BOOLEAN overrunError;
41};
42
43typedef struct byteBuf byteBuf_t, *byteBufPtr_t;
44
45
46void   byteBufInit         (byteBufPtr_t bt, UINT8 *buf, UINT32 bufSize);
47void   byteBufSetBytesBuf  (byteBufPtr_t bt, UINT8 *buf, UINT16 nBytes);
48void   byteBufSetBytes     (byteBufPtr_t bt, UINT32 data, UINT8 nBytes);
49STATUS byteBufGetBytesBuf  (byteBufPtr_t bt, UINT8 *buf, UINT16 nBytes);
50UINT32 byteBufGetBytes     (byteBufPtr_t bt, UINT8 nBytes);
51void   byteBufSkipBytes    (byteBufPtr_t bt, UINT8 nBytes);
52UINT32 byteBufGetOffset    (byteBufPtr_t bt);
53BOOL   byteBufCheckError   (byteBufPtr_t bt);
54
55
56#define byteBufSet1Byte(bt,d) byteBufSetBytes((bt),(d),1)
57#define byteBufSet2Byte(bt,d) byteBufSetBytes((bt),(d),2)
58#define byteBufSet4Byte(bt,d) byteBufSetBytes((bt),(d),4)
59
60
61//---------------------------------
62// cafrii 041126 add
63//
64/*
65typedef struct xvctChannel
66{
67        UINT16                  short_name[7];
68        UINT16                  major_channel_number;
69        UINT16                  minor_channel_number;
70        modulation_mode_k               modulation_mode;
71        UINT32                  carrier_frequency;
72        UINT16                  channel_TSID;
73        UINT16                  program_number;
74        ETM_location_k          ETM_location;
75        BOOLEAN                 access_controlled;
76        BOOLEAN                 hidden;
77       
78        path_select_k   path_select;   // valid only when cvct
79        BOOLEAN                 out_of_band;   // valid only when cvct
80       
81        BOOLEAN                 processed;
82                // ÀÌ bit´Â user¸¦ À§ÇØ reserve µÇ¾î ÀÖ´Ù.
83                // µðÆúÆ®·Î 0ÀÇ °ªÀ» °¡Áö¸ç, ÇÊ¿äÇÒ ¶§ »ç¿ëµÈ´Ù.
84       
85        BOOLEAN                 show_guide;
86        service_type_k          service_type;
87        UINT16                  source_id;
88        UINT16                  descriptor_length;
89        UINT8*                  descriptors;            // un-parsed descriptors
90       
91} xvctChannel_t, *xvctChannelPtr_t;
92
93
94typedef struct xvct
95{
96        BOOLEAN                 is_cvct;    // 041130, TRUE if cvct..
97
98        UINT16                  transport_stream_id;
99        UINT8                           version_number;
100        UINT8                           numChannels;
101        xvctChannelPtr_t                channel;
102        UINT16                  additional_descriptor_length;
103        UINT8*                  additional_descriptors; // un-parsed descriptors
104       
105} xvct_t, *xvctPtr_t;
106*/
107
108
109void PrintXvct(xvctPtr_t xvctPtr);
110
111
112
113//---------------------------------
114// cafrii 041129 add
115//
116
117typedef struct DmcMainTable_t
118{
119        tvctPtr_t tvct;
120        cvctPtr_t cvct;
121       
122        MPEG_PAT *pat;
123        int num_programs;   
124                // cafrii 041209 add comment
125                // pat->numPrograms ÀÇ °ªÀÇ »çº»..  ¾Æ·¡ pmtList arrayÀÇ Å©±âÀÌ´Ù.
126                // ½ÇÁ¦·Î À̸¸Å­ÀÇ PMT°¡ ´Ù Á¸ÀçÇÏÁö ¾ÊÀ» ¼öµµ ÀÖÀ¸¸ç,
127                // VCTÀÇ subchannel °¹¼öµµ ÀÌ¿Í ´Ù¸¦ ¼öµµ ÀÖ´Ù..
128       
129        MPEG_PMT **pmtList;
130       
131} DmcMainTables;
132
133
134
135
136
137
138// advanced downloading APIs that can be cancelled
139// these functions are variations of GetXxx().
140// these functions are designed to skip current process when command cancelled.
141//
142STATUS Dmc_GetPAT(tDHL_TSD tsd, MPEG_PAT **returnPat, int timeOut, BOOL (*ckfn)());
143STATUS Dmc_GetPMT(tDHL_TSD tsd, UINT16 pid, UINT16 program_number, MPEG_PMT **returnPmt, int timeOut,  BOOL (*ckfn)());
144STATUS Dmc_GetMgtSection(tDHL_TSD tsd, mgtSectionPtr_t *mgtSectPtr, int timeOut, BOOL (*ckfn)());
145STATUS Dmc_GetSttSection(tDHL_TSD tsd, sttSectionPtr_t *sttSectPtr, int timeOut, BOOL (*ckfn)());
146STATUS Dmc_GetTvct(tDHL_TSD tsd, tvctPtr_t *tvctPtr, int timeOut, BOOL (*ckfn)());
147STATUS Dmc_GetCvct(tDHL_TSD tsd, cvctPtr_t *cvctPtr, int timeOut, BOOL (*ckfn)());
148
149STATUS Dmc_GetEit(tDHL_TSD tsd, UINT16 PID, UINT16 source_id, eitPtr_t *eitPtr, int timeOut, BOOL (*ckfn)());
150STATUS Dmc_GetEttSection(tDHL_TSD tsd, UINT16 PID, UINT32 ETM_id, ettSectionPtr_t *ettSectPtr, int timeOut, BOOL (*ckfn)());
151STATUS Dmc_GetRrtSection(tDHL_TSD tsd, UINT8 region, rrtSectionPtr_t *rrtSectPtr, int timeOut, BOOL (*ckfn)());
152
153
154STATUS Dmc_MonitorRrt(tDHL_TSD tsd, tDHL_PSI_Update updateMode, tDHL_PSI_EventProc eventProc, 
155                                                UINT32 userParam, tDHL_PSI_ControlHandle *psiCtl);
156
157STATUS Dmc_RestoreRrt(UINT8 *buffer, rrtSectionPtr_t *prrt);
158        // *prrt should be freeed using FreeAtscTable after use.
159        //
160int    Dmc_FlattenRrt(UINT8 *buffer, int bufsize, rrtSectionPtr_t rrt);
161        // returns total required byte size for flatten.
162        // if buffer is NULL, just calculate required buffer size.
163
164
165
166// Table de-allocation API that makes NULL pointer automatically.
167// it cannot be used for PAT/PMT but FreePAT/FreePMT is recommended in that case..
168// ex:
169//      Dmc_GetTvct(tsd, &tvct, 0, NULL);
170//      Dmc_FreeAtscTable(&tvct);
171//         
172void   Dmc_FreeAtscTable(void *tablePtrPtr);
173
174
175// Simultaneous downloading APIs..
176//
177
178// download (TVCT or CVCT) and PAT at the same time..
179//
180//DHL_RESULT Dmc_GetVctAndPat(tDHL_TSD tsd, tvctPtr_t *tvctPtr, cvctPtr_t *cvctPtr, MPEG_PAT **mpatPtr, int timeOut, BOOL (*ckfn)(UINT32));
181
182//BOOL (*chfn)()À¸·Î º¯°æÇÑ´Ù. caller¿¡¼­ »ç¿ëÇϰí Àִµ¥°¡ ¾ø´Ù.               probability
183STATUS Dmc_GetVctAndPat(tDHL_TSD tsd, tvctPtr_t *tvctPtr, cvctPtr_t *cvctPtr, MPEG_PAT **mpatPtr, int timeOut, BOOL (*ckfn)());
184
185//
186// cafrii 041129 add
187//
188STATUS Dmc_GetMainChannelTables(tDHL_TSD tsd, DmcMainTables *tbls, int timeOut, BOOL (*ckfn)(UINT32));
189void   Dmc_FreeMainChannelTables(DmcMainTables *tbls);
190
191
192//
193// cafrii 050624 add
194//
195STATUS Dmc_GetXvct(tDHL_TSD tsd, xvctPtr_t *xvctPtr, int timeOut, BOOL (*ckfn)(UINT32));
196
197
198// download EITs/ETTs at the same time..
199
200// simple : array of pointer
201STATUS Dmc_GetMultipleEITs(tDHL_TSD tsd, int nEit, UINT16 *aPID, UINT16 *aSourceID, eitPtr_t *aEitPtr, 
202                                                int timeOut, BOOL (*ckfn)(UINT32, UINT32), UINT32 userparam, void (*lockfn)(BOOL));
203STATUS Dmc_GetMultipleETTs(tDHL_TSD tsd, int nETT, UINT16 *aEttPID, UINT32 *aETMID, ettSectionPtr_t *aEttSectPtr, 
204                                                int timeOut, BOOL (*ckfn)(UINT32, UINT32), UINT32 userparam, void (*lockfn)(BOOL));
205
206// complex : array of pointer of pointer
207STATUS Dmc_GetMultipleEITsEx(tDHL_TSD tsd, int nEit, UINT16 *aPID, UINT16 *aSourceID, eitPtr_t **aEitPtrPtr, 
208                                                int timeOut, BOOL (*ckfn)(UINT32, UINT32), UINT32 userparam, void (*lockfn)(BOOL));
209STATUS Dmc_GetMultipleETTsEx(tDHL_TSD tsd, int nETT, UINT16 *aEttPID, UINT32 *aETMID, ettSectionPtr_t **aEttPtrPtr, 
210                                                int timeOut, BOOL (*ckfn)(UINT32, UINT32), UINT32 userparam, void (*lockfn)(BOOL));
211
212
213
214// Relayed multiple Reception API
215STATUS Dmc_GetRelayEITs(tDHL_TSD tsd, int nEit, UINT16 *aPID, UINT16 *aSourceID, eitPtr_t *aEitPtr, 
216                                                        int timeOut, BOOL (*chkfn)(UINT32, UINT32), UINT32 userparam, void (*lockfn)(BOOL));
217STATUS Dmc_GetRelayETTs(tDHL_TSD tsd, int nETT, UINT16 *aEttPID, UINT32 *aETMID, ettSectionPtr_t *aEttSectPtr,
218                                                        int timeOut, BOOL (*ckfn)(UINT32, UINT32), UINT32 userparam, void (*lockfn)(BOOL));
219
220STATUS Dmc_GetRelayEITsEx(tDHL_TSD tsd, int nEit, UINT16 *aPID, UINT16 *aSourceID, eitPtr_t **aEitPtrPtr, 
221                                                                int timeOut, BOOL (*chkfn)(UINT32, UINT32), UINT32 userparam, void (*lockfn)(BOOL));
222STATUS Dmc_GetRelayETTsEx(tDHL_TSD tsd, int nETT, UINT16 *aEttPID, UINT32 *aETMID, ettSectionPtr_t **aEttPtrPtr,
223                                                        int timeOut, BOOL (*ckfn)(UINT32, UINT32), UINT32 userparam, void (*lockfn)(BOOL));
224
225
226
227// cafrii 041126 add
228STATUS Dmc_TranslateCvct (cvctPtr_t cvctPtr, xvctPtr_t *xvctPtr);
229STATUS Dmc_TranslateTvct (tvctPtr_t tvctPtr, xvctPtr_t *xvctPtr);
230
231
232
233void Dmc_RegisterChannelDemuxSymbols(void);
234
235
236
237
238#endif // __DMW_CHANNELDEMUX_H__
239
240
241/********************************************************************
242   $Log: DMW_ChannelDemux.h,v $
243
244        1.01 2004/11/30  is_cvct À§Ä¡ À̵¿
245        1.00 2004/11/29  History °ü¸® ½ÃÀÛ
246
247********************************************************************/
Note: See TracBrowser for help on using the repository browser.