source: svn/newcon3bcm2_21bu/nexus/app/ch_map.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: 6.4 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2006, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile:  $
11 * $brcm_Revision:  $
12 * $brcm_Date: $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log:  $
19 *
20 ***************************************************************************/
21#ifndef CH_MAP_H__
22#define CH_MAP_H__
23
24#include "bapp_task.h"
25
26#define MAX_FREQ_MAP    0xFF
27#define MAX_VCH_LEN             16
28#define MAX_VCH                 512
29#define MAX_AUDIO_PIDS  4
30
31/*
32 * Entry in modulation table built from MMS records in NIT
33 */
34
35typedef struct mms_t
36{
37        unsigned char idx;                      /* Frequency Index */
38        unsigned char code_rate;        /* Inner Coding Rate */
39        unsigned char modulation;       /* Modulation Format */
40        unsigned int symbol_rate;       /* Symbol rate */
41}mms_t;
42
43/*
44 * MMS table built from MMS records in NIT
45 */
46
47typedef struct mms_map_t
48{
49        unsigned char num_mms;  /* Number of mms structures in table */
50        mms_t   mms[MAX_FREQ_MAP];
51}mms_map_t;
52
53/*
54 * Entry in frequency table built from CDS records in NIT
55 */
56
57typedef struct freq_t
58{
59        unsigned char idx;                      /* Frequency Index */
60    unsigned int freq_khz;     /* Frequency in KHz */
61}freq_t;
62
63/*
64 * Frequency table built from CDS records in NIT
65 */
66
67typedef struct freq_map_t
68{
69        unsigned char num_freq; /* Number of frequencies in table */
70        freq_t  freq[MAX_FREQ_MAP];
71}freq_map_t;
72
73/*
74 * Source text entry build from NTT
75 */
76
77typedef struct st_t
78{
79        unsigned short source_id;                       /* Source ID identifying program source */
80        unsigned char name[MAX_VCH_LEN + 1];/* NULL terminated source name */
81}st_t;
82
83/*
84 * Frequency table built from CDS records in NIT
85 */
86
87typedef struct st_map_t
88{
89        unsigned short num_st;  /* Number of source text entries in table */
90        st_t    st[MAX_VCH];
91}st_map_t;
92
93/*
94 * Entry in virtual channel table built from VCM records in SVCT
95 */
96
97typedef struct vch_t
98{
99    unsigned short ch_num;              /* Virtual channel number */
100        unsigned short source_id;                       /* Source ID identifying program source */
101        unsigned short program_num;             /* program number in PMT */
102        unsigned char freq_idx;                         /* frequency index in frequency  */
103        unsigned char mms_idx;                      /* mms index  */
104    unsigned char vchflags;             /* non-zero indicates hidden channel  */
105        unsigned char num_audio;
106        unsigned char cur_audio;
107        unsigned short pcr_pid;
108        unsigned short scte127_pid;
109        unsigned short video_pid;
110        unsigned char video_type;
111        unsigned short ca_pid;
112        unsigned short audio_pid[MAX_AUDIO_PIDS];
113        unsigned char audio_type[MAX_AUDIO_PIDS];
114        char audio_lang[MAX_AUDIO_PIDS][3];
115}vch_t;
116
117/*
118 * virtual channel table built from VCM records in SVCT
119 */
120
121typedef struct vch_map_t
122{
123        unsigned short num_vch;         /* Number of virtual channels in table */
124        vch_t vch[MAX_VCH];                     /* table of virtual channels */
125}vch_map_t;
126
127/*
128 * Structure for managing and maintaining the frequency and channel maps
129 */
130
131typedef struct ch_map_t
132{
133    bapp_task_mutex_t       p_mutex;
134        unsigned short  cur_ch;         /* current channel */
135        mms_map_t       mms_map;                /* MMS map structure */
136        freq_map_t      freq_map;               /* frequency map structure */
137        st_map_t        st_map;                 /* source text map structure */
138        vch_map_t       vch_map;                /* virtual channel map */
139}ch_map_t;
140
141#ifdef __cplusplus
142extern "C" {
143#endif
144
145/*
146Summary:
147        Initialize channel map mgmt internals (structure may already be initialized).
148*/
149void ch_map_init(ch_map_t *p_ch_map,bapp_task_mutex_t handle);
150
151/*
152Summary:
153        reset channel map mgmt internals.
154*/
155void ch_map_reset(ch_map_t *p_ch_map);
156/*
157Summary:
158        copy channel map.
159*/
160void ch_map_copy(ch_map_t *p_ch_map_to,ch_map_t *p_ch_map_from,unsigned int flags);
161/*
162Summary:
163        compare channel map settings.
164*/
165unsigned int ch_map_cmp(ch_map_t *p_ch_map_to,ch_map_t *p_ch_map_from);
166int ch_map_cmp_st(st_map_t      *p_map_to, st_map_t *p_map_from);
167int ch_map_cmp_vch(vch_map_t    *p_map_to, vch_map_t *p_map_from);
168int ch_map_cmp_freq(freq_map_t  *p_freq_map_to, freq_map_t *p_freq_map_from);
169int ch_map_cmp_mms(mms_map_t    *p_mms_map_to, mms_map_t *p_mms_map_from);
170
171/*
172Summary:
173        Add a frequency entry.
174*/
175void ch_map_add_freq(ch_map_t *p_ch_map, freq_t *p_freq);
176
177/*
178Summary:
179        Add an mms entry.
180*/
181void ch_map_add_mms(ch_map_t *p_ch_map, mms_t *p_mms);
182
183/*
184Summary:
185        Find the matching freqency info for the given the vch reference.
186*/
187bool ch_map_find_freq(ch_map_t *p_ch_map, vch_t *p_vch, freq_t *p_freq);
188
189/*
190Summary:
191        Add a virtual channel entry.
192*/
193void ch_map_add_vch(ch_map_t *p_ch_map, vch_t *p_vch);
194
195/*
196Summary:
197        Add a source text entry.
198*/
199void ch_map_add_st(ch_map_t *p_ch_map, st_t     *p_st);
200/*
201Summary:
202        Get number of map entries.
203*/
204void ch_map_get_counts(ch_map_t *p_ch_map, 
205                                           unsigned short *num_vch, 
206                                           unsigned short *num_st,
207                                           unsigned char *num_freq
208                                           );
209/*
210Summary:
211        Get number of vch entries.
212*/
213void ch_map_get_vch_num(ch_map_t *p_ch_map, 
214                                           unsigned short *num_vch
215                                           );
216/*
217Summary:
218        Get mms for frequency idx.
219*/
220bool ch_map_get_mms(ch_map_t *p_ch_map, 
221                                        unsigned char mms_idx,
222                                        mms_t *p_mms
223                                        );
224
225
226
227/*
228Summary:
229        Get current channel information.
230*/
231bool ch_map_get_current(ch_map_t *p_ch_map, vch_t *p_vch, st_t  *p_st, freq_t *p_freq);
232
233/*
234Summary:
235        Get next channel information.
236*/
237bool ch_map_set_next(ch_map_t *p_ch_map);
238
239/*
240Summary:
241        Get prev channel information.
242*/
243bool ch_map_set_prev(ch_map_t *p_ch_map);
244
245/*
246Summary:
247        Return true if the channel is not a hidden channel.
248*/
249bool ch_map_is_channel_visible(ch_map_t *p_ch_map,  unsigned short ch_num);
250
251/*
252Summary:
253        Get channel information by number.
254*/
255bool ch_map_set_ch(ch_map_t *p_ch_map, unsigned short ch_num);
256/*
257Summary:
258        Set current channel given source ID.
259*/
260bool ch_map_set(ch_map_t *p_ch_map,unsigned short source_id);
261/*
262Summary:
263        Update the channel current channel info.
264*/
265
266bool ch_map_vch_update(ch_map_t *p_ch_map, vch_t *p_vch);
267
268/*
269Summary:
270        try to find a source ID from the frequency vector and program number (for EAS major/minor ch#).
271*/
272bool ch_map_find_soure_id(ch_map_t *p_ch_map,
273                                 unsigned char freq_vec, 
274                                 unsigned short prog_num, 
275                                 unsigned short *p_source_id
276                                 );
277
278/*
279Summary:
280        Output details to console.
281*/
282void ch_output(ch_map_t *p_ch_map);
283
284#ifdef __cplusplus
285}
286#endif
287
288#endif /* CH_MAP_H__ */
289
290
Note: See TracBrowser for help on using the repository browser.