Added LinkageDescriptor handling to 'libsi'

This commit is contained in:
Klaus Schmidinger 2004-01-12 22:19:34 +01:00
parent 89ecc6b452
commit 2a11c183b5
5 changed files with 57 additions and 9 deletions

View File

@ -2572,7 +2572,8 @@ Video Disk Recorder Revision History
branches are tested, cable and terrestrial need to be tested by somebody who
actually has such equipment.
2004-01-11: Version 1.3.2
2004-01-12: Version 1.3.2
- Fixed resetting the EPG data versions after changing the preferred languages
(thanks to Teemu Rantanen for reporting this one and helping to debug it).
- Added LinkageDescriptor handling to 'libsi' (thanks to Marcel Wiesweg).

View File

@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: descriptor.c 1.2 2003/12/13 10:42:05 kls Exp $
* $Id: descriptor.c 1.3 2004/01/12 16:17:20 kls Exp $
* *
***************************************************************************/
@ -492,6 +492,28 @@ void MultilingualServiceNameDescriptor::Name::Parse() {
name.setData(data+offset, mid->service_name_length);
}
void LinkageDescriptor::Parse() {
unsigned int offset=0;
data.setPointerAndOffset<const descr_linkage>(s, offset);
privateData.assign(data.getData(offset), getLength()-offset);
}
int LinkageDescriptor::getTransportStreamId() const {
return HILO(s->transport_stream_id);
}
int LinkageDescriptor::getOriginalNetworkId() const {
return HILO(s->original_network_id);
}
int LinkageDescriptor::getServiceId() const {
return HILO(s->service_id);
}
LinkageType LinkageDescriptor::getLinkageType() const {
return (LinkageType)s->linkage_type;
}
void ApplicationSignallingDescriptor::Parse() {
entryLoop.setData(data+sizeof(descr_application_signalling), getLength()-sizeof(descr_application_signalling));
}

View File

@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: descriptor.h 1.2 2003/12/13 10:42:08 kls Exp $
* $Id: descriptor.h 1.3 2004/01/12 16:17:47 kls Exp $
* *
***************************************************************************/
@ -361,6 +361,19 @@ protected:
virtual void Parse();
};
class LinkageDescriptor : public Descriptor {
public:
int getTransportStreamId() const;
int getOriginalNetworkId() const;
int getServiceId() const;
LinkageType getLinkageType() const;
CharArray privateData;
protected:
virtual void Parse();
private:
const descr_linkage *s;
};
//a descriptor currently unimplemented in this library
class UnimplementedDescriptor : public Descriptor {
protected:

View File

@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: si.c 1.4 2004/01/05 11:04:17 kls Exp $
* $Id: si.c 1.5 2004/01/12 22:19:34 kls Exp $
* *
***************************************************************************/
@ -320,6 +320,9 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain)
case ApplicationSignallingDescriptorTag:
d=new ApplicationSignallingDescriptor();
break;
case LinkageDescriptorTag:
d=new LinkageDescriptor();
break;
//note that it is no problem to implement one
//of the unimplemented descriptors.
@ -348,7 +351,6 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain)
case VBITeletextDescriptorTag:
case CountryAvailabilityDescriptorTag:
case MocaicDescriptorTag:
case LinkageDescriptorTag:
case TeletextDescriptorTag:
case TelephoneDescriptorTag:
case LocalTimeOffsetDescriptorTag:

View File

@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: si.h 1.5 2004/01/09 15:59:53 kls Exp $
* $Id: si.h 1.6 2004/01/12 16:19:11 kls Exp $
* *
***************************************************************************/
@ -154,6 +154,18 @@ enum RunningStatus { RunningStatusUndefined = 0,
RunningStatusRunning = 4
};
enum LinkageType { LinkageTypeInformationService = 0x01,
LinkageTypeEPGService = 0x02,
LinkageTypeCaReplacementService = 0x03,
LinkageTypeTSContainingCompleteNetworkBouquetSi = 0x04,
LinkageTypeServiceReplacementService = 0x05,
LinkageTypeDataBroadcastService = 0x06,
LinkageTypeRCSMap = 0x07,
LinkageTypeMobileHandover = 0x08,
LinkageTypeSystemSoftwareUpdateService = 0x09,
LinkageTypeTSContainingSsuBatOrNit = 0x0A
};
/* Some principles:
- Objects that return references to other objects contained in their data must make sure
that the returned objects have been parsed.
@ -167,6 +179,7 @@ public:
Object(CharArray &d);
//can only be called once since data is immutable
void setData(const unsigned char*data, unsigned int size, bool doCopy=true);
CharArray getData() { return data; }
virtual int getLength() = 0;
protected:
CharArray data;
@ -224,9 +237,6 @@ private:
class LoopElement : public Object {
};
class SubStructure : public LoopElement {
};
class Descriptor : public LoopElement {
public:
virtual int getLength();