| 1 | /** |
|---|
| 2 | @file |
|---|
| 3 | DLIB_PSIP_Parser.h |
|---|
| 4 | |
|---|
| 5 | @brief |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | */ |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | #ifndef __DLIB_PSIP_PARSER_H__ |
|---|
| 12 | #define __DLIB_PSIP_PARSER_H__ |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | #include "DHL_Demux.h" |
|---|
| 16 | |
|---|
| 17 | #include "DLIB_PSIP.h" |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #ifdef __cplusplus |
|---|
| 21 | extern "C" { |
|---|
| 22 | #endif |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | #if COMMENT |
|---|
| 27 | ____Overview____(){} |
|---|
| 28 | #endif |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | #if COMMENT |
|---|
| 33 | ____Config____(){} |
|---|
| 34 | #endif |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | #if COMMENT |
|---|
| 39 | ____Types____(){} |
|---|
| 40 | #endif |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | #if COMMENT |
|---|
| 46 | ____Defines____(){} |
|---|
| 47 | #endif |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | #if COMMENT |
|---|
| 55 | ____API____(){} |
|---|
| 56 | #endif |
|---|
| 57 | |
|---|
| 58 | /** @brief Frees the memory associated with a section. |
|---|
| 59 | |
|---|
| 60 | @param[in] sectionPtr Pointer to a section. |
|---|
| 61 | */ |
|---|
| 62 | void FreeMpegSection (void *sectionPtr); |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | /** @name Section Parsing functions |
|---|
| 67 | @{ |
|---|
| 68 | The section parsing functions take an unparsed section (as an array of bytes) |
|---|
| 69 | and parses it into a structure representing the fields as defined in the PSIP |
|---|
| 70 | specification. These section structures are found in this header file before |
|---|
| 71 | the API functions. For the STT, MGT, RRT, and ETT tables the parsed section |
|---|
| 72 | represents the complete table because these are specified to be contained |
|---|
| 73 | entirely in a single section. For the multi-section TVCT, CVCT, and EIT tables, |
|---|
| 74 | corresponding table parsing functions (below) exist to offer the option of |
|---|
| 75 | parsing complete tables. |
|---|
| 76 | |
|---|
| 77 | The FreeAtscSection() function frees the memory associated with a PARSED section |
|---|
| 78 | structure. It is the responsibility of the ParseXxxSection() caller to free |
|---|
| 79 | the resulting parsed section structure. |
|---|
| 80 | */ |
|---|
| 81 | DHL_RESULT ParseSttSection (UINT8 *section, sttSectionPtr_t *sttSectionPtr); |
|---|
| 82 | DHL_RESULT ParseMgtSection (UINT8 *section, mgtSectionPtr_t *mgtSectionPtr); |
|---|
| 83 | DHL_RESULT ParseTvctSection (UINT8 *section, tvctSectionPtr_t *tvctSectionPtr); |
|---|
| 84 | DHL_RESULT ParseCvctSection (UINT8 *section, cvctSectionPtr_t *cvctSectionPtr); |
|---|
| 85 | DHL_RESULT ParseRrtSection (UINT8 *section, rrtSectionPtr_t *rrtSectionPtr); |
|---|
| 86 | DHL_RESULT ParseEitSection (UINT8 *section, eitSectionPtr_t *eitSectionPtr); |
|---|
| 87 | DHL_RESULT ParseEttSection (UINT8 *section, ettSectionPtr_t *ettSectionPtr); |
|---|
| 88 | DHL_RESULT ParseDcctSection (UINT8 *section, dcctSectionPtr_t *dccSectionPtr); |
|---|
| 89 | DHL_RESULT ParseDccsctSection (UINT8 *section, dccsctSectionPtr_t *dccsctSectionPtr); |
|---|
| 90 | DHL_RESULT ParseEASSection (UINT8 *section, easSectionPtr_t *easSectionPtr); |
|---|
| 91 | void FreeAtscSection (void *sectionPtr); |
|---|
| 92 | /*@}*/ |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | /** @name Table Parsing functions |
|---|
| 96 | @{ |
|---|
| 97 | The table parsing functions take an array of unparsed sections (as an array of bytes) |
|---|
| 98 | and parses it into a structure representing the fields as defined in the PSIP |
|---|
| 99 | specification. These table structures are found in this header file before |
|---|
| 100 | the API functions. Table parsing function exist only for the multi-section |
|---|
| 101 | TVCT, CVCT, and EIT tables. For the single-section STT, MGT, RRT, and ETT tables, |
|---|
| 102 | the section parsing function should be used. |
|---|
| 103 | |
|---|
| 104 | The FreeAtscTable() function frees the memory associated with a PARSED table |
|---|
| 105 | structure. It is the responsibility of the ParseXxx() caller to free |
|---|
| 106 | the resulting parsed table structure. |
|---|
| 107 | */ |
|---|
| 108 | DHL_RESULT ParseTvct (UINT8 **sectionArr, tvctPtr_t *tvctPtr); |
|---|
| 109 | DHL_RESULT ParseCvct (UINT8 **sectionArr, cvctPtr_t *cvctPtr); |
|---|
| 110 | DHL_RESULT ParseVct (UINT8 **sectionArr, xvctPtr_t *vctPtr); |
|---|
| 111 | DHL_RESULT ParseEit (UINT8 **sectionArr, eitPtr_t *eitPtr); |
|---|
| 112 | void FreeAtscTable (void *tablePtr); |
|---|
| 113 | /*@}*/ |
|---|
| 114 | |
|---|
| 115 | /** @name Descriptor Parsing functions |
|---|
| 116 | @{ |
|---|
| 117 | The descriptor parsing functions take an unparsed descriptor (as an array of bytes) |
|---|
| 118 | and parses it into a structure representing the fields as defined in the PSIP |
|---|
| 119 | specification. These descriptor structures are found in this header file before |
|---|
| 120 | the API functions. |
|---|
| 121 | |
|---|
| 122 | The FreeMpegDescriptor() function (part of the MPEG_SI API) frees the memory |
|---|
| 123 | associated with a PARSED descriptor structure. It is the responsibility of the |
|---|
| 124 | ParseXxxDescriptor() caller to free the resulting parsed descriptor structure. |
|---|
| 125 | */ |
|---|
| 126 | DHL_RESULT ParseAc3AudioStreamDescriptor (UINT8* p, |
|---|
| 127 | ac3AudioStreamDescriptorPtr_t *descripPtr); |
|---|
| 128 | DHL_RESULT ParseCaptionServiceDescriptor (UINT8* p, |
|---|
| 129 | captionServiceDescriptorPtr_t *descripPtr); |
|---|
| 130 | DHL_RESULT ParseContentAdvisoryDescriptor (UINT8* p, |
|---|
| 131 | contentAdvisoryDescriptorPtr_t *descripPtr); |
|---|
| 132 | DHL_RESULT ParseExtendedChannelNameDescriptor (UINT8* p, |
|---|
| 133 | extendedChannelNameDescriptorPtr_t *descripPtr); |
|---|
| 134 | DHL_RESULT ParseServiceLocationDescriptor (UINT8* p, |
|---|
| 135 | serviceLocationDescriptorPtr_t *descripPtr); |
|---|
| 136 | DHL_RESULT ParseTimeShiftedServiceDescriptor (UINT8* p, |
|---|
| 137 | timeShiftedServiceDescriptorPtr_t *descripPtr); |
|---|
| 138 | DHL_RESULT ParseComponentNameDescriptor (UINT8* p, |
|---|
| 139 | componentNameDescriptorPtr_t *descripPtr); |
|---|
| 140 | DHL_RESULT ParseDccDepartingRequestDescriptor (UINT8* p, |
|---|
| 141 | dccDRDescriptorPtr_t *descripPtr); |
|---|
| 142 | DHL_RESULT ParseDccArrivingRequestDescriptor (UINT8* p, |
|---|
| 143 | dccARDescriptorPtr_t *descripPtr); |
|---|
| 144 | DHL_RESULT ParseRedistributionControlDescriptor (UINT8* p, |
|---|
| 145 | rcDescriptorPtr_t *descripPtr); |
|---|
| 146 | /*@}*/ |
|---|
| 147 | |
|---|
| 148 | /** @name Multiple String Parsing |
|---|
| 149 | @{ |
|---|
| 150 | The ParseMultipleString() function is used to parse a MultipleString byte array. |
|---|
| 151 | |
|---|
| 152 | The FreeMultipleString() function frees the memory associated with a PARSED |
|---|
| 153 | MultipleString structure. It is the responsibility of the ParseMultipleString() |
|---|
| 154 | caller to free the parsed MultipleString structure. |
|---|
| 155 | */ |
|---|
| 156 | DHL_RESULT ParseMultipleString (UINT8 *buffer, UINT16 len, multipleStringPtr_t *mStringPtr); |
|---|
| 157 | void FreeMultipleString (multipleStringPtr_t multipleStringPtr); |
|---|
| 158 | /*@}*/ |
|---|
| 159 | |
|---|
| 160 | |
|---|
| 161 | |
|---|
| 162 | |
|---|
| 163 | #ifdef __cplusplus |
|---|
| 164 | } /* extern "C" */ |
|---|
| 165 | #endif |
|---|
| 166 | |
|---|
| 167 | |
|---|
| 168 | |
|---|
| 169 | #endif /* __DLIB_PSIP_PARSER_H__ */ |
|---|
| 170 | |
|---|