source: svn/trunk/zas_dstar/hal/include/dsthalPsiAtscPsip.h @ 2

Last change on this file since 2 was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
File size: 40.4 KB
Line 
1/********************************************************************
2 *
3 * PSI_AtscPsip.h - ATSC A/65 Program and System Information Protocol (PSIP).
4 *
5 * Copyright 2004~ TeraLogic, Inc.
6 * All Rights Reserved
7 *
8 * _Id: PSI_AtscPsip.h ,v 1.0 2004/015/28 jina Exp
9 ********************************************************************/
10
11#ifndef DST_ATSC_PSIP_H
12#define DST_ATSC_PSIP_H
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18
19#ifndef DST_PSI_PROCESS_H
20#include "dsthalPsiProcess.h"
21#endif
22
23#ifndef _DSTHALERROR_H_
24#include "dsthalerror.h"
25#endif
26
27/* definitions */
28#define PSIP_PROTOCOL_VERSION           0x00
29#define PSIP_BASE_PID                           0x1FFB
30
31
32
33#define MAX_SECTION_LENGTH                              4093
34#define CEA_PROTOCOL_VERSION                    0x00
35
36
37/*==============================================================================
38         ATSC Stream Types
39==============================================================================*/
40typedef enum {
41        atsc_a53_audio                  = 0x81,
42        atsc_program_identifier         = 0x85
43} ATSC_stream_type_k;
44
45
46/*==============================================================================
47         ATSC Format Identifiers (for registration_descriptor)
48==============================================================================*/
49typedef enum {
50        atsc_format_identifier          = 0x47413934,
51        ac3_format_identifier           = 0x41432D33
52} ATSC_format_identifier_k;
53
54
55/*==============================================================================
56         Multiple String Structure
57==============================================================================*/
58
59/* Multiple String Structure */
60typedef enum {
61        cm_None                 = 0x00,
62        cm_Huffman_C4C5         = 0x01,
63        cm_Huffman_C6C7         = 0x02
64} compress_type_k;
65
66typedef enum {
67        tm_ISO10646_1_Page_0x00 = 0x00,
68        tm_ISO10646_1_Page_0x01 = 0x01,
69        tm_ISO10646_1_Page_0x02 = 0x02,
70        tm_ISO10646_1_Page_0x03 = 0x03,
71        tm_ISO10646_1_Page_0x04 = 0x04,
72        tm_ISO10646_1_Page_0x05 = 0x05,
73        tm_ISO10646_1_Page_0x06 = 0x06,
74        /* 0x07-0x08 Reserved */
75        tm_ISO10646_1_Page_0x09 = 0x09,
76        tm_ISO10646_1_Page_0x0A = 0x0A,
77        tm_ISO10646_1_Page_0x0B = 0x0B,
78        tm_ISO10646_1_Page_0x0C = 0x0C,
79        tm_ISO10646_1_Page_0x0D = 0x0D,
80        tm_ISO10646_1_Page_0x0E = 0x0E,
81        /* 0x0F Reserved */
82        tm_ISO10646_1_Page_0x10 = 0x10,
83        /* 0x11-0x1F Reserved */
84        tm_ISO10646_1_Page_0x20 = 0x20,
85        tm_ISO10646_1_Page_0x21 = 0x21,
86        tm_ISO10646_1_Page_0x22 = 0x22,
87        tm_ISO10646_1_Page_0x23 = 0x23,
88        tm_ISO10646_1_Page_0x24 = 0x24,
89        tm_ISO10646_1_Page_0x25 = 0x25,
90        tm_ISO10646_1_Page_0x26 = 0x26,
91        tm_ISO10646_1_Page_0x27 = 0x27,
92        /* 0x28-0x2F Reserved */
93        tm_ISO10646_1_Page_0x30 = 0x30,
94        tm_ISO10646_1_Page_0x31 = 0x31,
95        tm_ISO10646_1_Page_0x32 = 0x32,
96        tm_ISO10646_1_Page_0x33 = 0x33,
97        /* 0x34-0x3E Reserved */
98        tm_ISO10646_1_16_bit    = 0x3F,
99        /* 0x40-0xDF Reserved */
100        /* 0xE0-0xFE Private */
101        tm_Not_applicable               = 0xFF
102} text_mode_k;
103
104typedef struct msSegment {
105        compress_type_k         compression_type;
106        text_mode_k                     mode;
107        DS_U8                           number_bytes;
108        DS_U8*                  compress_string_byte;
109} msSegment_t, *msSegmentPtr_t;
110
111typedef struct msString {
112        DS_U32                  ISO639_language_code;
113        DS_U8                           number_segments;
114        msSegmentPtr_t          segment;                        /* array of size 'number_segments' */
115} msString_t, *msStringPtr_t;
116
117typedef struct multipleString {
118        DS_U8                           number_strings;
119        msStringPtr_t           msString;                       /* array of size 'number_strings' */
120} multipleString_t, *multipleStringPtr_t;
121
122
123
124/*==============================================================================
125         PSIP Table IDs
126==============================================================================*/
127typedef enum {
128        tid_master_guide_table          = 0xC7,
129        tid_terr_virtual_chan_table     = 0xC8,
130        tid_cable_virtual_chan_table    = 0xC9,
131        tid_rating_region_table         = 0xCA,
132        tid_event_information_table     = 0xCB,
133        tid_extended_text_table         = 0xCC,
134        tid_system_time_table           = 0xCD,
135        tid_directed_channel_change_table = 0xD3,
136        tid_dcc_selection_code_table = 0xD4,
137        tid_cable_emergency_alert       = 0xD8,
138       
139        // DSMCC PID [Defined in MPEG13818-6, A/90]
140        tid_dsmcc_download_info_indication = 0x3B,
141        tid_dsmcc_download_server_initiate = 0x3B,
142        tid_dsmcc_download_data_block = 0x3C
143} table_id_k;
144
145
146
147/*==============================================================================
148         PSIP Tables
149==============================================================================*/
150
151/* System Time Table (STT) */
152typedef struct daylightSavings {
153        DS_U8                           DS_status;
154        DS_U8                           DS_day_of_month;
155        DS_U8                           DS_hour;
156} daylightSavings_t, *daylightSavingsPtr_t;
157
158typedef struct sttSection {
159        DS_U32                  system_time;
160        DS_U8                           GPS_UTC_offset;
161        daylightSavings_t               daylight_savings;
162        DS_U16                  descriptor_length;
163        DS_U8*                  descriptors;            /* un-parsed descriptors */
164} sttSection_t, *sttSectionPtr_t;
165
166typedef sttSection_t STT;
167
168/* Master Guide Table (MGT) */
169typedef enum {
170        tt_terrestrial_VCT_cni_1        = 0x0000,
171        tt_terrestrial_VCT_cni_0        = 0x0001,
172        tt_cable_VCT_cni_1                      = 0x0002, /* same for LVCT in OOB */
173        tt_cable_VCT_cni_0                      = 0x0003, /* same for LVCT in OOB */
174        tt_channel_ETT                          = 0x0004,
175        /* 0x0005-0x00FF Reserved */
176        tt_SVCT_VCM                 = 0x0010,   
177        tt_SVCT_DCM                         = 0x0011,   
178        tt_SVCT_ICM                             = 0x0012,   
179        /* 0x0013 - 0x001F Reserved */
180        tt_NIT_CDS                                      = 0x0020,
181        tt_NIT_MMS                                      = 0x0021,
182        /* 0x0022 - 0x002F reserved */
183        tt_NTT_SNS                                      = 0x0030,
184        /* 0x0031 - 0x00FF reserved */
185        tt_EIT_min                              = 0x0100,
186        tt_EIT_max                              = 0x017F,
187        /* 0x0180-0x01FF Reserved */
188        tt_event_ETT_min                        = 0x0200,
189        tt_event_ETT_max                        = 0x027F,
190        /* 0x0280-0x0300 Reserved */
191        tt_RRT_region_1                 = 0x0301,
192        tt_RRT_region_255                       = 0x03FF,
193        /* 0x0400-0x0FFF User Private */
194        tt_AEIT_min                             = 0x1000,
195        tt_AEIT_max                                     = 0x10FF,
196        tt_AETT_min                             = 0x1100,
197        tt_AETT_max                                     = 0x11FF
198        /* 0x1200-0xFFFF Reserved */
199} table_type_k;
200
201typedef struct mgtTable {
202        table_type_k            table_type;
203        DS_U16                  table_type_PID;
204        DS_U8                           table_type_version_number;
205        DS_U32                  number_bytes;
206        DS_U16                  descriptor_length;
207        DS_U8*                  descriptors;            /* un-parsed descriptors */
208} mgtTable_t, *mgtTablePtr_t;
209
210typedef struct mgtSection {
211        DS_U16                  map_id; /* only used in OOB */
212        DS_U8                           version_number;
213        DS_U16                  tables_defined;
214        mgtTablePtr_t           table;                  /* array of size 'tables_defined' */
215        DS_U16                  descriptor_length;
216        DS_U8*                  descriptors;            /* un-parsed descriptors */
217        DS_U32                  CRC32;
218} mgtSection_t, *mgtSectionPtr_t;
219
220typedef mgtSection_t MGT;
221
222/* Terrestrial Virtual Channel Table (TVCT) */
223typedef enum {
224        mm_analog                       = 0x01,
225        mm_SCTE_mode_1          = 0x02,
226        mm_SCTE_mode_2          = 0x03,
227        mm_ATSC_8VSB            = 0x04,
228        mm_ATSC_16VSB           = 0x05,
229        /* 0x06-0x7F reserved */
230        mm_private_descriptor   = 0x80
231        /* 0x81-0xFF private */
232} modulation_mode_k;
233       
234typedef enum {
235        ETM_none                        = 0x00,
236        ETM_in_this_PTC         = 0x01,
237        ETM_in_channel_TSID_PTC = 0x02
238} ETM_location_k;
239
240typedef enum {
241        /* 0x00 reserved */
242        st_analog_television                    = 0x01,
243        st_ATSC_digital_television              = 0x02,
244        st_ATSC_audio_only                      = 0x03,
245        st_ATSC_data_broadcast_service  = 0x04
246        /* 0x05-0x3F reserved */
247} service_type_k;
248
249typedef struct tvctChannel {
250        DS_U16                  short_name[7];
251        DS_U16                  major_channel_number;
252        DS_U16                  minor_channel_number;
253        modulation_mode_k               modulation_mode;
254        DS_U32                  carrier_frequency;
255        DS_U16                  channel_TSID;
256        DS_U16                  program_number;
257        ETM_location_k          ETM_location;
258        DS_BOOL                 access_controlled;
259        DS_BOOL                 hidden;
260        DS_BOOL                 show_guide;
261        service_type_k          service_type;
262        DS_U16                  source_id;
263        DS_U16                  descriptor_length;
264        DS_U8*                  descriptors;            /* un-parsed descriptors */
265} tvctChannel_t, *tvctChannelPtr_t;
266
267typedef struct tvctSection {
268        DS_U16                  transport_stream_id;
269        DS_U8                           version_number;
270        DS_U8                           current_next_indicator;
271        DS_U8                           section_number;
272        DS_U8                           last_section_number;
273        DS_U8                           num_channels_in_section;
274        tvctChannelPtr_t                channel;
275        DS_U16                  additional_descriptor_length;
276        DS_U8*                  additional_descriptors; /* un-parsed descriptors */
277} tvctSection_t, *tvctSectionPtr_t;
278
279
280typedef struct tvct {
281        DS_U16                  transport_stream_id;
282        DS_U8                           version_number;
283        DS_U8                           numChannels;
284        tvctChannelPtr_t                channel;
285        DS_U16                  additional_descriptor_length;
286        DS_U8*                  additional_descriptors; /* un-parsed descriptors */
287} tvct_t, *tvctPtr_t;
288
289typedef tvct_t TVCT;
290
291/* Cable Virtual Channel Table (CVCT) */
292typedef enum {
293        ps_path1                = 0,
294        ps_path2                = 1
295} path_select_k;
296
297typedef struct cvctChannel {
298        DS_U16                  short_name[7];
299        DS_U16                  major_channel_number;
300        DS_U16                  minor_channel_number;
301        modulation_mode_k               modulation_mode;
302        DS_U32                  carrier_frequency;
303        DS_U16                  channel_TSID;
304        DS_U16                  program_number;
305        ETM_location_k          ETM_location;
306        DS_BOOL                 access_controlled;
307        DS_BOOL                 hidden;
308        path_select_k           path_select;
309        DS_BOOL                 out_of_band;
310        DS_BOOL                 show_guide;
311        service_type_k          service_type;
312        DS_U16                  source_id;
313        DS_U16                  descriptor_length;
314        DS_U8*                  descriptors;            /* un-parsed descriptors */
315} cvctChannel_t, *cvctChannelPtr_t;
316
317typedef struct cvctSection {
318        DS_U16                  transport_stream_id;
319        DS_U8                           version_number;
320        DS_U8                           current_next_indicator;
321        DS_U8                           section_number;
322        DS_U8                           last_section_number;
323        DS_U8                           num_channels_in_section;
324        cvctChannelPtr_t                channel;
325        DS_U16                  additional_descriptor_length;
326        DS_U8*                  additional_descriptors; /* un-parsed descriptors */
327} cvctSection_t, *cvctSectionPtr_t;
328
329
330typedef struct cvct {
331        DS_U16                  transport_stream_id;
332        DS_U8                           version_number;
333        DS_U8                           numChannels;
334        cvctChannelPtr_t                channel;
335        DS_U16                  additional_descriptor_length;
336        DS_U8*                  additional_descriptors; /* un-parsed descriptors */
337} cvct_t, *cvctPtr_t;
338
339typedef cvct_t  CVCT;
340
341/* Rating Region Table (RRT) */
342typedef enum {
343        rr_Forbidden    = 0x00,
344        rr_United_States        = 0x01
345        /* 0x02-0xFF reserved */
346} rating_region_k;
347
348typedef struct rrtValue {
349        DS_U16                  abbrev_rating_value_length;
350        DS_U8                           *abbrev_rating_value;
351        DS_U16                  rating_value_length;
352        DS_U8                           *rating_value;
353} rrtValue_t, *rrtValuePtr_t;
354       
355typedef struct rrtDimension {
356        DS_U16                  dimension_name_length;
357        DS_U8                           *dimension_name;
358        DS_BOOL                 graduated_scale;
359        DS_U8                           values_defined;
360        rrtValuePtr_t           value;                  /* array of size 'values_defined' */
361} rrtDimension_t, *rrtDimensionPtr_t;
362
363typedef struct rrtSection {
364        rating_region_k         rating_region;
365        DS_U8                           version_number;
366        DS_U16                  rating_region_name_length;
367        DS_U8                           *rating_region_name;
368        DS_U8                           dimensions_defined;
369        rrtDimensionPtr_t               dimension;                      /* array of size 'dimensions_defined' */
370        DS_U16                  descriptor_length;
371        DS_U8*                  descriptors;            /* un-parsed descriptors */
372} rrtSection_t, *rrtSectionPtr_t;
373
374
375typedef rrtSection_t RRT;
376
377/* Event Information Table (EIT) */
378typedef struct eitEvent {
379        DS_U16                  event_id;
380        DS_U32                  start_time;
381        ETM_location_k          ETM_location;
382        DS_U32                  length_in_seconds;
383        DS_U16                  title_length;
384        DS_U8                           *title;
385        DS_U16                  descriptor_length;
386        DS_U8*                  descriptors;            /* un-parsed descriptors */
387} eitEvent_t, *eitEventPtr_t;
388
389typedef struct eitSection {
390        DS_U16                  source_id;
391        DS_U8                           version_number;
392        DS_U8                           section_number;
393        DS_U8                           last_section_number;
394        DS_U8                           num_events_in_section;
395        eitEventPtr_t           event;                  /* array of size 'num_events_in_section' */
396} eitSection_t, *eitSectionPtr_t;
397
398typedef struct eit {
399        DS_U16                  source_id;
400        DS_U8                           version_number;
401        DS_U8                           numEvents;
402        eitEventPtr_t           event;                  /* array of size 'numEvents' */
403} eit_t, *eitPtr_t;
404
405typedef eit_t   EIT;
406
407/* Extended Text Table (ETT) */
408typedef struct ett {
409        DS_U8                           version_number;
410        DS_U32                  ETM_id;
411        DS_U16                  extended_text_message_length;
412        DS_U8                           *extended_text_message;
413} ettSection_t, *ettSectionPtr_t;
414
415typedef ettSection_t    ETT;
416
417/* Directed Channel Change */
418typedef struct dcctTerm {
419        DS_U8                   dcc_selection_type;
420        DS_U64                  dcc_selection_id;
421        DS_U16                  dcc_term_desc_length;
422        DS_U8                   *term_descriptor;
423}dcctTerm_t,*dcctTermPtr_t;
424
425typedef struct dcctTest {
426        DS_U8                   dcc_context;
427        DS_U16                  dcc_from_major_channel;
428        DS_U16                  dcc_from_minor_channel;
429        DS_U16                  dcc_to_major_channel;
430        DS_U16                  dcc_to_minor_channel;
431        DS_U32                  dcc_start_time;
432        DS_U32                  dcc_end_time;
433        DS_U8                   dcc_term_count;
434        dcctTermPtr_t   dcctTerm;
435        DS_U16                  dcc_test_desc_length;
436        DS_U8                   *test_descriptor;
437}dcctTest_t, *dcctTestPtr_t;
438
439
440       
441typedef struct dcctSection {
442        DS_U8                   dcc_subtype;
443        DS_U8                   dcc_id;
444        DS_U8                   version_number;
445        DS_U8                   protocol_version;
446        DS_U8                   dcc_test_count;
447        dcctTestPtr_t   dcctTest;
448        DS_U8                   add_desc_length;
449        DS_U8                   *add_descriptor;
450}dcctSection_t, *dcctSectionPtr_t;
451
452typedef dcctSection_t DCCT;
453
454/* Directed Channel Change Selection Code Table */
455typedef enum {
456        reserved =  0x00,
457        new_genre_category = 0x01,
458        new_state = 0x02,
459        new_county = 0x03
460} dccsct_update_type ;
461typedef struct dccsctUpdate {
462        DS_U8                   updateType;
463        DS_U8                   updateDataLength;
464        DS_U8                   genre_cat_code;
465        DS_U8                   *genre_cat_name_text;
466        DS_U8                   dcc_state_locat_code;
467        DS_U8                   *dcc_state_locat_code_text;
468        DS_U8                   state_code;
469        DS_U16                  dcc_county_locat_code;
470        DS_U8                   *dcc_county_locat_code_text;
471        DS_U16                  dccsct_desc_length;
472        DS_U8                   *dccsct_desc;
473}dccsctUpdate_t,*dccsctUpdatePtr_t;
474
475typedef struct dccsctSection {
476        DS_U8                   dccsct_type;
477        DS_U8                   version_number;
478        DS_U8                   protocol_version;
479        DS_U8                   update_defined;
480        dccsctUpdatePtr_t       dccsctUpdate;
481        DS_U8                   add_desc_length;
482        DS_U8                   *add_desc;
483}dccsctSection_t, *dccsctSectionPtr_t;
484
485typedef dccsctSection_t DCCSCT;
486
487
488
489
490typedef enum alertPriority {
491        AP_TestMessage,         /*discarded by terminal devices*/
492        AP_LowPriority,         /*disregarded if processing the alert would interrupt viewing of an
493                                                 access-controlled service*/
494        AP_MediumPriority,      /*disregarded if processing the alert would interrupt viewing of a
495                                                 pay-per-view event*/
496        AP_HightPriority,       /*processed unconditionally, but can involve text-only display if no
497                                                 audio is available*/
498        AP_MaximumPriority      /*processed unconditionally...with audio service.*/
499} alertPriority;
500
501       
502typedef enum countrySubDivision {
503        CSD_AllorUnspecified,
504        CSD_Northwest,
505        CSD_NortCentral,
506        CSD_NorthEast,
507        CSD_WestCentral,
508        CSD_Central,
509        CSD_EastCentral,
510        CSD_SouthWest,
511        CSD_SouthCentral,
512        CSD_SouthEast
513} countrySubDivision;
514
515typedef struct locationCode {
516        DS_U8                           state_code;                             /*8bits  : 0...99*/
517        DS_U8                           county_subdivision;             /*4bits  : 0...9*/
518        DS_U16                          county_code;                    /*10bits : 0...999*/
519} locatioinCode_t , *locationCodePtr_t;
520
521typedef struct _exception {
522        DS_U8                           in_band_reference;                                      /*1bit*/
523        DS_U16                          exception_major_channel_number;         /*10bits*/
524        DS_U16                          exception_minor_channel_number;         /*10bits*/
525        DS_U16                          exception_OOB_source_ID;                /*10bits*/
526} exception_t , exceptionPtr_t;
527
528typedef struct cableEmergencyAlertSection {
529        DS_U8                           sequence_number;        /*5bits*/
530        DS_U8                           protocol_version;
531        DS_U16                          EAS_Event_ID;
532        DS_U32                          EAS_originator_code;    /*24bits. ASCII characters*/
533        DS_U8                           EAS_event_code_length;
534        DS_U8*                          EAS_event_code;
535        DS_U8                           nature_of_activation_text_length;
536        DS_U8*                          nature_of_activation_text ;
537        DS_U8                           alert_message_time_remaining;   /*seconds range 0...120*/
538        DS_U32                          event_start_time;
539        DS_U16                          event_duration;                                 /*seconds range 0...120*/
540        DS_U8                           alert_priority;                                 /*4 bits*/
541        DS_U16                          details_OOB_source_ID;                 
542        DS_U16                          details_major_channel_number;   /*10 bits*/
543        DS_U16                          details_minor_channel_number;   /*10 bits*/
544        DS_U16                          audio_OOB_source_ID;                    /*16 bits*/
545       
546        DS_U16                          alert_text_length;                              /*16 bits*/
547        DS_U8                           *alert_text;                                    /*multiple string structure*/
548       
549        DS_U8                           location_code_count;
550        locatioinCode_t         *location_code;
551       
552        DS_U8                           exception_count;       
553        exception_t     *exception;
554       
555        DS_U16                          descriptors_length;                                     /*10bits*/
556        DS_U8*                          descriptor;                             
557
558} ceaSection_t, *ceaSectionPtr_t;
559
560typedef ceaSection_t CEA;
561
562
563
564/*==============================================================================
565         PSIP Descriptors
566==============================================================================*/
567
568/* AC-3 Audio Descriptor */
569typedef enum {
570        sr_48kHz                                = 0x0,
571        sr_44kHz                                = 0x1,
572        sr_32kHz                                = 0x2,
573        /* 0x3 reserved */
574        sr_48kHz_or_44kHz                       = 0x4,
575        sr_48kHz_or_32kHz                       = 0x5,
576        sr_44kHz_or_32kHz                       = 0x6,
577        sr_48kHz_or_44kHz_or_32kHz      = 0x7
578} sample_rate_code_k;
579
580typedef enum {
581        br_32kbps                       = 0x00, br_le_32kbps            = 0x20,
582        br_40kbps                       = 0x01, br_le_40kbps            = 0x21,
583        br_48kbps                       = 0x02, br_le_48kbps            = 0x22,
584        br_56kbps                       = 0x03, br_le_56kbps            = 0x23,
585        br_64kbps                       = 0x04, br_le_64kbps            = 0x24,
586        br_80kbps                       = 0x05, br_le_80kbps            = 0x25,
587        br_96kbps                       = 0x06, br_le_96kbps            = 0x26,
588        br_112kbps                      = 0x07, br_le_112kbps           = 0x27,
589        br_128kbps                      = 0x08, br_le_128kbps           = 0x28,
590        br_160kbps                      = 0x09, br_le_160kbps           = 0x29,
591        br_192kbps                      = 0x0A, br_le_192kbps           = 0x2A,
592        br_224kbps                      = 0x0B, br_le_224kbps           = 0x2B,
593        br_256kbps                      = 0x0C, br_le_256kbps           = 0x2C,
594        br_320kbps                      = 0x0D, br_le_320kbps           = 0x2D,
595        br_384kbps                      = 0x0E, br_le_384kbps           = 0x2E,
596        br_448kbps                      = 0x0F, br_le_448kbps           = 0x2F,
597        br_512kbps                      = 0x10, br_le_512kbps           = 0x30,
598        br_576kbps                      = 0x11, br_le_576kbps           = 0x31,
599        br_640kbps                      = 0x12, br_le_640kbps           = 0x32
600} bit_rate_code_k;
601
602typedef enum {
603        sm_not_indicated                = 0x0,
604        sm_not_Dolby_Surround   = 0x1,
605        sm_Dolby_Surround               = 0x2
606        /* 0x3 reserved */
607} surround_mode_k;
608
609typedef enum {
610        bm_main_audio_serv_CM   = 0x0,  /* Complete Main */
611        bm_main_audio_serv_ME   = 0x1,  /* Music and Effects */
612        bm_associated_serv_VI   = 0x2,  /* Visually Impaired */
613        bm_associated_serv_HI   = 0x3,  /* Hearing Impaired */
614        bm_associated_serv_D    = 0x4,  /* Dialog */
615        bm_associated_serv_C    = 0x5,  /* Commentary */
616        bm_associated_serv_E    = 0x6,  /* Emergency */
617        bm_as_VO_or_ma_K                = 0x7           /* Voice Over (acmod=001) or Karaoke (acmod=010-111) */
618} bit_stream_mode_k;
619
620typedef enum {
621        nc_acmod_1_1            = 0x0,
622        nc_acmod_1_0            = 0x1,
623        nc_acmod_2_0            = 0x2,
624        nc_acmod_3_0            = 0x3,
625        nc_acmod_2_1            = 0x4,
626        nc_acmod_3_1            = 0x5,
627        nc_acmod_2_2            = 0x6,
628        nc_acmod_3_2            = 0x7,
629        nc_encoded_1            = 0x8,
630        nc_encoded_le_2         = 0x9,
631        nc_encoded_le_3         = 0xA,
632        nc_encoded_le_4         = 0xB,
633        nc_encoded_le_5         = 0xC,
634        nc_encoded_le_6         = 0xD
635        /* 0xE-0xF reserved */
636} num_channels_k;
637
638typedef enum {
639        lc_unknown              = 0x00, lc_Polish               = 0x20, lc_background   = 0x40, lc_Moldavian    = 0x60,
640        lc_Albanian             = 0x01, lc_Portuguese   = 0x21,                                         lc_Malaysian    = 0x61,
641        lc_Breton               = 0x02, lc_Romanian             = 0x22,                                         lc_Malagasay    = 0x62,
642        lc_Catalan              = 0x03, lc_Romansh              = 0x23,                                         lc_Macedonian   = 0x63,
643        lc_Croatian             = 0x04, lc_Serbian              = 0x24,                                         lc_Laotian              = 0x64,
644        lc_Welsh                = 0x05, lc_Slovak               = 0x25, lc_Zulu         = 0x45, lc_Korean               = 0x65,
645        lc_Czech                = 0x06, lc_Slovene              = 0x26, lc_Vietnamese   = 0x46, lc_Khmer                = 0x66,
646        lc_Danish               = 0x07, lc_Finnish              = 0x27, lc_Uzbek                = 0x47, lc_Kazakh               = 0x67,
647        lc_German               = 0x08, lc_Swedish              = 0x28, lc_Urdu         = 0x48, lc_Kannada              = 0x68,
648        lc_English              = 0x09, lc_Turkish              = 0x29, lc_Ukrainian    = 0x49, lc_Japanese             = 0x69,
649        lc_Spanish              = 0x0A, lc_Flemish              = 0x2A, lc_Thai         = 0x4A, lc_Indonesian   = 0x6A,
650        lc_Esperanto    = 0x0B, lc_Walloon              = 0x2B, lc_Telugu               = 0x4B, lc_Hindi                = 0x6B,
651        lc_Estonian             = 0x0C,                                         lc_Tatar                = 0x4C, lc_Hebrew               = 0x6C,
652        lc_Basque               = 0x0D,                                         lc_Tamil                = 0x4D, lc_Hausa                = 0x6D,
653        lc_Faroese              = 0x0E,                                         lc_Tadzhik              = 0x4E, lc_Gurani               = 0x6E,
654        lc_French               = 0x0F,                                         lc_Swahili              = 0x4F, lc_Gujurati             = 0x6F,
655        lc_Frisian              = 0x10,                                         lc_Sranan_Tongo = 0x50, lc_Greek                = 0x70,
656        lc_Irish                = 0x11,                                         lc_Somali               = 0x51, lc_Georgian             = 0x71,
657        lc_Gaelic               = 0x12,                                         lc_Sinhalese    = 0x52, lc_Fulani               = 0x72,
658        lc_Galician             = 0x13,                                         lc_Shona                = 0x53, lc_Dari         = 0x73,
659        lc_Icelandic    = 0x14,                                         lc_Serbo_Croat  = 0x54, lc_Churash              = 0x74,
660        lc_Italian              = 0x15,                                         lc_Ruthenian    = 0x55, lc_Chinese              = 0x75,
661        lc_Lappish              = 0x16,                                         lc_Russian              = 0x56, lc_Burmese              = 0x76,
662        lc_Latin                = 0x17,                                         lc_Quechua              = 0x57, lc_Bulgarian    = 0x77,
663        lc_Latvian              = 0x18,                                         lc_Pustu                = 0x58, lc_Bengali              = 0x78,
664        lc_Luxembourgian        = 0x19,                                         lc_Punjabi              = 0x59, lc_Belorussian  = 0x79,
665        lc_Lithuanian   = 0x1A,                                         lc_Persian              = 0x5A, lc_Bambora              = 0x7A,
666        lc_Hungarian    = 0x1B,                                         lc_Papamiento   = 0x5B, lc_Azerbijani   = 0x7B,
667        lc_Maltese              = 0x1C,                                         lc_Oriya                = 0x5C, lc_Assamese             = 0x7C,
668        lc_Dutch                = 0x1D,                                         lc_Nepali               = 0x5D, lc_Armenian             = 0x7D,
669        lc_Norwegian    = 0x1E,                                         lc_Ndebele              = 0x5E, lc_Arabic               = 0x7E,
670        lc_Occitan              = 0x1F,                                         lc_Marathi              = 0x5F, lc_Amharic              = 0x7F
671} language_code_k;
672
673typedef enum {
674        tc_UNICODE_2_Byte               = 0,
675        tc_ISO8859_1            = 1
676} text_code_k;
677
678typedef struct ac3AudioStreamDescriptor {
679        sample_rate_code_k      sample_rate_code;
680        DS_U8                           bsid;
681        bit_rate_code_k         bit_rate_code;
682        surround_mode_k         surround_mode;
683        bit_stream_mode_k               bsmod;
684        num_channels_k          num_channels;
685        DS_BOOL                 full_svc;
686        DS_BOOL                 additional_elements1;   /* indicates that more elements are present */
687        language_code_k         langcod;
688        language_code_k         langcod2;               /* present if 1+1 mode */
689        DS_BOOL                 additional_elements2;   /* indicates that more elements are present */
690        union {
691                DS_U8                   mainid;         
692                DS_U8                   asvcflags;
693        } bsmod_ext;
694        DS_U8                           textlen;                /* always zero for ATSC */
695        text_code_k                     text_code;
696        DS_U8*                  text;
697} ac3AudioStreamDescriptor_t, *ac3AudioStreamDescriptorPtr_t;
698               
699
700/* Caption Service Descriptor */
701typedef enum {
702        cct_line21              = 0,
703        cct_advanced    = 1
704} cc_type_k;
705
706typedef enum {
707        l21f_field1             = 0,
708        l21f_field2             = 1
709} line21_field_k;
710
711typedef struct captionService {
712        DS_U32                  language;
713        cc_type_k                       cc_type;
714        union {
715                line21_field_k  line21_field;
716                DS_U8                   caption_service_number;
717        } cc_id;
718        DS_BOOL                 easy_reader;
719        DS_BOOL                 wide_aspect_ratio;
720        DS_BOOL                 korean_code;
721} captionService_t, *captionServicePtr_t;
722
723typedef struct captionServiceDescriptor {
724        DS_U8                           number_of_services;
725        captionServicePtr_t     service;                        /* array of size 'number_of_services' */
726} captionServiceDescriptor_t, *captionServiceDescriptorPtr_t;
727
728
729/* Content Advisory Descriptor */
730typedef struct ratingDimension {
731        DS_U8                           rating_dimension_j;
732        DS_U8                           rating_value;
733} ratingDimension_t, *ratingDimensionPtr_t;
734
735typedef struct ratingRegion {
736        DS_U8                           rating_region;
737        DS_U8                           rated_dimensions;
738        ratingDimensionPtr_t    dimension;                      /* array of size 'rated_dimensions' */
739        DS_U16                  rating_description_length;
740        DS_U8                           *rating_description;
741} ratingRegion_t, *ratingRegionPtr_t;
742 
743typedef struct contentAdvisoryDescriptor {
744        DS_U8                           rating_region_count;
745        ratingRegionPtr_t               rating_region;          /* array of size 'rating_region_count' */
746} contentAdvisoryDescriptor_t, *contentAdvisoryDescriptorPtr_t;
747
748
749/* Extended Channel Name Descriptor */
750typedef struct extendedChannelNameDescriptor {
751        DS_U16                  long_channel_name_length;
752        DS_U8                           *long_channel_name;
753} extendedChannelNameDescriptor_t, *extendedChannelNameDescriptorPtr_t;
754
755
756/* Service Location Descriptor */
757typedef struct slElement {
758        DS_U8                           stream_type;
759        DS_U16                  elementary_PID;
760        DS_U32                  ISO639_language_code;
761} slElement_t, *slElementPtr_t;
762
763typedef struct serviceLocationDescriptor {
764        DS_U16                  PCR_PID;
765        DS_U8                           number_elements;
766        slElementPtr_t          element;                        /* array of size 'number_elements' */
767} serviceLocationDescriptor_t, *serviceLocationDescriptorPtr_t;
768
769
770/* Time Shifted Service Descriptor */
771typedef struct tsService {
772        DS_U16                  time_shift;
773        DS_U16                  major_channel_number;
774        DS_U16                  minor_channel_number;
775} tsService_t, *tsServicePtr_t;
776
777typedef struct timeShiftedServiceDescriptor {
778        DS_U8                           number_of_services;
779        tsServicePtr_t          service;                        /* array of size 'number_of_services' */
780} timeShiftedServiceDescriptor_t, *timeShiftedServiceDescriptorPtr_t;
781
782
783/* Component Name Descriptor */
784typedef struct componentNameDescriptor {
785        DS_U16                  component_name_length;
786        DS_U8                           *component_name;
787} componentNameDescriptor_t, *componentNameDescriptorPtr_t;
788
789/* DCC Departing Request Descriptor */
790typedef struct dccDRDescriptor {
791                DS_U8   dcc_dep_type;
792                DS_U8   dcc_dep_text_length;
793                DS_U8   *dcc_dep_text;
794} *dccDRDescriptorPtr_t,dccDRDescriptor_t;
795
796/* DCC Arriving Request Descriptor */
797typedef struct dccARDescriptor {
798                DS_U8   dcc_arr_type;
799                DS_U8   dcc_arr_text_length;
800                DS_U8   *dcc_arr_text;
801} *dccARDescriptorPtr_t,dccARDescriptor_t;
802
803/* Redistribution Control Descriptor */
804typedef struct rcDescriptor {
805                DS_U8   *rc_information;
806} *rcDescriptorPtr_t,rcDescriptor_t;
807
808/* Emergency Information Descriptor */
809typedef enum {
810        ac_dummy_1              = 0x00, ac_dummy_2              = 0x01, ac_dummy_3              = 0x02,
811        ac_dummy_4              = 0x03, ac_dummy_5              = 0x04, ac_dummy_6              = 0x05,
812        ac_dummy_7              = 0x06, ac_dummy_8              = 0x07, ac_dummy_9              = 0x08
813} area_code_k;
814
815typedef struct areaElement {
816        area_code_k     code;   
817} areaElement_t, *areaElementPtr_t;
818
819typedef struct emergencyService {
820        DS_U16                          service_id;
821        DS_U8                           start_end_flag;
822        DS_U8                           signal_level;
823        DS_U8                           area_code_length;
824        areaElementPtr_t        area_code;
825} emergencyService_t, *emergencyServicePtr_t;
826
827typedef struct eiDescriptor {
828        DS_U16                                  num_services;
829        emergencyServicePtr_t   services;
830} *eiDescriptorPtr_t,eiDescriptor_t;
831
832
833
834
835
836
837
838
839typedef struct privateSection {
840        DS_U8                           section_syntax_indicator;       /*1bit*/
841
842        /*in case of (section_syntax_indicator == '1')*/
843        DS_U16                          table_id_extension;                     /*16bits*/
844        DS_U8                           version_number;                         /*5bits*/
845        DS_U8                           current_next_indicator;         /*1bit*/
846        DS_U8                           section_number;                         /*8bits*/
847        DS_U8                           last_section_number;            /*8bits*/
848       
849        DS_U32                          private_data_length;            /*12bits*/
850        DS_U8*                          private_data_byte;
851
852} prvtSection_t, *prvtSectionPtr_t;
853
854
855typedef struct privateTable {
856        DS_U8                   version_number;                                 /*5bits*/
857        DS_U16                  table_id_extension;                             /*16bits*/
858        DS_U32                  private_data_length;                    /*12bits*/
859        DS_U8                   *private_data_byte;     
860
861} prvt_t , *prvtPtr_t;
862
863typedef prvt_t PRVT;
864
865
866/*==============================================================================
867         API Functions
868==============================================================================*/
869
870/* Section Parsing functions */
871/*------------------------------------------------------------------------------
872The section parsing functions take an unparsed section (as an array of bytes)
873and parses it into a structure representing the fields as defined in the PSIP
874specification.  These section structures are found in this header file before
875the API functions.  For the STT, MGT, RRT, and ETT tables the parsed section
876represents the complete table because these are specified to be contained
877entirely in a single section.  For the multi-section TVCT, CVCT, and EIT tables,
878corresponding table parsing functions (below) exist to offer the option of
879parsing complete tables.
880
881The FreeAtscSection() function frees the memory associated with a PARSED section
882structure.  It is the responsibility of the ParseXxxSection() caller to free
883the resulting parsed section structure.
884------------------------------------------------------------------------------*/
885DHL_RESULT DHL_PSI_ParseSTTSection (DS_U8 *section, sttSectionPtr_t *sttSectionPtr);
886DHL_RESULT DHL_PSI_ParseMGTSection (DS_U8 *section, mgtSectionPtr_t *mgtSectionPtr);
887DHL_RESULT DHL_PSI_ParseTVCTSection (DS_U8 *section, tvctSectionPtr_t *tvctSectionPtr);
888DHL_RESULT DHL_PSI_ParseCVCTSection (DS_U8 *section, cvctSectionPtr_t *cvctSectionPtr);
889DHL_RESULT DHL_PSI_ParseRRTSection (DS_U8 *section, rrtSectionPtr_t *rrtSectionPtr);
890DHL_RESULT DHL_PSI_ParseEITSection (DS_U8 *section, eitSectionPtr_t *eitSectionPtr);
891DHL_RESULT DHL_PSI_ParseETTSection (DS_U8 *section, ettSectionPtr_t *ettSectionPtr);
892DHL_RESULT DHL_PSI_ParseDCCTSection (DS_U8 *section, dcctSectionPtr_t *dccSectionPtr);
893DHL_RESULT DHL_PSI_ParseDCCSCTSection (DS_U8 *section, dccsctSectionPtr_t *dccsctSectionPtr);
894DHL_RESULT DHL_PSI_ParseCEASection(DS_U8 *section , ceaSectionPtr_t *cesSectionPtr );
895
896/* Table Parsing functions */
897/*------------------------------------------------------------------------------
898The table parsing functions take an array of unparsed sections (as an array of bytes)
899and parses it into a structure representing the fields as defined in the PSIP
900specification.  These table structures are found in this header file before
901the API functions.  Table parsing function exist only for the multi-section
902Tvct, Cvct, and Eit tables.  For the single-section Stt, Mgt, Rrt, and Ett tables,
903the section parsing function should be used.
904
905The FreeAtscTable() function frees the memory associated with a PARSED table
906structure.  It is the responsibility of the ParseXxx() caller to free
907the resulting parsed table structure.
908------------------------------------------------------------------------------*/
909DHL_RESULT DHL_PSI_ParseTVCT (DS_U8 **sectionArr, tvctPtr_t *tvctPtr);
910DHL_RESULT DHL_PSI_ParseCVCT (DS_U8 **sectionArr, cvctPtr_t *cvctPtr);
911DHL_RESULT DHL_PSI_ParseEIT (DS_U8 **sectionArr, eitPtr_t *eitPtr);
912DHL_RESULT DHL_PSI_ParsePRVT (DS_U8 **sectionArr, prvtPtr_t *prvtPtr);
913DHL_RESULT DHL_PSI_ParsePRVTSection (DS_U8 *section, prvtSectionPtr_t *prvtSectionPtr);
914
915/* Descriptor Parsing functions */
916/*------------------------------------------------------------------------------
917The descriptor parsing functions take an unparsed descriptor (as an array of bytes)
918and parses it into a structure representing the fields as defined in the PSIP
919specification.  These descriptor structures are found in this header file before
920the API functions.
921
922The FreeMpegDescriptor() function (part of the MPEG_SI API) frees the memory
923associated with a PARSED descriptor structure.  It is the responsibility of the
924ParseXxxDescriptor() caller to free the resulting parsed descriptor structure.
925------------------------------------------------------------------------------*/
926DHL_RESULT DHL_PSI_ParseAc3AudioStreamDescriptor (DS_U8* p,
927                                                        ac3AudioStreamDescriptorPtr_t *descripPtr);
928DHL_RESULT DHL_PSI_ParseCaptionServiceDescriptor (DS_U8* p,
929                                                        captionServiceDescriptorPtr_t *descripPtr);
930DHL_RESULT DHL_PSI_ParseContentAdvisoryDescriptor (DS_U8* p,
931                                                        contentAdvisoryDescriptorPtr_t *descripPtr);
932DHL_RESULT DHL_PSI_ParseExtendedChannelNameDescriptor (DS_U8* p,
933                                                        extendedChannelNameDescriptorPtr_t *descripPtr);
934DHL_RESULT DHL_PSI_ParseServiceLocationDescriptor (DS_U8* p,
935                                                        serviceLocationDescriptorPtr_t *descripPtr);
936DHL_RESULT DHL_PSI_ParseTimeShiftedServiceDescriptor (DS_U8* p,
937                                                        timeShiftedServiceDescriptorPtr_t *descripPtr);
938DHL_RESULT DHL_PSI_ParseComponentNameDescriptor (DS_U8* p,
939                                                        componentNameDescriptorPtr_t *descripPtr);
940DHL_RESULT DHL_PSI_ParseDccDepartingRequestDescriptor (DS_U8* p,
941                                                        dccDRDescriptorPtr_t *descripPtr);
942DHL_RESULT DHL_PSI_ParseDccArrivingRequestDescriptor (DS_U8* p,
943                                                        dccARDescriptorPtr_t *descripPtr);
944DHL_RESULT DHL_PSI_ParseRedistributionControlDescriptor (DS_U8* p,
945                                                        rcDescriptorPtr_t *descripPtr);
946DHL_RESULT DHL_PSI_ParseConditionalAccessDescriptor ( DS_U8* p, 
947                                                                                                   CA_descriptor **desc);
948DHL_RESULT DHL_PSI_ParseEmergencyInformationDescriptorAlter (DS_U8* p,
949                                                        eiDescriptorPtr_t *descripPtr);
950
951/* Multiple String Parsing */
952/*------------------------------------------------------------------------------
953The ParseMultipleString() function is used to parse a MultipleString byte array.
954
955The FreeMultipleString() function frees the memory associated with a PARSED
956MultipleString structure.  It is the responsibility of the ParseMultipleString()
957caller to free the parsed MultipleString structure.
958------------------------------------------------------------------------------*/
959DHL_RESULT DHL_PSI_ParseMultipleString (DS_U8 *buffer, DS_U16 len, multipleStringPtr_t *mStringPtr);
960void DHL_PSI_FreeMultipleString (multipleStringPtr_t multipleStringPtr);
961
962
963/* Huffman Decoding */
964/*------------------------------------------------------------------------------
965The DecodeHuffmanString() function is used to decode a Huffman-compressed string
966found in the Multiple String Structure.  The Huffman coding supports both types
967as defined in the PSIP A/65 document (Title and Description type strings).  The
968compression type using to encode the string (as specified in the Multiple String
969Structure) should be passed to this function.
970
971The text buffer is supplied by the caller of this function.  The length of the
972buffer is specified by the 'textlen' parameter.  A decompressed string that is
973shorter than 'textlen' is terminated with a null character.  A decompressed
974string that is longer than 'textlen' is truncated to 'textlen-1' and terminated
975with a null character.
976------------------------------------------------------------------------------*/
977DHL_RESULT DHL_PSI_DecodeHuffmanString (DS_U8 *compressedStr, DS_U32 length, compress_type_k type,
978                                                        char *text, DS_U32 textlen);
979
980
981/* Asynchronous Monitor calls */
982/*------------------------------------------------------------------------------
983The set of asynchronous monitor functions allow continuous or one-time monitoring
984of ATSC PSIP sections and/or tables.  For a detailed description of these
985parameters, see the explanation in PSI.h.
986
987Parameter Description
988---------------------
989tsd - Specifies from which Transport Stream Demultiplexor the monitored stream is coming
990psiMode -     Specifies the notification type for PSIP sections.  For PSIP
991              applications, one of the following PSIMode options should be
992              used:
993                   sectionMode:     Event triggered for each section received.
994                   tableMode:       Event triggered when a complete table received.
995                   eagerTableMode:  Event triggered for each new section of a
996                                    table as well as an event when the table is
997                                    complete.
998
999For the Stt, Mgt, Rrt, and Ett tables, the PSIMode is internally set to sectionMode
1000because these tables reside within a single section.
1001
1002updateMode -  Specifies the update frequency of the monitor.  For PSIP applications,
1003              one of the following PSIUpdateMode options should be used:
1004                   psiOneShot:      Section or table event triggered only once.
1005                   psiVersionChange:Table trigger reset when version changes.
1006                   psiContinuous:   Sections/Tables continously trigger events.
1007
1008eventProc -   The callback function to receive monitor events.
1009
1010userParam -   A user-specified field which is sent to the eventProc callback
1011              function with events.
1012
1013**psiCtl - Returns a pointer to the Monitor descriptor to the caller.  This identifies the
1014              specific PSI monitor and can be used to cancel a set monitor.
1015------------------------------------------------------------------------------*/
1016DHL_RESULT DHL_PSI_MonitorSTT (DHL_PSI_HANDLE sysInfo, PSIUpdateMode updateMode, PSIEventProc_f eventProc,
1017                                                        DS_U32 userData, DHL_TBL_HANDLE *psiCtl);
1018DHL_RESULT DHL_PSI_MonitorMGT (DHL_PSI_HANDLE sysInfo, PSIUpdateMode updateMode, PSIEventProc_f eventProc,
1019                                                        DS_U32 userData, DHL_TBL_HANDLE *psiCtl);
1020DHL_RESULT DHL_PSI_MonitorTVCT (DHL_PSI_HANDLE sysInfo, PSIMode psiMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc,
1021                                                        DS_U32 userParam, DHL_TBL_HANDLE *psiCtl);
1022DHL_RESULT DHL_PSI_MonitorCVCT (DHL_PSI_HANDLE sysInfo, PSIMode psiMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc,
1023                                                        DS_U32 userParam, DHL_TBL_HANDLE *psiCtl);
1024DHL_RESULT DHL_PSI_MonitorRRT (DHL_PSI_HANDLE sysInfo, DS_U8 region, PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userData,
1025                                                        DHL_TBL_HANDLE *psiCtl);
1026DHL_RESULT DHL_PSI_MonitorEIT (DHL_PSI_HANDLE sysInfo, DS_U16 PID, DS_U16 source_id, PSIMode psiMode, PSIUpdateMode updateMode,
1027                                                        PSIEventProc_f eventProc,DS_U32 userParam, DHL_TBL_HANDLE *psiCtl);
1028DHL_RESULT DHL_PSI_MonitorETT (DHL_PSI_HANDLE sysInfo, DS_U16 PID, DS_U32 ETM_id, PSIUpdateMode updateMode, PSIEventProc_f eventProc,
1029                                                        DS_U32 userData, DHL_TBL_HANDLE *psiCtl);
1030DHL_RESULT DHL_PSI_MonitorDCCT (DHL_PSI_HANDLE sysInfo,  PSIUpdateMode updateMode, PSIEventProc_f eventProc,
1031                                                        DS_U32 userData, DHL_TBL_HANDLE *psiCtl);
1032DHL_RESULT DHL_PSI_MonitorDCCSCT (DHL_PSI_HANDLE sysInfo , PSIUpdateMode updateMode, PSIEventProc_f eventProc,
1033                                                        DS_U32 userData, DHL_TBL_HANDLE *psiCtl);
1034DHL_RESULT DHL_PSI_MonitorCEA(                  DHL_PSI_HANDLE sysInfo ,
1035                                                                                PSIUpdateMode updateMode,
1036                                                                                PSIEventProc_f eventProc,
1037                                                                                DS_U32 userParam,
1038                                                                                DHL_TBL_HANDLE *returnPSICtl);
1039DHL_RESULT DHL_PSI_MonitorPRVT (                DHL_PSI_HANDLE sysInfo ,
1040                                                                                DS_U16 pid,
1041                                                                                DS_U8  tableId,
1042                                                                                PSIMode psiMode,
1043                                                                                PSIUpdateMode updateMode,
1044                                                                                PSIEventProc_f eventProc,
1045                                                                                DS_U32 userParam,
1046                                                                                DS_BOOL bNeedBigSi,
1047                                                                                DHL_TBL_HANDLE *returnPSICtl);
1048DHL_RESULT DHL_PSI_MonitorPRVTEx(       DHL_PSI_HANDLE sysInfo ,
1049                                                                        DS_U16 pid ,
1050                                                                        DS_U8 tableId ,
1051                                                                        DS_U16 groupNumber ,
1052                                                                        PSIMode psiMode ,
1053                                                                        PSIUpdateMode updateMode,
1054                                                                        PSIEventProc_f eventProc,
1055                                                                        DS_U32 userParam ,
1056                                                                        DS_BOOL bNeedBigSi,
1057                                                                        DHL_TBL_HANDLE *returnPSICtl);
1058
1059/* Synchronous calls */
1060/*------------------------------------------------------------------------------
1061The set of synchronous monitor functions allow one-time retrieval of a PSIP
1062section or table.  The function suspends until the data is retrieved from the
1063Transport Stream or until the timeOut period expires.  For the Stt, Mgt, Rrt,
1064and Ett a section is returned.  For the Tvct, Cvct, and Eit, a table is returned.
1065
1066The timeout period 'timeOut' is specified in milliseconds.
1067
1068The parsed section/table must be freed using FreeAtscSection()/FreeAtscTable().
1069------------------------------------------------------------------------------*/
1070DHL_RESULT DHL_PSI_GetSTTSection (DHL_PSI_HANDLE sysInfo, sttSectionPtr_t *sttSectPtr, int timeOut);
1071DHL_RESULT DHL_PSI_GetMGTSection (DHL_PSI_HANDLE sysInfo, mgtSectionPtr_t *mgtSectPtr, int timeOut);
1072DHL_RESULT DHL_PSI_GetRRTSection (DHL_PSI_HANDLE sysInfo, DS_U8 region, rrtSectionPtr_t *rrtSectPtr, int timeOut);
1073DHL_RESULT DHL_PSI_GetETTSection (DHL_PSI_HANDLE sysInfo, DS_U16 PID, DS_U32 ETM_id, ettSectionPtr_t *ettSectPtr, int timeOut);
1074DHL_RESULT DHL_PSI_GetDCCTSection (DHL_PSI_HANDLE sysInfo, dcctSectionPtr_t *dcctSectPtr, int timeOut);
1075DHL_RESULT DHL_PSI_GetDCCSCTSection (DHL_PSI_HANDLE sysInfo, dccsctSectionPtr_t *dccsctSectPtr, int timeOut);
1076
1077DHL_RESULT DHL_PSI_GetTVCT (DHL_PSI_HANDLE sysInfo, tvctPtr_t *tvctPtr, int timeOut);
1078DHL_RESULT DHL_PSI_GetCVCT (DHL_PSI_HANDLE sysInfo, cvctPtr_t *cvctPtr, int timeOut);
1079DHL_RESULT DHL_PSI_GetEIT (DHL_PSI_HANDLE sysInfo, DS_U16 PID, DS_U16 source_id, eitPtr_t *eitPtr, int timeOut);
1080DHL_RESULT DHL_PSI_GetPRVTEx(DHL_PSI_HANDLE sysInfo, DS_U16 pid, DS_U8 tableId , DS_U16 groupNumber , prvtPtr_t *prvtPtr, int timeOut , DS_BOOL bNeedBigSi );
1081DHL_RESULT DHL_PSI_GetPRVT(DHL_PSI_HANDLE sysInfo, DS_U16 pid, DS_U8 tableId , prvtPtr_t *prvtPtr, int timeOut , DS_BOOL bNeedBigSi );
1082DHL_RESULT DHL_PSI_GetCEASection (                              DHL_PSI_HANDLE sysInfo,
1083                                                                                                ceaSectionPtr_t *ceaSectPtr,
1084                                                                                                int timeOut);
1085/*Print function for each table.*/
1086void DHL_PSI_PrintTVCT (tvctPtr_t tvctPtr);
1087void DHL_PSI_PrintCVCT(cvctPtr_t cvctPtr);
1088void DHL_PSI_PrintMGTSection (mgtSectionPtr_t mgtPtr);
1089void DHL_PSI_PrintSTTSection (sttSectionPtr_t sttPtr);
1090void DHL_PSI_PrintEIT (eitPtr_t eitPtr);
1091void DHL_PSI_PrintETTSection (ettSectionPtr_t ettPtr);
1092void DHL_PSI_PrintDCCTSection(dcctSectionPtr_t dcctPtr);
1093void DHL_PSI_PrintDCCSCTSection(dccsctSectionPtr_t dccsctPtr );
1094void DHL_PSI_PrintMultipleString (DS_U8 *buffer, DS_U16 len);
1095void DHL_PSI_PrintPRVT (prvtPtr_t prvtPtr);
1096void DHL_PSI_PrintAc3AudioStreamDescriptor (ac3AudioStreamDescriptorPtr_t descrip);
1097void DHL_PSI_PrintServiceLocationDescriptor (serviceLocationDescriptorPtr_t descrip);
1098void DHL_PSI_PrintExtendedChannelNameDescriptor (extendedChannelNameDescriptorPtr_t descrip);
1099void DHL_PSI_PrintCaptionServiceDescriptor (captionServiceDescriptorPtr_t descrip);
1100void DHL_PSI_PrintContentAdvisoryDescriptor (contentAdvisoryDescriptorPtr_t descrip);
1101void DHL_PSI_PrintDccArrivingRequestDescriptor (dccARDescriptorPtr_t descrip);
1102void DHL_PSI_PrintTimeShiftedServiceDescriptor (timeShiftedServiceDescriptorPtr_t descrip);
1103void DHL_PSI_PrintCEASection( ceaSectionPtr_t ceaPtr );
1104void DHL_PSI_PrintConditionalAccessDescriptor(CA_descriptor *d);
1105void DHL_PSI_PrintEmergencyInformationDescriptorAlter (eiDescriptorPtr_t descrip);
1106
1107//void DHL_PSI_Print
1108
1109DHL_RESULT DHL_PSI_ReadPSIData( DHL_TBL_HANDLE hTblHandle , struct PSIDataArray_t **returnPsi);
1110void DHL_PSI_FreeMpegSection (void *sectionPtr);
1111void DHL_PSI_FreeMpegDescriptor (void *descriptorPtr);
1112void DHL_PSI_FreePSIData( PSIDataArray_t        *desc );
1113
1114
1115DHL_RESULT RFU_GetImageSections ( unsigned int pid , unsigned char tableId );
1116
1117#define DHL_PSI_FreeTVCT(x)     DHL_PSI_FreeMpegSection(x)
1118#define DHL_PSI_FreeCVCT(x)     DHL_PSI_FreeMpegSection(x)
1119#define DHL_PSI_FreeRRT(x)      DHL_PSI_FreeMpegSection(x)
1120#define DHL_PSI_FreeEIT(x)      DHL_PSI_FreeMpegSection(x)
1121#define DHL_PSI_FreeMGT(x)      DHL_PSI_FreeMpegSection(x)
1122#define DHL_PSI_FreeETT(x)      DHL_PSI_FreeMpegSection(x)
1123#define DHL_PSI_FreeSTT(x)      DHL_PSI_FreeMpegSection(x)
1124#define DHL_PSI_FreeDCCT(x)     DHL_PSI_FreeMpegSection(x)
1125#define DHL_PSI_FreeDCCSCT(x)   DHL_PSI_FreeMpegSection(x)
1126#define DHL_PSI_FreeCEA(x)      DHL_PSI_FreeMpegSection(x)
1127#define DHL_PSI_FreeAtscTable(x)        DHL_PSI_FreeMpegSection(x)
1128#define DHL_PSI_FreeAtscSection(x)      DHL_PSI_FreeMpegSection(x)
1129#define DHL_PSI_FreePRVT(x)     DHL_PSI_FreeMpegSection(x)
1130#define DHL_PSI_FreeECMEMM(x)   DHL_PSI_FreeMpegSection(x)
1131
1132DHL_RESULT DHL_PSI_GetDsmccPIDs( MPEG_PMT *pmt, DS_U32 *returnDsmccPID, int *returnDsmccPIDLen );
1133
1134#ifdef __cplusplus
1135}
1136#endif
1137
1138#include "dsthalPsiDsmcc.h"
1139
1140
1141#endif /* DST_ATSC_PSIP_H */
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164/***************************************************************************
1165 *
1166 * Modified Version. PSI_AtscPsip.h Revision.1.0 2004/05/28 jina
1167 * #Add CEA table defintions.
1168 *
1169 *
1170 * ORIGINAL API Definitions from TL8xx ATSC_PSIP.h Revision.1.3 2002/12/24.
1171 *
1172 **************************************************************************/
Note: See TracBrowser for help on using the repository browser.