| | 167 | /** \class BouquetAssociationTable |
| | 168 | * \brief Tells what channels can be found on each transponder |
| | 169 | * for one bouquet (a bunch of channels from one provider) |
| | 170 | * Note: French Provider Canal+ uses this to associate channels |
| | 171 | * with an index used in their proprietary EIT |
| | 172 | */ |
| | 173 | |
| | 174 | class BouquetAssociationTable : public PSIPTable |
| | 175 | { |
| | 176 | public: |
| | 177 | BouquetAssociationTable(const PSIPTable& table) : PSIPTable(table) |
| | 178 | { |
| | 179 | assert(TableID::BAT == TableID()); |
| | 180 | Parse(); |
| | 181 | } |
| | 182 | ~BouquetAssociationTable() { ; } |
| | 183 | |
| | 184 | // table_id 8 0.0 0x4a |
| | 185 | // section_syntax_indicator 1 1.0 1 |
| | 186 | // reserved_future_use 1 1.1 1 |
| | 187 | // reserved 2 1.2 3 |
| | 188 | // section_length 12 1.4 0 |
| | 189 | // Bouquet ID 16 3.0 0 |
| | 190 | // reserved 2 5.0 3 |
| | 191 | // version_number 5 5.2 0 |
| | 192 | // current_next_indicator 1 5.7 1 |
| | 193 | // section_number 8 6.0 0x00 |
| | 194 | // last_section_number 8 7.0 0x00 |
| | 195 | // reserved 4 8 0x0d |
| | 196 | // Bouquet descriptors len 12 8.4 |
| | 197 | // for (i=0;i<N;i++) |
| | 198 | // Descriptor(); |
| | 199 | // reserved 4 10+N.0 |
| | 200 | // Transport stream loop len 12 |
| | 201 | // for (i=0;i<N;i++) { |
| | 202 | // transport_stream_id 16 |
| | 203 | // original_network_id 16 |
| | 204 | // reserved 4 |
| | 205 | // transport descriptor len 12 |
| | 206 | // for (j=0;j<N;j++) |
| | 207 | // Descriptor(); |
| | 208 | // } |
| | 209 | // crc 32 |
| | 210 | uint TSID(uint i) const |
| | 211 | { return _ptrs[i][0] << 8 + _ptrs[i][1]; } |
| | 212 | |
| | 213 | /// original_network_id 16 8.0 |
| | 214 | uint OriginalNetworkID(uint i) const |
| | 215 | { return _ptrs[i][2] << 8 + _ptrs[i][3]; } |
| | 216 | |
| | 217 | /* Returns a pointer to the first descriptor following |
| | 218 | the TS and Network ID, and the loop length */ |
| | 219 | const unsigned char * TransportDescriptors(uint i) const |
| | 220 | { return _ptrs[i]+6; } |
| | 221 | uint TransportDescriptorsLoopLength(uint i) const |
| | 222 | { return (_ptrs[i][4] &0x0F)<< 8 + _ptrs[i][5]; } |
| | 223 | void Parse(void); |
| | 224 | uint NBTransports() const |
| | 225 | { |
| | 226 | return _ptrs.size(); |
| | 227 | } |
| | 228 | QString BouquetName() const |
| | 229 | { return bouquet_name; } |
| | 230 | |
| | 231 | private: |
| | 232 | /* point on the transport descriptors */ |
| | 233 | mutable vector<const unsigned char*> _ptrs; |
| | 234 | mutable QString bouquet_name; |
| | 235 | }; |
| | 236 | |