vdr  2.2.0
descriptor.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (c) 2003 by Marcel Wiesweg *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * $Id: descriptor.h 3.2 2014/02/08 12:44:17 kls Exp $
10  * *
11  ***************************************************************************/
12 
13 #ifndef LIBSI_DESCRIPTOR_H
14 #define LIBSI_DESCRIPTOR_H
15 
16 #include "si.h"
17 #include "headers.h"
18 
19 namespace SI {
20 
22 public:
23  char languageCode[4];
24  String name; //name of the event
25  String text; //short description
26 protected:
27  virtual void Parse();
28 };
29 
31 public:
32  class Item : public LoopElement {
33  public:
34  virtual int getLength() { return sizeof(item_extended_event)+sizeof(item_extended_event_mid)+item.getLength()+itemDescription.getLength(); }
37  protected:
38  virtual void Parse();
39  };
40  char languageCode[4];
41  int getDescriptorNumber();
42  int getLastDescriptorNumber();
45 protected:
46  virtual void Parse();
47 private:
49 };
50 
52 public:
53  int getMaximumTextLength(const char *separation1="\t", const char *separation2="\n");
54  //Returns a concatenated version of first the non-itemized and then the itemized text
55  //same semantics as with SI::String
56  char *getText(const char *separation1="\t", const char *separation2="\n");
57  //buffer must at least be getTextLength(), getMaximumTextLength() is a good choice
58  char *getText(char *buffer, int size, const char *separation1="\t", const char *separation2="\n");
59 
60  //these only return the non-itemized text fields in concatenated form
61  int getMaximumTextPlainLength();
62  char *getTextPlain();
63  char *getTextPlain(char *buffer, int size);
64 
65  //these only return the itemized text fields in concatenated form.
66  //Between the description and the text the separation1 character is used,
67  //separation2 used between two pairs. Example:
68  //Director\tSteven Spielberg\nActor\tMichael Mendl\n
69  int getMaximumTextItemizedLength(const char *separation1="\t", const char *separation2="\n");
70  char *getTextItemized(const char *separation1="\t", const char *separation2="\n");
71  char *getTextItemized(char *buffer, int size, const char *separation1="\t", const char *separation2="\n");
72  //returns the itemized text pair by pair. Maximum length for buffers is 256.
73  //Return value is false if and only if the end of the list is reached.
74  //The argument valid indicates whether the buffers contain valid content.
75  bool getTextItemized(Loop::Iterator &it, bool &valid, char *itemDescription, char *itemText, int sizeItemDescription, int sizeItemText);
76 };
77 
79 public:
80  int getReferenceServiceId() const;
81  int getReferenceEventId() const;
82 protected:
83  virtual void Parse();
84 private:
86 };
87 
88 class ContentDescriptor : public Descriptor {
89 public:
90  class Nibble : public LoopElement {
91  public:
92  virtual int getLength() { return sizeof(nibble_content); }
93  int getContentNibbleLevel1() const;
94  int getContentNibbleLevel2() const;
95  int getUserNibble1() const;
96  int getUserNibble2() const;
97  protected:
98  virtual void Parse();
99  private:
101  };
103 protected:
104  virtual void Parse();
105 };
106 
108 public:
109  class Rating : public LoopElement {
110  public:
111  char languageCode[4];
112  int getRating() const;
113  virtual int getLength() { return sizeof(parental_rating); }
114  protected:
115  virtual void Parse();
116  private:
118  };
120 protected:
121  virtual void Parse();
122 };
123 
125 public:
126  class Teletext : public LoopElement {
127  public:
128  char languageCode[4];
129  int getTeletextType() const;
130  int getTeletextMagazineNumber() const;
131  int getTeletextPageNumber() const;
132  virtual int getLength() { return sizeof(item_teletext); }
133  protected:
134  virtual void Parse();
135  private:
136  const item_teletext *s;
137  };
139 protected:
140  virtual void Parse();
141 };
142 
143 class CaDescriptor : public Descriptor {
144 public:
145  int getCaType() const;
146  int getCaPid() const;
148 protected:
149  virtual void Parse();
150 private:
151  const descr_ca *s;
152 };
153 
155 public:
156  int getComponentTag() const;
157 protected:
158  virtual void Parse();
159 private:
161 };
162 
164 public:
166 protected:
167  virtual void Parse();
168 };
169 
171 public:
173 protected:
174  virtual void Parse();
175 };
176 
178 public:
179  int getCarouselId() const;
180  int getFormatId() const;
181 protected:
182  virtual void Parse();
183 private:
185 };
186 
188 };
189 
191 public:
192  class Service : public LoopElement {
193  public:
194  int getServiceId() const;
195  int getServiceType() const;
196  virtual int getLength() { return sizeof(descr_service_list_loop); }
197  protected:
198  virtual void Parse();
199  private:
201  };
203 protected:
204  virtual void Parse();
205 };
206 
208 public:
209  int getFrequency() const;
210  int getOrbitalPosition() const;
211  int getWestEastFlag() const;
212  int getPolarization() const;
213  int getModulationSystem() const;
214  int getModulationType() const;
215  int getRollOff() const;
216  int getSymbolRate() const;
217  int getFecInner() const;
218 protected:
219  virtual void Parse();
220 private:
222 };
223 
225 public:
226  int getFrequency() const;
227  int getFecOuter() const;
228  int getModulation() const;
229  int getSymbolRate() const;
230  int getFecInner() const;
231 protected:
232  virtual void Parse();
233 private:
235 };
236 
238 public:
239  int getFrequency() const;
240  int getBandwidth() const;
241  int getPriority() const;
242  int getTimeSlicingIndicator() const;
243  int getMpeFecIndicator() const;
244  int getConstellation() const;
245  int getHierarchy() const;
246  int getCodeRateHP() const;
247  int getCodeRateLP() const;
248  int getGuardInterval() const;
249  int getTransmissionMode() const;
250  bool getOtherFrequency() const;
251 protected:
252  virtual void Parse();
253 private:
255 };
256 
258 public:
259  int getServiceType() const;
262 protected:
263  virtual void Parse();
264 private:
265  const descr_service *s;
266 };
267 
269 public:
270  class Service : public LoopElement {
271  public:
272  int getTransportStream() const;
273  int getOriginalNetworkId() const;
274  int getServiceId() const;
275  virtual int getLength() { return sizeof(item_nvod_reference); }
276  protected:
277  virtual void Parse();
278  private:
280  };
282 protected:
283  virtual void Parse();
284 };
285 
287 public:
288  int getReferenceServiceId() const;
289 protected:
290  virtual void Parse();
291 private:
293 };
294 
296 public:
297  int getStreamContent() const;
298  int getComponentType() const;
299  int getComponentTag() const;
300  char languageCode[4];
302 protected:
303  virtual void Parse();
304 private:
306 };
307 
309 public:
310  int getPrivateDataSpecifier() const;
311 protected:
312  virtual void Parse();
313 private:
315 };
316 
318 public:
319  class Subtitling : public LoopElement {
320  public:
321  char languageCode[4];
322  int getSubtitlingType() const;
323  int getCompositionPageId() const;
324  int getAncillaryPageId() const;
325  virtual int getLength() { return sizeof(item_subtitling); }
326  protected:
327  virtual void Parse();
328  private:
330  };
332 protected:
333  virtual void Parse();
334 };
335 
337 public:
338  int getNewOriginalNetworkId() const;
339  int getNewTransportStreamId() const;
340  int getNewServiceId() const;
341 protected:
342  virtual void Parse();
343 private:
345 };
346 
348 public:
349  int getCodingType() const;
351 protected:
352  virtual void Parse();
353 private:
355 };
356 
358 public:
360 protected:
361  virtual void Parse();
362 };
363 
365 public:
366  class Identifier : public LoopElement {
367  public:
369  int getCridType() const;
370  int getCridLocation() const;
371  virtual int getLength() { return sizeof(content_identifier_entry)+identifier.getLength(); }
372  protected:
373  virtual void Parse();
374  private:
376  };
378 protected:
379  virtual void Parse();
380 };
381 
383 public:
385 protected:
386  virtual void Parse();
387 };
388 
389 //abstract base class
391 public:
392  class Name : public LoopElement {
393  public:
394  char languageCode[4];
396  virtual int getLength() { return sizeof(entry_multilingual_name)+name.getLength(); }
397  protected:
398  virtual void Parse();
399  };
401 protected:
402  virtual void Parse();
403 };
404 
406  //inherits nameLoop from MultilingualNameDescriptor
407 };
408 
410  //inherits nameLoop from MultilingualNameDescriptor
411 };
412 
414 public:
415  int getComponentTag() const;
416  //inherits nameLoop from MultilingualNameDescriptor
417 protected:
418  virtual void Parse();
419 private:
421 };
422 
424 public:
426  public:
427  virtual int getLength() { return sizeof(entry_multilingual_name)+providerName.getLength()+sizeof(entry_multilingual_service_name_mid)+name.getLength(); }
429  //inherits name, meaning: service name;
430  protected:
431  virtual void Parse();
432  };
434 protected:
435  virtual void Parse();
436 };
437 
439 public:
440  class LocalTimeOffset : public LoopElement {
441  public:
442  char countryCode[4];
443  virtual int getLength() { return sizeof(local_time_offset_entry); }
444  int getCountryId() const;
445  int getLocalTimeOffsetPolarity() const;
446  int getLocalTimeOffset() const;
447  time_t getTimeOfChange() const;
448  int getNextTimeOffset() const;
449  protected:
450  virtual void Parse();
451  private:
453  };
455 protected:
456  virtual void Parse();
457 };
458 
460 public:
461  int getTransportStreamId() const;
462  int getOriginalNetworkId() const;
463  int getServiceId() const;
464  LinkageType getLinkageType() const;
465  int getHandOverType() const;
466  int getOriginType() const;
467  int getId() const;
469 protected:
470  virtual void Parse();
471 private:
472  const descr_linkage *s;
474 };
475 
477 public:
478  char languageCode[4]; //for backwards compatibility
479  class Language : public LoopElement {
480  public:
481  virtual int getLength() { return sizeof(descr_iso_639_language_loop); }
482  char languageCode[4];
483  AudioType getAudioType();
484  protected:
485  virtual void Parse();
486  private:
488  };
490 protected:
491  virtual void Parse();
492 };
493 
494 class PDCDescriptor : public Descriptor {
495 public:
496  int getDay() const;
497  int getMonth() const;
498  int getHour() const;
499  int getMinute() const;
500 protected:
501  virtual void Parse();
502 private:
503  const descr_pdc *s;
504 };
505 
507 public:
508  int getAncillaryDataIdentifier() const;
509 protected:
510  virtual void Parse();
511 private:
513 };
514 
516 public:
517  int getScramblingSequenceSelector() const;
518  int getMultipleInputStreamFlag() const;
519  int getBackwardsCompatibilityIndicator() const;
520  int getScramblingSequenceIndex() const;
521  int getInputStreamIdentifier() const { return input_stream_identifier; }
522 protected:
523  virtual void Parse();
524 private:
528 };
529 
531 public:
532  int getExtensionDescriptorTag() const;
533 protected:
534  virtual void Parse();
535 private:
537 };
538 
540 public:
541  int getExtendedDataFlag() const;
542  int getExtensionDescriptorTag() const;
543  int getPlpId() const;
544  int getT2SystemId() const;
545  int getSisoMiso() const;
546  int getBandwidth() const;
547  int getGuardInterval() const;
548  int getTransmissionMode() const;
549  int getOtherFrequencyFlag() const;
550  int getTfsFlag() const;
551 protected:
552  virtual void Parse();
553 private:
556 };
557 
559 public:
560  class LogicalChannel : public LoopElement {
561  public:
562  int getServiceId() const;
563  int getVisibleServiceFlag() const;
564  int getLogicalChannelNumber() const;
565  virtual int getLength() { return sizeof(item_logical_channel); }
566  protected:
567  virtual void Parse();
568  private:
570  };
572 protected:
573  virtual void Parse();
574 };
575 
577 public:
579  public:
580  int getServiceId() const;
581  int getVisibleServiceFlag() const;
582  int getLogicalChannelNumber() const;
583  virtual int getLength() { return sizeof(item_hd_simulcast_logical_channel); }
584  protected:
585  virtual void Parse();
586  private:
588  };
590 protected:
591  virtual void Parse();
592 };
593 
594 // Private DVB Descriptor Premiere.de
595 // 0xF2 Content Transmission Descriptor
596 // http://dvbsnoop.sourceforge.net/examples/example-private-section.html
597 
599 public:
600  class StartDayEntry : public LoopElement {
601  public:
602  class StartTimeEntry : public LoopElement {
603  public:
604  virtual int getLength() { return sizeof(item_premiere_content_transmission_time); }
605  time_t getStartTime(int mjd) const; //UTC
606  protected:
607  virtual void Parse();
608  private:
610  };
612  virtual int getLength();
613  int getMJD() const;
614  int getLoopLength() const;
615  protected:
616  virtual void Parse();
617  private:
619  };
621  int getOriginalNetworkId() const;
622  int getTransportStreamId() const;
623  int getServiceId() const;
624 protected:
625  virtual void Parse();
626 private:
628 };
629 
630 //a descriptor currently unimplemented in this library
632 protected:
633  virtual void Parse() {}
634 };
635 
637 public:
639  public:
640  virtual int getLength() { return sizeof(application_signalling_entry); }
641  int getApplicationType() const;
642  int getAITVersionNumber() const;
643  protected:
644  virtual void Parse();
645  private:
647  };
649 protected:
650  virtual void Parse();
651 };
652 
654 public:
655  class Profile : public LoopElement {
656  public:
657  virtual int getLength() { return sizeof(application_profile_entry); }
658  int getApplicationProfile() const;
659  int getVersionMajor() const;
660  int getVersionMinor() const;
661  int getVersionMicro() const;
662  private:
664  protected:
665  virtual void Parse();
666  };
668  bool isServiceBound() const;
669  int getVisibility() const;
670  int getApplicationPriority() const;
672 private:
674 protected:
675  virtual void Parse();
676 };
677 
679 public:
680  class NameEntry : public LoopElement {
681  public:
682  virtual int getLength() { return sizeof(descr_application_name_entry)+name.getLength(); }
683  char languageCode[4];
685  protected:
686  virtual void Parse();
687  };
689 protected:
690  virtual void Parse();
691 };
692 
694 public:
696  public:
697  virtual int getLength() { return sizeof(descr_url_extension_entry)+UrlExtension.getLength(); }
699  protected:
700  virtual void Parse();
701  };
702 
703  enum Protocol { ObjectCarousel = 0x01, IPviaDVB = 0x02, HTTPoverInteractionChannel = 0x03 };
704  int getProtocolId() const;
705  int getProtocolLabel() const;
706  bool isRemote() const;
707  int getComponentTag() const;
708  char *getUrlBase(char *buffer, int size);
710 
711 protected:
712  virtual void Parse();
713 private:
715  bool remote;
718 };
719 
721 public:
722  class ApplicationEntry : public LoopElement {
723  public:
724  virtual int getLength() { return sizeof(descr_dvbj_application_entry)+parameter.getLength(); }
726  protected:
727  virtual void Parse();
728  };
730 protected:
731  virtual void Parse();
732 };
733 
735 public:
739 protected:
740  virtual void Parse();
741 };
742 
744 public:
746  int getIconFlags() const;
747 protected:
748  virtual void Parse();
749 private:
751 };
752 
754 public:
755  char *getLocation(char *buffer, int size);
756 protected:
757  virtual void Parse();
758 private:
760 };
761 
763 public:
764  int getFormatIdentifier() const;
766 protected:
767  virtual void Parse();
768 private:
770 };
771 
772 class AVCDescriptor : public Descriptor {
773 public:
774  int getProfileIdc() const;
775  int getConstraintSet0Flag() const;
776  int getConstraintSet1Flag() const;
777  int getConstraintSet2Flag() const;
778  int getConstraintSet3Flag() const;
779  int getConstraintSet4Flag() const;
780  int getConstraintSet5Flag() const;
781  int getAVCCompatibleFlags() const;
782  int getLevelIdc() const;
783  int getAVCStillPresent() const;
784  int getAVC24HourPictureFlag() const;
785  int getFramePackingSEINotPresentFlag() const;
787 protected:
788  virtual void Parse();
789 private:
790  const descr_avc *s;
791 };
792 
793 } //end of namespace
794 
795 #endif //LIBSI_TABLE_H
const item_subtitling * s
Definition: descriptor.h:329
TypeLoop< SixteenBit > identifiers
Definition: descriptor.h:172
const descr_avc * s
Definition: descriptor.h:790
const descr_linkage * s
Definition: descriptor.h:472
const descr_pdc * s
Definition: descriptor.h:503
StructureLoop< Name > nameLoop
Definition: descriptor.h:400
StructureLoop< Service > serviceLoop
Definition: descriptor.h:281
StructureLoop< Nibble > nibbleLoop
Definition: descriptor.h:102
const descr_ca * s
Definition: descriptor.h:151
StructureLoop< Rating > ratingLoop
Definition: descriptor.h:119
const parental_rating * s
Definition: descriptor.h:117
const descr_time_shifted_service * s
Definition: descriptor.h:292
const local_time_offset_entry * s
Definition: descriptor.h:452
Definition: si.h:497
const descr_service_move * s
Definition: descriptor.h:344
StructureLoop< LogicalChannel > logicalChannelLoop
Definition: descriptor.h:571
const descr_extended_event * s
Definition: descriptor.h:48
virtual int getLength()
Definition: si.h:294
const content_identifier_entry * s
Definition: descriptor.h:375
const descr_s2_satellite_delivery_system * s
Definition: descriptor.h:525
Definition: headers.h:1968
Definition: headers.h:1989
virtual void Parse()
Definition: descriptor.c:18
CharArray privateData
Definition: descriptor.h:147
StructureLoop< LocalTimeOffset > localTimeOffsetLoop
Definition: descriptor.h:454
const item_teletext * s
Definition: descriptor.h:136
const descr_iso_639_language_loop * s
Definition: descriptor.h:487
StructureLoop< Teletext > teletextLoop
Definition: descriptor.h:138
StructureLoop< Subtitling > subtitlingLoop
Definition: descriptor.h:331
const nibble_content * s
Definition: descriptor.h:100
LinkageType
Definition: si.h:204
StructureLoop< HdSimulcastLogicalChannel > hdSimulcastLogicalChannelLoop
Definition: descriptor.h:589
const descr_private_data_specifier * s
Definition: descriptor.h:314
CharArray privateData
Definition: descriptor.h:786
const descr_frequency_list * s
Definition: descriptor.h:354
Definition: descriptor.c:16
Definition: headers.h:1622
const item_logical_channel * s
Definition: descriptor.h:569
virtual int getLength()
Definition: si.c:96
StructureLoop< Name > nameLoop
Definition: descriptor.h:433
const descr_satellite_delivery_system * s
Definition: descriptor.h:221
const descr_service_list_loop * s
Definition: descriptor.h:200
const descr_service * s
Definition: descriptor.h:265
const descr_terrestrial_delivery * s
Definition: descriptor.h:254
Definition: headers.h:2044
StructureLoop< Profile > profileLoop
Definition: descriptor.h:667
Definition: headers.h:1300
const descr_stream_identifier * s
Definition: descriptor.h:160
const descr_transport_protocol * s
Definition: descriptor.h:714
Definition: headers.h:1683
const application_profile_entry * s
Definition: descriptor.h:663
StructureLoop< Language > languageLoop
Definition: descriptor.h:489
Definition: headers.h:1949
const descr_time_shifted_event * s
Definition: descriptor.h:85
const descr_linkage_8 * s1
Definition: descriptor.h:473
StructureLoop< ApplicationEntryDescriptor > entryLoop
Definition: descriptor.h:648
const descr_t2_delivery_system * s
Definition: descriptor.h:554
const descr_component * s
Definition: descriptor.h:305
const descr_application_end * s
Definition: descriptor.h:673
const descr_application_icons_descriptor_end * s
Definition: descriptor.h:750
const descr_multilingual_component * s
Definition: descriptor.h:420
const item_premiere_content_transmission_time * s
Definition: descriptor.h:609
const descr_ancillary_data * s
Definition: descriptor.h:512
StructureLoop< NameEntry > nameLoop
Definition: descriptor.h:688
StructureLoop< Service > serviceLoop
Definition: descriptor.h:202
StructureLoop< StartDayEntry > startDayLoop
Definition: descriptor.h:620
StructureLoop< Identifier > identifierLoop
Definition: descriptor.h:377
const item_premiere_content_transmission_day * s
Definition: descriptor.h:618
const item_nvod_reference * s
Definition: descriptor.h:279
const descr_carousel_identifier * s
Definition: descriptor.h:184
StructureLoop< UrlExtensionEntry > UrlExtensionLoop
Definition: descriptor.h:709
AudioType
Definition: si.h:217
const descr_premiere_content_transmission * s
Definition: descriptor.h:627
StructureLoop< Item > itemLoop
Definition: descriptor.h:43
StructureLoop< ApplicationEntry > applicationLoop
Definition: descriptor.h:729
const descr_registration * s
Definition: descriptor.h:769
TypeLoop< ThirtyTwoBit > frequencies
Definition: descriptor.h:350
TypeLoop< EightBit > transportProtocolLabels
Definition: descriptor.h:671
const descr_scrambling_sequence_selector * sss
Definition: descriptor.h:526
const descr_extension * s
Definition: descriptor.h:536
const descr_cable_delivery_system * s
Definition: descriptor.h:234