| | 87 | /***************************************************************************** |
|---|
| | 88 | * GetTypeName |
|---|
| | 89 | *****************************************************************************/ |
|---|
| | 90 | char* GetTypeName(uint8_t type) |
|---|
| | 91 | { |
|---|
| | 92 | switch (type) |
|---|
| | 93 | { |
|---|
| | 94 | case 0x00: |
|---|
| | 95 | return "Reserved"; |
|---|
| | 96 | case 0x01: |
|---|
| | 97 | return "ISO/IEC 11172 Video"; |
|---|
| | 98 | case 0x02: |
|---|
| | 99 | return "ISO/IEC 13818-2 Video"; |
|---|
| | 100 | case 0x03: |
|---|
| | 101 | return "ISO/IEC 11172 Audio"; |
|---|
| | 102 | case 0x04: |
|---|
| | 103 | return "ISO/IEC 13818-3 Audio"; |
|---|
| | 104 | case 0x05: |
|---|
| | 105 | return "ISO/IEC 13818-1 Private Section"; |
|---|
| | 106 | case 0x06: |
|---|
| | 107 | return "ISO/IEC 13818-1 Private PES data packets"; |
|---|
| | 108 | case 0x07: |
|---|
| | 109 | return "ISO/IEC 13522 MHEG"; |
|---|
| | 110 | case 0x08: |
|---|
| | 111 | return "ISO/IEC 13818-1 Annex A DSM CC"; |
|---|
| | 112 | case 0x09: |
|---|
| | 113 | return "H222.1"; |
|---|
| | 114 | case 0x0A: |
|---|
| | 115 | return "ISO/IEC 13818-6 type A"; |
|---|
| | 116 | case 0x0B: |
|---|
| | 117 | return "ISO/IEC 13818-6 type B"; |
|---|
| | 118 | case 0x0C: |
|---|
| | 119 | return "ISO/IEC 13818-6 type C"; |
|---|
| | 120 | case 0x0D: |
|---|
| | 121 | return "ISO/IEC 13818-6 type D"; |
|---|
| | 122 | case 0x0E: |
|---|
| | 123 | return "ISO/IEC 13818-1 auxillary"; |
|---|
| | 124 | default: |
|---|
| | 125 | if (type < 0x80) |
|---|
| | 126 | return "ISO/IEC 13818-1 reserved"; |
|---|
| | 127 | else |
|---|
| | 128 | return "User Private"; |
|---|
| | 129 | } |
|---|
| | 130 | } |
|---|
| | 131 | |
|---|
| | 132 | /***************************************************************************** |
|---|
| | 133 | * DumpMaxBitrateDescriptor |
|---|
| | 134 | *****************************************************************************/ |
|---|
| | 135 | void DumpMaxBitrateDescriptor(dvbpsi_max_bitrate_dr_t* bitrate_descriptor) |
|---|
| | 136 | { |
|---|
| | 137 | printf("Bitrate: %d\n", bitrate_descriptor->i_max_bitrate); |
|---|
| | 138 | } |
|---|
| | 139 | |
|---|
| | 140 | /***************************************************************************** |
|---|
| | 141 | * DumpSystemClockDescriptor |
|---|
| | 142 | *****************************************************************************/ |
|---|
| | 143 | void DumpSystemClockDescriptor(dvbpsi_system_clock_dr_t* p_clock_descriptor) |
|---|
| | 144 | { |
|---|
| | 145 | printf("External clock: %s, Accuracy: %E\n", |
|---|
| | 146 | p_clock_descriptor->b_external_clock_ref ? "Yes" : "No", |
|---|
| | 147 | p_clock_descriptor->i_clock_accuracy_integer * |
|---|
| | 148 | pow(10, p_clock_descriptor->i_clock_accuracy_exponent)); |
|---|
| | 149 | } |
|---|
| | 150 | |
|---|
| | 151 | /***************************************************************************** |
|---|
| | 152 | * DumpStreamIdentifierDescriptor |
|---|
| | 153 | *****************************************************************************/ |
|---|
| | 154 | void DumpStreamIdentifierDescriptor(dvbpsi_stream_identifier_dr_t* p_si_descriptor) |
|---|
| | 155 | { |
|---|
| | 156 | printf("Component tag: %d\n", |
|---|
| | 157 | p_si_descriptor->i_component_tag); |
|---|
| | 158 | } |
|---|
| | 159 | |
|---|
| | 160 | /***************************************************************************** |
|---|
| | 161 | * DumpSubtitleDescriptor |
|---|
| | 162 | *****************************************************************************/ |
|---|
| | 163 | void DumpSubtitleDescriptor(dvbpsi_subtitling_dr_t* p_subtitle_descriptor) |
|---|
| | 164 | { |
|---|
| | 165 | int a; |
|---|
| | 166 | |
|---|
| | 167 | printf("%d subtitles,\n", p_subtitle_descriptor->i_subtitles_number); |
|---|
| | 168 | for (a = 0; a < p_subtitle_descriptor->i_subtitles_number; ++a) |
|---|
| | 169 | { |
|---|
| | 170 | printf(" | %d - lang: %c%c%c, type: %d, cpid: %d, apid: %d\n", a, |
|---|
| | 171 | p_subtitle_descriptor->p_subtitle[a].i_iso6392_language_code[0], |
|---|
| | 172 | p_subtitle_descriptor->p_subtitle[a].i_iso6392_language_code[1], |
|---|
| | 173 | p_subtitle_descriptor->p_subtitle[a].i_iso6392_language_code[2], |
|---|
| | 174 | p_subtitle_descriptor->p_subtitle[a].i_subtitling_type, |
|---|
| | 175 | p_subtitle_descriptor->p_subtitle[a].i_composition_page_id, |
|---|
| | 176 | p_subtitle_descriptor->p_subtitle[a].i_ancillary_page_id); |
|---|
| | 177 | } |
|---|
| | 178 | } |
|---|
| 88 | | int i; |
|---|
| 89 | | printf("%s 0x%02x : \"", str, p_descriptor->i_tag); |
|---|
| 90 | | for(i = 0; i < p_descriptor->i_length; i++) |
|---|
| 91 | | printf("%c", p_descriptor->p_data[i]); |
|---|
| 92 | | printf("\"\n"); |
|---|
| | 189 | printf("%s 0x%02x : ", str, p_descriptor->i_tag); |
|---|
| | 190 | switch (p_descriptor->i_tag) |
|---|
| | 191 | { |
|---|
| | 192 | case SYSTEM_CLOCK_DR: |
|---|
| | 193 | DumpSystemClockDescriptor(dvbpsi_DecodeSystemClockDr(p_descriptor)); |
|---|
| | 194 | break; |
|---|
| | 195 | case MAX_BITRATE_DR: |
|---|
| | 196 | DumpMaxBitrateDescriptor(dvbpsi_DecodeMaxBitrateDr(p_descriptor)); |
|---|
| | 197 | break; |
|---|
| | 198 | case STREAM_IDENTIFIER_DR: |
|---|
| | 199 | DumpStreamIdentifierDescriptor(dvbpsi_DecodeStreamIdentifierDr(p_descriptor)); |
|---|
| | 200 | break; |
|---|
| | 201 | case SUBTITLING_DR: |
|---|
| | 202 | DumpSubtitleDescriptor(dvbpsi_DecodeSubtitlingDr(p_descriptor)); |
|---|
| | 203 | break; |
|---|
| | 204 | default: |
|---|
| | 205 | printf("\""); |
|---|
| | 206 | for(i = 0; i < p_descriptor->i_length; i++) |
|---|
| | 207 | printf("%c", p_descriptor->p_data[i]); |
|---|
| | 208 | printf("\"\n"); |
|---|
| | 209 | } |
|---|