| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2008, 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: psip_descriptor.h $ |
|---|
| 11 | * $brcm_Revision: 2 $ |
|---|
| 12 | * $brcm_Date: 5/8/08 1:48p $ |
|---|
| 13 | * |
|---|
| 14 | * [File Description:] |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /BSEAV/lib/mpeg2_ts_parse/psip_descriptor.h $ |
|---|
| 19 | * |
|---|
| 20 | * 2 5/8/08 1:48p tokushig |
|---|
| 21 | * PR42421: fixed issue with interpretation of cc_type field of caption |
|---|
| 22 | * service descriptor. added parse routines for genre descriptor |
|---|
| 23 | * |
|---|
| 24 | * 1 2/7/05 11:25p dlwin |
|---|
| 25 | * Merge down for release 2005_REFSW_MERGETOMAIN: |
|---|
| 26 | * |
|---|
| 27 | * Irvine_BSEAVSW_Devel/1 8/29/03 5:03p marcusk |
|---|
| 28 | * Initial Version. |
|---|
| 29 | * |
|---|
| 30 | ***************************************************************************/ |
|---|
| 31 | #ifndef PSIP_DESCRIPTOR_H__ |
|---|
| 32 | #define PSIP_DESCRIPTOR_H__ |
|---|
| 33 | |
|---|
| 34 | #ifdef __cplusplus |
|---|
| 35 | extern "C" { |
|---|
| 36 | #endif |
|---|
| 37 | |
|---|
| 38 | #include "psip_common.h" |
|---|
| 39 | |
|---|
| 40 | typedef struct |
|---|
| 41 | { |
|---|
| 42 | uint8_t descriptor_tag; |
|---|
| 43 | uint8_t descriptor_length; |
|---|
| 44 | } PSIP_descriptor_header; |
|---|
| 45 | |
|---|
| 46 | /* |
|---|
| 47 | |
|---|
| 48 | Caption Service Descriptor (0x86) |
|---|
| 49 | |
|---|
| 50 | */ |
|---|
| 51 | |
|---|
| 52 | typedef struct |
|---|
| 53 | { |
|---|
| 54 | uint8_t language[3]; |
|---|
| 55 | bool cc_type; |
|---|
| 56 | union |
|---|
| 57 | { |
|---|
| 58 | bool line21_field; |
|---|
| 59 | uint8_t caption_service_number; |
|---|
| 60 | } cc; |
|---|
| 61 | bool easy_reader; |
|---|
| 62 | bool wide_aspect_ratio; |
|---|
| 63 | } PSIP_CSD_service; |
|---|
| 64 | |
|---|
| 65 | uint8_t PSIP_CSD_getNumServices( TS_PSI_descriptor descriptor ); |
|---|
| 66 | BERR_Code PSIP_CSD_getService( TS_PSI_descriptor descriptor, int serviceNum, PSIP_CSD_service *p_service ); |
|---|
| 67 | |
|---|
| 68 | /* |
|---|
| 69 | |
|---|
| 70 | Content Advisory Descriptor (0x87) |
|---|
| 71 | |
|---|
| 72 | */ |
|---|
| 73 | |
|---|
| 74 | typedef struct |
|---|
| 75 | { |
|---|
| 76 | uint8_t rating_region; |
|---|
| 77 | uint8_t rated_dimensions; |
|---|
| 78 | const uint8_t *p_rating_description_text; |
|---|
| 79 | } PSIP_CAD_rating_region; |
|---|
| 80 | |
|---|
| 81 | typedef struct |
|---|
| 82 | { |
|---|
| 83 | uint8_t rating_dimension_j; |
|---|
| 84 | uint8_t rating_value; |
|---|
| 85 | } PSIP_CAD_rating_dimension; |
|---|
| 86 | |
|---|
| 87 | uint8_t PSIP_CAD_getRatingRegionCount( TS_PSI_descriptor descriptor ); |
|---|
| 88 | BERR_Code PSIP_CAD_getRatingRegion( TS_PSI_descriptor descriptor, int ratingRegionNum, PSIP_CAD_rating_region *p_ratingRegion ); |
|---|
| 89 | BERR_Code PSIP_CAD_getRatingDimension( TS_PSI_descriptor descriptor, int ratingRegionNum, int ratingDimensionNum, PSIP_CAD_rating_dimension *p_ratingDimension ); |
|---|
| 90 | |
|---|
| 91 | /* |
|---|
| 92 | |
|---|
| 93 | Extended Channel Name Descriptor (0xA0) |
|---|
| 94 | |
|---|
| 95 | */ |
|---|
| 96 | |
|---|
| 97 | PSIP_MSS_string PSIP_ECND_getLongChannelName( TS_PSI_descriptor descriptor ); |
|---|
| 98 | |
|---|
| 99 | /* |
|---|
| 100 | |
|---|
| 101 | Service Location Descriptor (0xA1) |
|---|
| 102 | |
|---|
| 103 | */ |
|---|
| 104 | |
|---|
| 105 | typedef struct |
|---|
| 106 | { |
|---|
| 107 | uint16_t PCR_PID; |
|---|
| 108 | uint8_t number_elements; |
|---|
| 109 | } PSIP_SLD_header; |
|---|
| 110 | |
|---|
| 111 | typedef struct |
|---|
| 112 | { |
|---|
| 113 | uint8_t stream_type; |
|---|
| 114 | uint16_t elementary_PID; |
|---|
| 115 | uint8_t ISO_639_language_code[3]; |
|---|
| 116 | } PSIP_SLD_element; |
|---|
| 117 | |
|---|
| 118 | void PSIP_SLD_getHeader( TS_PSI_descriptor descriptor, PSIP_SLD_header *p_header ); |
|---|
| 119 | BERR_Code PSIP_SLD_getElement( TS_PSI_descriptor descriptor, int elementNum, PSIP_SLD_element *p_element ); |
|---|
| 120 | |
|---|
| 121 | /* |
|---|
| 122 | |
|---|
| 123 | Time-Shifted Service Descriptor (0xA2) |
|---|
| 124 | |
|---|
| 125 | */ |
|---|
| 126 | |
|---|
| 127 | typedef struct |
|---|
| 128 | { |
|---|
| 129 | uint16_t time_shift; |
|---|
| 130 | uint16_t major_channel_number; |
|---|
| 131 | uint16_t minor_channel_number; |
|---|
| 132 | } PSIP_TSSD_service; |
|---|
| 133 | |
|---|
| 134 | uint8_t PSIP_TSSD_getNumServices( TS_PSI_descriptor descriptor ); |
|---|
| 135 | BERR_Code PSIP_TSSD_getService( TS_PSI_descriptor descriptor, int serviceNum, PSIP_TSSD_service *p_service ); |
|---|
| 136 | |
|---|
| 137 | /* |
|---|
| 138 | |
|---|
| 139 | Component Name Descriptor (0xA3) |
|---|
| 140 | |
|---|
| 141 | */ |
|---|
| 142 | |
|---|
| 143 | PSIP_MSS_string PSIP_CND_getComponentName( TS_PSI_descriptor descriptor ); |
|---|
| 144 | |
|---|
| 145 | /* |
|---|
| 146 | |
|---|
| 147 | DCC Departing Request Descriptor (0xA8) and DCC Arriving Request Descriptor (0xA9) |
|---|
| 148 | |
|---|
| 149 | */ |
|---|
| 150 | |
|---|
| 151 | typedef enum |
|---|
| 152 | { |
|---|
| 153 | PSIP_DCC_RD_cancel = 1, |
|---|
| 154 | PSIP_DCC_RD_10_seconds, |
|---|
| 155 | PSIP_DCC_RD_indefinite |
|---|
| 156 | } PSIP_DCC_RD_type; |
|---|
| 157 | |
|---|
| 158 | typedef struct |
|---|
| 159 | { |
|---|
| 160 | PSIP_DCC_RD_type dcc_request_type; |
|---|
| 161 | const uint8_t *p_dcc_request_text; |
|---|
| 162 | } PSIP_DCC_RD_request; |
|---|
| 163 | |
|---|
| 164 | void PSIP_DCC_RD_getRequest( uint8_t *descriptor, PSIP_DCC_RD_request *p_request ); |
|---|
| 165 | |
|---|
| 166 | /* |
|---|
| 167 | |
|---|
| 168 | Redistribution Control Descriptor (0xAA) |
|---|
| 169 | |
|---|
| 170 | */ |
|---|
| 171 | |
|---|
| 172 | void PSIP_RCD_getRcInformation( TS_PSI_descriptor descriptor, uint8_t *p_numBytes, const uint8_t **pp_rc_information ); |
|---|
| 173 | |
|---|
| 174 | /* |
|---|
| 175 | |
|---|
| 176 | Genre Descriptor (0xAB) |
|---|
| 177 | |
|---|
| 178 | */ |
|---|
| 179 | |
|---|
| 180 | typedef uint8_t PSIP_GD_Genre; |
|---|
| 181 | |
|---|
| 182 | uint8_t PSIP_GD_getNumGenres( TS_PSI_descriptor descriptor ); |
|---|
| 183 | BERR_Code PSIP_GD_getGenre( TS_PSI_descriptor descriptor, int genreNum, PSIP_GD_Genre *p_genre ); |
|---|
| 184 | |
|---|
| 185 | #ifdef __cplusplus |
|---|
| 186 | } |
|---|
| 187 | #endif |
|---|
| 188 | #endif |
|---|
| 189 | /* End of File */ |
|---|