diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2013-10-30 10:18:26 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2013-10-30 10:18:26 +0100 |
commit | 512cd24e5396bf2d027ff6dd698ad77f9b266ff5 (patch) | |
tree | fab44cf1937b474e61c4769e1e8d35286ecd2fe7 /libsi | |
parent | 83a8d5a5617e0d54025a41fae69bf0105b25a2a4 (diff) | |
download | vdr-512cd24e5396bf2d027ff6dd698ad77f9b266ff5.tar.gz vdr-512cd24e5396bf2d027ff6dd698ad77f9b266ff5.tar.bz2 |
Added code for parsing LCN and AVC descriptors to libsi
Diffstat (limited to 'libsi')
-rw-r--r-- | libsi/descriptor.c | 99 | ||||
-rw-r--r-- | libsi/descriptor.h | 59 | ||||
-rw-r--r-- | libsi/headers.h | 71 | ||||
-rw-r--r-- | libsi/si.c | 11 | ||||
-rw-r--r-- | libsi/si.h | 18 |
5 files changed, 253 insertions, 5 deletions
diff --git a/libsi/descriptor.c b/libsi/descriptor.c index 07429b54..f763d62b 100644 --- a/libsi/descriptor.c +++ b/libsi/descriptor.c @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: descriptor.c 2.4 2012/01/11 11:35:17 kls Exp $ + * $Id: descriptor.c 3.1 2013/10/30 10:16:18 kls Exp $ * * ***************************************************************************/ @@ -922,6 +922,48 @@ int T2DeliverySystemDescriptor::getTfsFlag() const { return extended_data_flag ? s->tfs_flag : -1; } +void LogicalChannelDescriptor::Parse() { + //this descriptor is only a header and a loop + logicalChannelLoop.setData(data+sizeof(descr_logical_channel), getLength()-sizeof(descr_logical_channel)); +} + +int LogicalChannelDescriptor::LogicalChannel::getServiceId() const { + return HILO(s->service_id); +} + +int LogicalChannelDescriptor::LogicalChannel::getVisibleServiceFlag() const { + return s->visible_service_flag; +} + +int LogicalChannelDescriptor::LogicalChannel::getLogicalChannelNumber() const { + return HILO(s->logical_channel_number); +} + +void LogicalChannelDescriptor::LogicalChannel::Parse() { + s=data.getData<const item_logical_channel>(); +} + +void HdSimulcastLogicalChannelDescriptor::Parse() { + //this descriptor is only a header and a loop + hdSimulcastLogicalChannelLoop.setData(data+sizeof(descr_hd_simulcast_logical_channel), getLength()-sizeof(descr_hd_simulcast_logical_channel)); +} + +int HdSimulcastLogicalChannelDescriptor::HdSimulcastLogicalChannel::getServiceId() const { + return HILO(s->service_id); +} + +int HdSimulcastLogicalChannelDescriptor::HdSimulcastLogicalChannel::getVisibleServiceFlag() const { + return s->visible_service_flag; +} + +int HdSimulcastLogicalChannelDescriptor::HdSimulcastLogicalChannel::getLogicalChannelNumber() const { + return HILO(s->logical_channel_number); +} + +void HdSimulcastLogicalChannelDescriptor::HdSimulcastLogicalChannel::Parse() { + s=data.getData<const item_hd_simulcast_logical_channel>(); +} + int PremiereContentTransmissionDescriptor::getOriginalNetworkId() const { return HILO(s->original_network_id); } @@ -1145,4 +1187,59 @@ void RegistrationDescriptor::Parse() { privateData.assign(data.getData(offset), getLength()-offset); } +int AVCDescriptor::getProfileIdc() const { + return s->profile_idc; +} + +int AVCDescriptor::getConstraintSet0Flag() const { + return s->constraint_set0_flag; +} + +int AVCDescriptor::getConstraintSet1Flag() const { + return s->constraint_set1_flag; +} + +int AVCDescriptor::getConstraintSet2Flag() const { + return s->constraint_set2_flag; +} + +int AVCDescriptor::getConstraintSet3Flag() const { + return s->constraint_set3_flag; +} + +int AVCDescriptor::getConstraintSet4Flag() const { + return s->constraint_set4_flag; +} + +int AVCDescriptor::getConstraintSet5Flag() const { + return s->constraint_set5_flag; +} + +int AVCDescriptor::getAVCCompatibleFlags() const { + return s->avc_compatible_flags; +} + +int AVCDescriptor::getLevelIdc() const { + return s->level_idc; +} + +int AVCDescriptor::getAVCStillPresent() const { + return s->avc_still_present; +} + +int AVCDescriptor::getAVC24HourPictureFlag() const { + return s->avc_24_hour_picture_flag; +} + +int AVCDescriptor::getFramePackingSEINotPresentFlag() const { + return s->frame_packing_sei_not_present_flag; +} + +void AVCDescriptor::Parse() { + int offset=0; + data.setPointerAndOffset<const descr_avc>(s, offset); + if (checkSize(getLength()-offset)) + privateData.assign(data.getData(offset), getLength()-offset); +} + } //end of namespace diff --git a/libsi/descriptor.h b/libsi/descriptor.h index 3025876e..f931871a 100644 --- a/libsi/descriptor.h +++ b/libsi/descriptor.h @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: descriptor.h 2.4 2012/01/11 11:35:17 kls Exp $ + * $Id: descriptor.h 3.1 2013/10/30 10:16:18 kls Exp $ * * ***************************************************************************/ @@ -557,6 +557,42 @@ private: int extended_data_flag; }; +class LogicalChannelDescriptor : public Descriptor { +public: + class LogicalChannel : public LoopElement { + public: + int getServiceId() const; + int getVisibleServiceFlag() const; + int getLogicalChannelNumber() const; + virtual int getLength() { return sizeof(item_logical_channel); } + protected: + virtual void Parse(); + private: + const item_logical_channel *s; + }; + StructureLoop<LogicalChannel> logicalChannelLoop; +protected: + virtual void Parse(); +}; + +class HdSimulcastLogicalChannelDescriptor : public Descriptor { +public: + class HdSimulcastLogicalChannel : public LoopElement { + public: + int getServiceId() const; + int getVisibleServiceFlag() const; + int getLogicalChannelNumber() const; + virtual int getLength() { return sizeof(item_hd_simulcast_logical_channel); } + protected: + virtual void Parse(); + private: + const item_hd_simulcast_logical_channel *s; + }; + StructureLoop<HdSimulcastLogicalChannel> hdSimulcastLogicalChannelLoop; +protected: + virtual void Parse(); +}; + // Private DVB Descriptor Premiere.de // 0xF2 Content Transmission Descriptor // http://dvbsnoop.sourceforge.net/examples/example-private-section.html @@ -735,6 +771,27 @@ private: const descr_registration *s; }; +class AVCDescriptor : public Descriptor { +public: + int getProfileIdc() const; + int getConstraintSet0Flag() const; + int getConstraintSet1Flag() const; + int getConstraintSet2Flag() const; + int getConstraintSet3Flag() const; + int getConstraintSet4Flag() const; + int getConstraintSet5Flag() const; + int getAVCCompatibleFlags() const; + int getLevelIdc() const; + int getAVCStillPresent() const; + int getAVC24HourPictureFlag() const; + int getFramePackingSEINotPresentFlag() const; + CharArray privateData; +protected: + virtual void Parse(); +private: + const descr_avc *s; +}; + } //end of namespace #endif //LIBSI_TABLE_H diff --git a/libsi/headers.h b/libsi/headers.h index 85c83b27..ff5bb5da 100644 --- a/libsi/headers.h +++ b/libsi/headers.h @@ -10,7 +10,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: headers.h 2.5 2012/06/09 14:37:24 kls Exp $ + * $Id: headers.h 3.1 2013/10/30 10:16:18 kls Exp $ * * ***************************************************************************/ @@ -1870,6 +1870,54 @@ struct descr_t2_delivery_system { fields looping to the end */ }; +/* 0x83 logical_channel_descriptor */ + +#define DESCR_LOGICAL_CHANNEL_LEN 2 +struct descr_logical_channel { + u_char descriptor_tag :8; + u_char descriptor_length :8; +}; + +#define ITEM_LOGICAL_CHANNEL_LEN 4 +struct item_logical_channel { + u_char service_id_hi :8; + u_char service_id_lo :8; +#if BYTE_ORDER == BIG_ENDIAN + u_char visible_service_flag :1; + u_char reserved :5; + u_char logical_channel_number_hi :2; +#else + u_char logical_channel_number_hi :2; + u_char reserved :5; + u_char visible_service_flag :1; +#endif + u_char logical_channel_number_lo :8; +}; + +/* 0x88 hd_simulcast_logical_channel_descriptor */ + +#define DESCR_HD_SIMULCAST_LOGICAL_CHANNEL_LEN 2 +struct descr_hd_simulcast_logical_channel { + u_char descriptor_tag :8; + u_char descriptor_length :8; +}; + +#define ITEM_HD_SIMULCAST_LOGICAL_CHANNEL_LEN 4 +struct item_hd_simulcast_logical_channel { + u_char service_id_hi :8; + u_char service_id_lo :8; +#if BYTE_ORDER == BIG_ENDIAN + u_char visible_service_flag :1; + u_char reserved :5; + u_char logical_channel_number_hi :2; +#else + u_char logical_channel_number_hi :2; + u_char reserved :5; + u_char visible_service_flag :1; +#endif + u_char logical_channel_number_lo :8; +}; + /* MHP 0x00 application_descriptor */ #define DESCR_APPLICATION_LEN 3 @@ -2088,6 +2136,27 @@ struct descr_registration { u_char format_identifier_lo_lo :8; }; +/* 0x28 avc_descriptor */ + +#define DESCR_AVC_LEN 6 +struct descr_avc { + u_char descriptor_tag :8; + u_char descriptor_length :8; + u_char profile_idc :8; + u_char constraint_set0_flag :1; + u_char constraint_set1_flag :1; + u_char constraint_set2_flag :1; + u_char constraint_set3_flag :1; + u_char constraint_set4_flag :1; + u_char constraint_set5_flag :1; + u_char avc_compatible_flags :2; + u_char level_idc :8; + u_char avc_still_present :1; + u_char avc_24_hour_picture_flag :1; + u_char frame_packing_sei_not_present_flag :1; + u_char reserved :5; +}; + } //end of namespace #endif //LIBSI_HEADERS_H @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: si.c 2.8 2012/09/29 14:44:20 kls Exp $ + * $Id: si.c 3.1 2013/10/30 10:16:18 kls Exp $ * * ***************************************************************************/ @@ -508,6 +508,9 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain, case CarouselIdentifierDescriptorTag: d=new CarouselIdentifierDescriptor(); break; + case AVCDescriptorTag: + d=new AVCDescriptor(); + break; case NetworkNameDescriptorTag: d=new NetworkNameDescriptor(); break; @@ -614,6 +617,12 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain, case ExtensionDescriptorTag: d=new ExtensionDescriptor(); break; + case LogicalChannelDescriptorTag: + d=new LogicalChannelDescriptor(); + break; + case HdSimulcastLogicalChannelDescriptorTag: + d=new HdSimulcastLogicalChannelDescriptor(); + break; case RegistrationDescriptorTag: d=new RegistrationDescriptor(); break; @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: si.h 2.6 2012/10/15 11:56:06 kls Exp $ + * $Id: si.h 3.1 2013/10/30 10:16:18 kls Exp $ * * ***************************************************************************/ @@ -70,6 +70,10 @@ enum DescriptorTag { // defined by ISO-13818-6 (DSM-CC) CarouselIdentifierDescriptorTag = 0x13, // 0x14 - 0x3F Reserved + // defined by ISO/IEC 13818-1 Amendment + AVCDescriptorTag = 0x28, + SVCExtensionDescriptorTag = 0x30, + MVCExtensionDescriptorTag = 0x31, // defined by ETSI (EN 300 468) NetworkNameDescriptorTag = 0x40, ServiceListDescriptorTag = 0x41, @@ -134,6 +138,12 @@ enum DescriptorTag { DTSDescriptorTag = 0x7B, AACDescriptorTag = 0x7C, ExtensionDescriptorTag = 0x7F, + // defined by EICTA/EACEM/DIGITALEUROPE + LogicalChannelDescriptorTag = 0x83, + PreferredNameListDescriptorTag = 0x84, + PreferredNameIdentifierDescriptorTag = 0x85, + EacemStreamIdentifierDescriptorTag = 0x86, + HdSimulcastLogicalChannelDescriptorTag = 0x88, // Extension descriptors ImageIconDescriptorTag = 0x00, CpcmDeliverySignallingDescriptor = 0x01, @@ -147,6 +157,12 @@ enum DescriptorTag { TargetRegionDescriptorTag = 0x09, TargetRegionNameDescriptorTag = 0x0A, ServiceRelocatedDescriptorTag = 0x0B, + // defined by ETSI (EN 300 468) v 1.12.1 + XAITPidDescriptorTag = 0x0C, + C2DeliverySystemDescriptorTag = 0x0D, + // 0x0E - 0x0F Reserved + VideoDepthRangeDescriptorTag = 0x10, + T2MIDescriptorTag = 0x11, // Defined by ETSI TS 102 812 (MHP) // They once again start with 0x00 (see page 234, MHP specification) |