vdr 2.6.1
libsi/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 4.2 2020/06/23 09:27:09 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
19namespace SI {
20
21class ShortEventDescriptor : public Descriptor {
22public:
23 char languageCode[4];
24 String name; //name of the event
25 String text; //short description
26protected:
27 virtual void Parse();
28};
29
31public:
32 class Item : public LoopElement {
33 public:
37 protected:
38 virtual void Parse();
39 };
40 char languageCode[4];
45protected:
46 virtual void Parse();
47private:
49};
50
52public:
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
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
79public:
82protected:
83 virtual void Parse();
84private:
86};
87
88class ContentDescriptor : public Descriptor {
89public:
90 class Nibble : public LoopElement {
91 public:
92 virtual int getLength() { return sizeof(nibble_content); }
95 int getUserNibble1() const;
96 int getUserNibble2() const;
97 protected:
98 virtual void Parse();
99 private:
100 const nibble_content *s;
101 };
103protected:
104 virtual void Parse();
105};
106
108public:
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:
117 const parental_rating *s;
118 };
120protected:
121 virtual void Parse();
122};
123
124class TeletextDescriptor : public Descriptor {
125public:
126 class Teletext : public LoopElement {
127 public:
128 char languageCode[4];
129 int getTeletextType() const;
132 virtual int getLength() { return sizeof(item_teletext); }
133 protected:
134 virtual void Parse();
135 private:
136 const item_teletext *s;
137 };
139protected:
140 virtual void Parse();
141};
142
143class CaDescriptor : public Descriptor {
144public:
145 int getCaType() const;
146 int getCaPid() const;
148protected:
149 virtual void Parse();
150private:
151 const descr_ca *s;
152};
153
155public:
156 int getComponentTag() const;
157protected:
158 virtual void Parse();
159private:
161};
162
163class NetworkNameDescriptor : public Descriptor {
164public:
165 String name;
166protected:
167 virtual void Parse();
168};
169
170class CaIdentifierDescriptor : public Descriptor {
171public:
173protected:
174 virtual void Parse();
175};
176
178public:
179 int getCarouselId() const;
180 int getFormatId() const;
181protected:
182 virtual void Parse();
183private:
185};
186
188};
189
190class ServiceListDescriptor : public Descriptor {
191public:
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 };
203protected:
204 virtual void Parse();
205};
206
208public:
209 int getFrequency() const;
211 int getWestEastFlag() const;
212 int getPolarization() const;
214 int getModulationType() const;
215 int getRollOff() const;
216 int getSymbolRate() const;
217 int getFecInner() const;
218protected:
219 virtual void Parse();
220private:
222};
223
225public:
226 int getFrequency() const;
227 int getFecOuter() const;
228 int getModulation() const;
229 int getSymbolRate() const;
230 int getFecInner() const;
231protected:
232 virtual void Parse();
233private:
235};
236
238public:
239 int getFrequency() const;
240 int getBandwidth() const;
241 int getPriority() const;
244 int getConstellation() const;
245 int getHierarchy() const;
246 int getCodeRateHP() const;
247 int getCodeRateLP() const;
248 int getGuardInterval() const;
250 bool getOtherFrequency() const;
251protected:
252 virtual void Parse();
253private:
255};
256
257class ServiceDescriptor : public Descriptor {
258public:
259 int getServiceType() const;
262protected:
263 virtual void Parse();
264private:
265 const descr_service *s;
266};
267
268class NVODReferenceDescriptor : public Descriptor {
269public:
270 class Service : public LoopElement {
271 public:
274 int getServiceId() const;
275 virtual int getLength() { return sizeof(item_nvod_reference); }
276 protected:
277 virtual void Parse();
278 private:
279 const item_nvod_reference *s;
280 };
282protected:
283 virtual void Parse();
284};
285
287public:
289protected:
290 virtual void Parse();
291private:
293};
294
295class ComponentDescriptor : public Descriptor {
296public:
297 int getStreamContent() const;
299 int getComponentType() const;
300 int getComponentTag() const;
301 char languageCode[4];
303protected:
304 virtual void Parse();
305private:
306 const descr_component *s;
307};
308
310public:
312protected:
313 virtual void Parse();
314private:
316};
317
318class SubtitlingDescriptor : public Descriptor {
319public:
320 class Subtitling : public LoopElement {
321 public:
322 char languageCode[4];
323 int getSubtitlingType() const;
326 virtual int getLength() { return sizeof(item_subtitling); }
327 protected:
328 virtual void Parse();
329 private:
330 const item_subtitling *s;
331 };
333protected:
334 virtual void Parse();
335};
336
337class ServiceMoveDescriptor : public Descriptor {
338public:
341 int getNewServiceId() const;
342protected:
343 virtual void Parse();
344private:
345 const descr_service_move *s;
346};
347
348class FrequencyListDescriptor : public Descriptor {
349public:
350 int getCodingType() const;
352protected:
353 virtual void Parse();
354private:
355 const descr_frequency_list *s;
356};
357
359public:
361protected:
362 virtual void Parse();
363};
364
366public:
367 class Identifier : public LoopElement {
368 public:
370 int getCridType() const;
371 int getCridLocation() const;
372 virtual int getLength() { return sizeof(content_identifier_entry)+identifier.getLength(); }
373 protected:
374 virtual void Parse();
375 private:
377 };
379protected:
380 virtual void Parse();
381};
382
384public:
386protected:
387 virtual void Parse();
388};
389
390//abstract base class
392public:
393 class Name : public LoopElement {
394 public:
395 char languageCode[4];
396 String name;
397 virtual int getLength() { return sizeof(entry_multilingual_name)+name.getLength(); }
398 protected:
399 virtual void Parse();
400 };
402protected:
403 virtual void Parse();
404};
405
407 //inherits nameLoop from MultilingualNameDescriptor
408};
409
410class MultilingualBouquetNameDescriptor : public MultilingualNameDescriptor {
411 //inherits nameLoop from MultilingualNameDescriptor
412};
413
414class MultilingualComponentDescriptor : public MultilingualNameDescriptor {
415public:
416 int getComponentTag() const;
417 //inherits nameLoop from MultilingualNameDescriptor
418protected:
419 virtual void Parse();
420private:
422};
423
425public:
426 class Name : public MultilingualNameDescriptor::Name {
427 public:
430 //inherits name, meaning: service name;
431 protected:
432 virtual void Parse();
433 };
435protected:
436 virtual void Parse();
437};
438
440public:
441 class LocalTimeOffset : public LoopElement {
442 public:
443 char countryCode[4];
444 virtual int getLength() { return sizeof(local_time_offset_entry); }
445 int getCountryId() const;
448 time_t getTimeOfChange() const;
449 int getNextTimeOffset() const;
450 protected:
451 virtual void Parse();
452 private:
454 };
456protected:
457 virtual void Parse();
458};
459
460class LinkageDescriptor : public Descriptor {
461public:
464 int getServiceId() const;
466 int getHandOverType() const;
467 int getOriginType() const;
468 int getId() const;
470protected:
471 virtual void Parse();
472private:
473 const descr_linkage *s;
474 const descr_linkage_8 *s1;
475};
476
478public:
479 char languageCode[4]; //for backwards compatibility
480 class Language : public LoopElement {
481 public:
482 virtual int getLength() { return sizeof(descr_iso_639_language_loop); }
483 char languageCode[4];
485 protected:
486 virtual void Parse();
487 private:
489 };
491protected:
492 virtual void Parse();
493};
494
495class PDCDescriptor : public Descriptor {
496public:
497 int getDay() const;
498 int getMonth() const;
499 int getHour() const;
500 int getMinute() const;
501protected:
502 virtual void Parse();
503private:
504 const descr_pdc *s;
505};
506
507class AncillaryDataDescriptor : public Descriptor {
508public:
510protected:
511 virtual void Parse();
512private:
513 const descr_ancillary_data *s;
514};
515
517public:
523protected:
524 virtual void Parse();
525private:
529};
530
531class ExtensionDescriptor : public Descriptor {
532public:
535protected:
536 virtual void Parse();
537private:
538 const descr_extension *s;
540};
541
543public:
546 int getPlpId() const;
547 int getT2SystemId() const;
548 int getSisoMiso() const;
549 int getBandwidth() const;
550 int getGuardInterval() const;
553 int getTfsFlag() const;
554protected:
555 virtual void Parse();
556private:
559};
560
562public:
563 class LogicalChannel : public LoopElement {
564 public:
565 int getServiceId() const;
568 virtual int getLength() { return sizeof(item_logical_channel); }
569 protected:
570 virtual void Parse();
571 private:
572 const item_logical_channel *s;
573 };
575protected:
576 virtual void Parse();
577};
578
580public:
581 class HdSimulcastLogicalChannel : public LoopElement {
582 public:
583 int getServiceId() const;
586 virtual int getLength() { return sizeof(item_hd_simulcast_logical_channel); }
587 protected:
588 virtual void Parse();
589 private:
591 };
593protected:
594 virtual void Parse();
595};
596
597// Private DVB Descriptor Premiere.de
598// 0xF2 Content Transmission Descriptor
599// http://dvbsnoop.sourceforge.net/examples/example-private-section.html
600
602public:
603 class StartDayEntry : public LoopElement {
604 public:
605 class StartTimeEntry : public LoopElement {
606 public:
607 virtual int getLength() { return sizeof(item_premiere_content_transmission_time); }
608 time_t getStartTime(int mjd) const; //UTC
609 protected:
610 virtual void Parse();
611 private:
613 };
615 virtual int getLength();
616 int getMJD() const;
617 int getLoopLength() const;
618 protected:
619 virtual void Parse();
620 private:
622 };
626 int getServiceId() const;
627protected:
628 virtual void Parse();
629private:
631};
632
633//a descriptor currently unimplemented in this library
634class UnimplementedDescriptor : public Descriptor {
635protected:
636 virtual void Parse() {}
637};
638
639class ApplicationSignallingDescriptor : public Descriptor {
640public:
641 class ApplicationEntryDescriptor : public LoopElement {
642 public:
643 virtual int getLength() { return sizeof(application_signalling_entry); }
646 protected:
647 virtual void Parse();
648 private:
650 };
652protected:
653 virtual void Parse();
654};
655
657public:
658 class Profile : public LoopElement {
659 public:
660 virtual int getLength() { return sizeof(application_profile_entry); }
662 int getVersionMajor() const;
663 int getVersionMinor() const;
664 int getVersionMicro() const;
665 private:
667 protected:
668 virtual void Parse();
669 };
671 bool isServiceBound() const;
672 int getVisibility() const;
675private:
677protected:
678 virtual void Parse();
679};
680
682public:
683 class NameEntry : public LoopElement {
684 public:
685 virtual int getLength() { return sizeof(descr_application_name_entry)+name.getLength(); }
686 char languageCode[4];
687 String name;
688 protected:
689 virtual void Parse();
690 };
692protected:
693 virtual void Parse();
694};
695
697public:
698 class UrlExtensionEntry : public LoopElement {
699 public:
700 virtual int getLength() { return sizeof(descr_url_extension_entry)+UrlExtension.getLength(); }
702 protected:
703 virtual void Parse();
704 };
705
707 int getProtocolId() const;
708 int getProtocolLabel() const;
709 bool isRemote() const;
710 int getComponentTag() const;
711 char *getUrlBase(char *buffer, int size);
713
714protected:
715 virtual void Parse();
716private:
718 bool remote;
719 int componentTag;
721};
722
724public:
725 class ApplicationEntry : public LoopElement {
726 public:
727 virtual int getLength() { return sizeof(descr_dvbj_application_entry)+parameter.getLength(); }
729 protected:
730 virtual void Parse();
731 };
733protected:
734 virtual void Parse();
735};
736
738public:
742protected:
743 virtual void Parse();
744};
745
747public:
749 int getIconFlags() const;
750protected:
751 virtual void Parse();
752private:
754};
755
757public:
758 char *getLocation(char *buffer, int size);
759protected:
760 virtual void Parse();
761private:
763};
764
765class RegistrationDescriptor : public Descriptor {
766public:
769protected:
770 virtual void Parse();
771private:
772 const descr_registration *s;
773};
774
775class AVCDescriptor : public Descriptor {
776public:
777 int getProfileIdc() const;
785 int getLevelIdc() const;
790protected:
791 virtual void Parse();
792private:
793 const descr_avc *s;
794};
795
796} //end of namespace
797
798#endif //LIBSI_TABLE_H
int getProfileIdc() const
int getAVCCompatibleFlags() const
int getLevelIdc() const
int getConstraintSet3Flag() const
int getFramePackingSEINotPresentFlag() const
int getConstraintSet2Flag() const
int getConstraintSet1Flag() const
int getConstraintSet0Flag() const
int getConstraintSet4Flag() const
int getAVCStillPresent() const
int getConstraintSet5Flag() const
virtual void Parse()
int getAVC24HourPictureFlag() const
const descr_ancillary_data * s
int getAncillaryDataIdentifier() const
StructureLoop< ApplicationEntryDescriptor > entryLoop
int getCaPid() const
int getCaType() const
virtual void Parse()
TypeLoop< SixteenBit > identifiers
const descr_cable_delivery_system * s
const descr_carousel_identifier * s
int getComponentType() const
int getStreamContentExt() const
int getStreamContent() const
int getComponentTag() const
virtual void Parse()
StructureLoop< Nibble > nibbleLoop
virtual void Parse()
StructureLoop< Identifier > identifierLoop
const descr_extended_event * s
char * getTextItemized(const char *separation1="\t", const char *separation2="\n")
bool getTextItemized(Loop::Iterator &it, bool &valid, char *itemDescription, char *itemText, int sizeItemDescription, int sizeItemText)
char * getText(const char *separation1="\t", const char *separation2="\n")
char * getTextItemized(char *buffer, int size, const char *separation1="\t", const char *separation2="\n")
char * getTextPlain(char *buffer, int size)
char * getText(char *buffer, int size, const char *separation1="\t", const char *separation2="\n")
int getMaximumTextItemizedLength(const char *separation1="\t", const char *separation2="\n")
int getMaximumTextLength(const char *separation1="\t", const char *separation2="\n")
int getExtendedDataFlag() const
int getExtensionDescriptorTag() const
virtual void Parse()
const descr_frequency_list * s
TypeLoop< ThirtyTwoBit > frequencies
StructureLoop< HdSimulcastLogicalChannel > hdSimulcastLogicalChannelLoop
const descr_iso_639_language_loop * s
StructureLoop< Language > languageLoop
int getOriginalNetworkId() const
virtual void Parse()
int getTransportStreamId() const
const descr_linkage_8 * s1
int getOriginType() const
int getServiceId() const
LinkageType getLinkageType() const
int getHandOverType() const
StructureLoop< LocalTimeOffset > localTimeOffsetLoop
StructureLoop< LogicalChannel > logicalChannelLoop
TypeLoop< EightBit > transportProtocolLabels
StructureLoop< Profile > profileLoop
const descr_application_end * s
const descr_application_icons_descriptor_end * s
StructureLoop< ApplicationEntry > applicationLoop
char * getLocation(char *buffer, int size)
char * getUrlBase(char *buffer, int size)
StructureLoop< UrlExtensionEntry > UrlExtensionLoop
const descr_transport_protocol * s
const descr_multilingual_component * s
StructureLoop< Service > serviceLoop
int getDay() const
int getMinute() const
int getHour() const
virtual void Parse()
int getMonth() const
const item_premiere_content_transmission_day * s
const descr_premiere_content_transmission * s
const descr_private_data_specifier * s
const descr_registration * s
const descr_s2_satellite_delivery_system * s
const descr_scrambling_sequence_selector * sss
const descr_satellite_delivery_system * s
virtual void Parse()
int getServiceType() const
const descr_service_list_loop * s
StructureLoop< Service > serviceLoop
const descr_service_move * s
int getNewOriginalNetworkId() const
int getNewTransportStreamId() const
const descr_stream_identifier * s
StructureLoop< Subtitling > subtitlingLoop
const descr_t2_delivery_system * s
virtual void Parse()
StructureLoop< Teletext > teletextLoop
const descr_terrestrial_delivery * s
const descr_time_shifted_event * s
const descr_time_shifted_service * s