add ci resource manager
[enigma2.git] / lib / dvb_si / container.cpp
1 /*
2  * $Id: container.cpp,v 1.1 2003-10-17 15:36:37 tmbinc Exp $
3  *
4  * (C) 2002-2003 Andreas Oberritter <obi@saftware.de>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */
21
22 #include <lib/dvb_si/ac3_descriptor.h>
23 #include <lib/dvb_si/ancillary_data_descriptor.h>
24 #include <lib/dvb_si/announcement_support_descriptor.h>
25 #include <lib/dvb_si/application_signalling_descriptor.h>
26 #include <lib/dvb_si/audio_stream_descriptor.h>
27 #include <lib/dvb_si/bouquet_name_descriptor.h>
28 #include <lib/dvb_si/ca_descriptor.h>
29 #include <lib/dvb_si/ca_identifier_descriptor.h>
30 #include <lib/dvb_si/ca_system_descriptor.h>
31 #include <lib/dvb_si/cable_delivery_system_descriptor.h>
32 #include <lib/dvb_si/cell_frequency_link_descriptor.h>
33 #include <lib/dvb_si/cell_list_descriptor.h>
34 #include <lib/dvb_si/component_descriptor.h>
35 #include <lib/dvb_si/container.h>
36 #include <lib/dvb_si/content_descriptor.h>
37 #include <lib/dvb_si/country_availability_descriptor.h>
38 #include <lib/dvb_si/data_broadcast_descriptor.h>
39 #include <lib/dvb_si/data_broadcast_id_descriptor.h>
40 #include <lib/dvb_si/extended_event_descriptor.h>
41 #include <lib/dvb_si/frequency_list_descriptor.h>
42 #include <lib/dvb_si/iso639_language_descriptor.h>
43 #include <lib/dvb_si/linkage_descriptor.h>
44 #include <lib/dvb_si/local_time_offset_descriptor.h>
45 #include <lib/dvb_si/mosaic_descriptor.h>
46 #include <lib/dvb_si/multilingual_bouquet_name_descriptor.h>
47 #include <lib/dvb_si/multilingual_component_descriptor.h>
48 #include <lib/dvb_si/multilingual_network_name_descriptor.h>
49 #include <lib/dvb_si/multilingual_service_name_descriptor.h>
50 #include <lib/dvb_si/network_name_descriptor.h>
51 #include <lib/dvb_si/nvod_reference_descriptor.h>
52 #include <lib/dvb_si/parental_rating_descriptor.h>
53 #include <lib/dvb_si/pdc_descriptor.h>
54 #include <lib/dvb_si/private_data_specifier_descriptor.h>
55 #include <lib/dvb_si/satellite_delivery_system_descriptor.h>
56 #include <lib/dvb_si/service_descriptor.h>
57 #include <lib/dvb_si/service_list_descriptor.h>
58 #include <lib/dvb_si/service_move_descriptor.h>
59 #include <lib/dvb_si/short_event_descriptor.h>
60 #include <lib/dvb_si/stream_identifier_descriptor.h>
61 #include <lib/dvb_si/stuffing_descriptor.h>
62 #include <lib/dvb_si/subtitling_descriptor.h>
63 #include <lib/dvb_si/target_background_grid_descriptor.h>
64 #include <lib/dvb_si/telephone_descriptor.h>
65 #include <lib/dvb_si/teletext_descriptor.h>
66 #include <lib/dvb_si/terrestrial_delivery_system_descriptor.h>
67 #include <lib/dvb_si/time_shifted_service_descriptor.h>
68 #include <lib/dvb_si/vbi_data_descriptor.h>
69 #include <lib/dvb_si/vbi_teletext_descriptor.h>
70 #include <lib/dvb_si/video_stream_descriptor.h>
71 #include <lib/dvb_si/video_window_descriptor.h>
72 #include <lib/dvb_si/descriptor_tag.h>
73
74 DescriptorContainer::~DescriptorContainer(void)
75 {
76         for (DescriptorIterator i = descriptorVector.begin(); i != descriptorVector.end(); ++i)
77                 delete *i;
78 }
79
80 void DescriptorContainer::descriptor(const uint8_t * const buffer)
81 {
82         switch (buffer[0]) {
83         case VIDEO_STREAM_DESCRIPTOR:
84                 descriptorVector.push_back(new VideoStreamDescriptor(buffer));
85                 break;
86
87         case AUDIO_STREAM_DESCRIPTOR:
88                 descriptorVector.push_back(new AudioStreamDescriptor(buffer));
89                 break;
90
91         case TARGET_BACKGROUND_GRID_DESCRIPTOR:
92                 descriptorVector.push_back(new TargetBackgroundGridDescriptor(buffer));
93                 break;
94
95         case VIDEO_WINDOW_DESCRIPTOR:
96                 descriptorVector.push_back(new VideoWindowDescriptor(buffer));
97                 break;
98
99         case CA_DESCRIPTOR:
100                 descriptorVector.push_back(new CaDescriptor(buffer));
101                 break;
102
103         case ISO_639_LANGUAGE_DESCRIPTOR:
104                 descriptorVector.push_back(new Iso639LanguageDescriptor(buffer));
105                 break;
106
107         case NETWORK_NAME_DESCRIPTOR:
108                 descriptorVector.push_back(new NetworkNameDescriptor(buffer));
109                 break;
110
111         case SERVICE_LIST_DESCRIPTOR:
112                 descriptorVector.push_back(new ServiceListDescriptor(buffer));
113                 break;
114
115         case STUFFING_DESCRIPTOR:
116                 descriptorVector.push_back(new StuffingDescriptor(buffer));
117                 break;
118
119         case SATELLITE_DELIVERY_SYSTEM_DESCRIPTOR:
120                 descriptorVector.push_back(new SatelliteDeliverySystemDescriptor(buffer));
121                 break;
122
123         case CABLE_DELIVERY_SYSTEM_DESCRIPTOR:
124                 descriptorVector.push_back(new CableDeliverySystemDescriptor(buffer));
125                 break;
126
127         case VBI_DATA_DESCRIPTOR:
128                 descriptorVector.push_back(new VbiDataDescriptor(buffer));
129                 break;
130
131         case VBI_TELETEXT_DESCRIPTOR:
132                 descriptorVector.push_back(new VbiTeletextDescriptor(buffer));
133                 break;
134
135         case BOUQUET_NAME_DESCRIPTOR:
136                 descriptorVector.push_back(new BouquetNameDescriptor(buffer));
137                 break;
138
139         case SERVICE_DESCRIPTOR:
140                 descriptorVector.push_back(new ServiceDescriptor(buffer));
141                 break;
142
143         case COUNTRY_AVAILABILITY_DESCRIPTOR:
144                 descriptorVector.push_back(new CountryAvailabilityDescriptor(buffer));
145                 break;
146
147         case LINKAGE_DESCRIPTOR:
148                 descriptorVector.push_back(new LinkageDescriptor(buffer));
149                 break;
150
151         case NVOD_REFERENCE_DESCRIPTOR:
152                 descriptorVector.push_back(new NvodReferenceDescriptor(buffer));
153                 break;
154
155         case TIME_SHIFTED_SERVICE_DESCRIPTOR:
156                 descriptorVector.push_back(new TimeShiftedServiceDescriptor(buffer));
157                 break;
158
159         case SHORT_EVENT_DESCRIPTOR:
160                 descriptorVector.push_back(new ShortEventDescriptor(buffer));
161                 break;
162
163         case EXTENDED_EVENT_DESCRIPTOR:
164                 descriptorVector.push_back(new ExtendedEventDescriptor(buffer));
165                 break;
166
167         case COMPONENT_DESCRIPTOR:
168                 descriptorVector.push_back(new ComponentDescriptor(buffer));
169                 break;
170
171         case MOSAIC_DESCRIPTOR:
172                 descriptorVector.push_back(new MosaicDescriptor(buffer));
173                 break;
174
175         case STREAM_IDENTIFIER_DESCRIPTOR:
176                 descriptorVector.push_back(new StreamIdentifierDescriptor(buffer));
177                 break;
178
179         case CA_IDENTIFIER_DESCRIPTOR:
180                 descriptorVector.push_back(new CaIdentifierDescriptor(buffer));
181                 break;
182
183         case CONTENT_DESCRIPTOR:
184                 descriptorVector.push_back(new ContentDescriptor(buffer));
185                 break;
186
187         case PARENTAL_RATING_DESCRIPTOR:
188                 descriptorVector.push_back(new ParentalRatingDescriptor(buffer));
189                 break;
190
191         case TELETEXT_DESCRIPTOR:
192                 descriptorVector.push_back(new TeletextDescriptor(buffer));
193                 break;
194
195         case TELEPHONE_DESCRIPTOR:
196                 descriptorVector.push_back(new TelephoneDescriptor(buffer));
197                 break;
198
199         case LOCAL_TIME_OFFSET_DESCRIPTOR:
200                 descriptorVector.push_back(new LocalTimeOffsetDescriptor(buffer));
201                 break;
202
203         case SUBTITLING_DESCRIPTOR:
204                 descriptorVector.push_back(new SubtitlingDescriptor(buffer));
205                 break;
206
207         case TERRESTRIAL_DELIVERY_SYSTEM_DESCRIPTOR:
208                 descriptorVector.push_back(new TerrestrialDeliverySystemDescriptor(buffer));
209                 break;
210
211         case MULTILINGUAL_NETWORK_NAME_DESCRIPTOR:
212                 descriptorVector.push_back(new MultilingualNetworkNameDescriptor(buffer));
213                 break;
214
215         case MULTILINGUAL_BOUQUET_NAME_DESCRIPTOR:
216                 descriptorVector.push_back(new MultilingualBouquetNameDescriptor(buffer));
217                 break;
218
219         case MULTILINGUAL_SERVICE_NAME_DESCRIPTOR:
220                 descriptorVector.push_back(new MultilingualServiceNameDescriptor(buffer));
221                 break;
222
223         case MULTILINGUAL_COMPONENT_DESCRIPTOR:
224                 descriptorVector.push_back(new MultilingualComponentDescriptor(buffer));
225                 break;
226
227         case PRIVATE_DATA_SPECIFIER_DESCRIPTOR:
228                 descriptorVector.push_back(new PrivateDataSpecifierDescriptor(buffer));
229                 break;
230
231         case SERVICE_MOVE_DESCRIPTOR:
232                 descriptorVector.push_back(new ServiceMoveDescriptor(buffer));
233                 break;
234
235         case FREQUENCY_LIST_DESCRIPTOR:
236                 descriptorVector.push_back(new FrequencyListDescriptor(buffer));
237                 break;
238
239         case DATA_BROADCAST_DESCRIPTOR:
240                 descriptorVector.push_back(new DataBroadcastDescriptor(buffer));
241                 break;
242
243         case CA_SYSTEM_DESCRIPTOR:
244                 descriptorVector.push_back(new CaSystemDescriptor(buffer));
245                 break;
246
247         case DATA_BROADCAST_ID_DESCRIPTOR:
248                 descriptorVector.push_back(new DataBroadcastIdDescriptor(buffer));
249                 break;
250
251         case PDC_DESCRIPTOR:
252                 descriptorVector.push_back(new PdcDescriptor(buffer));
253                 break;
254
255         case AC3_DESCRIPTOR:
256                 descriptorVector.push_back(new Ac3Descriptor(buffer));
257                 break;
258
259         case ANCILLARY_DATA_DESCRIPTOR:
260                 descriptorVector.push_back(new AncillaryDataDescriptor(buffer));
261                 break;
262
263         case CELL_LIST_DESCRIPTOR:
264                 descriptorVector.push_back(new CellListDescriptor(buffer));
265                 break;
266
267         case CELL_FREQUENCY_LINK_DESCRIPTOR:
268                 descriptorVector.push_back(new CellFrequencyLinkDescriptor(buffer));
269                 break;
270
271         case ANNOUNCEMENT_SUPPORT_DESCRIPTOR:
272                 descriptorVector.push_back(new AnnouncementSupportDescriptor(buffer));
273                 break;
274
275         case APPLICATION_SIGNALLING_DESCRIPTOR:
276                 descriptorVector.push_back(new ApplicationSignallingDescriptor(buffer));
277                 break;
278
279         default:
280                 descriptorVector.push_back(new Descriptor(buffer));
281                 break;
282         }
283 }
284
285 const DescriptorVector *DescriptorContainer::getDescriptors(void) const
286 {
287         return &descriptorVector;
288 }
289