summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2011-06-15 21:29:03 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2011-06-15 21:29:03 +0200
commitb2812b7e71b4b5ef038045f48a5697a4dd063192 (patch)
tree45c010b361471355f873974cb60960f64d7906d8
parent263dc295089a2accc385c87c23b177314d65acea (diff)
downloadvdr-b2812b7e71b4b5ef038045f48a5697a4dd063192.tar.gz
vdr-b2812b7e71b4b5ef038045f48a5697a4dd063192.tar.bz2
Added support for "content identifier descriptor" and "default authority descriptor" to 'libsi'
-rw-r--r--CONTRIBUTORS4
-rw-r--r--HISTORY4
-rw-r--r--libsi/descriptor.c29
-rw-r--r--libsi/descriptor.h27
-rw-r--r--libsi/headers.h20
-rw-r--r--libsi/si.c10
6 files changed, 87 insertions, 7 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 77ecaa32..b9cc3824 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -2722,3 +2722,7 @@ Marco Göbenich <mg@needful.de>
Johan Andersson <jna@jna.pp.se>
for reporting a bug in detecting frames in case the Picture Start Code or Access Unit
Delimiter extends over TS packet boundaries
+
+Dave Pickles <dave@pickles.me.uk>
+ for adding support for "content identifier descriptor" and "default authority
+ descriptor" to 'libsi'
diff --git a/HISTORY b/HISTORY
index e3b932d6..81458c5f 100644
--- a/HISTORY
+++ b/HISTORY
@@ -6607,7 +6607,7 @@ Video Disk Recorder Revision History
- Avoiding an unecessary call to Recordings.ResetResume() (thanks to Reinhard
Nissl).
-2011-06-13: Version 1.7.19
+2011-06-15: Version 1.7.19
- Fixed cString's operator=(const char *String) in case the given string is the
same as the existing one (thanks to Dirk Leber).
@@ -6647,3 +6647,5 @@ Video Disk Recorder Revision History
- The initial channel is now stored by the channel ID in the setup.conf file, in
order to avoid problems in case channels are reordered or deleted (reported by
Lars Bläser).
+- Added support for "content identifier descriptor" and "default authority descriptor"
+ to 'libsi' (thanks to Dave Pickles).
diff --git a/libsi/descriptor.c b/libsi/descriptor.c
index 59f636a3..06a58c0a 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.1 2010/11/01 15:24:31 kls Exp $
+ * $Id: descriptor.c 2.2 2011/06/15 21:26:00 kls Exp $
* *
***************************************************************************/
@@ -643,6 +643,33 @@ void ServiceIdentifierDescriptor::Parse() {
textualServiceIdentifier.setData(data+sizeof(descr_service_identifier), getLength()-sizeof(descr_service_identifier));
}
+void ContentIdentifierDescriptor::Parse() {
+ identifierLoop.setData(data+sizeof(descr_content_identifier), getLength()-sizeof(descr_content_identifier));
+}
+
+void ContentIdentifierDescriptor::Identifier::Parse() {
+ int offset=0;
+ data.setPointerAndOffset<const content_identifier_entry>(s, offset);
+ if (s->crid_location == 0) {
+ identifier.setData(data+(offset-1), s->crid_length);
+ }
+ else {
+ identifier.setData(data+(offset-1), 2);
+ }
+}
+
+int ContentIdentifierDescriptor::Identifier::getCridType() const {
+ return s->crid_type;
+}
+
+int ContentIdentifierDescriptor::Identifier::getCridLocation() const {
+ return s->crid_location;
+}
+
+void DefaultAuthorityDescriptor::Parse() {
+ DefaultAuthority.setData(data+sizeof(descr_default_authority), getLength()-sizeof(descr_default_authority));
+}
+
void MultilingualNameDescriptor::Parse() {
nameLoop.setData(data+sizeof(descr_multilingual_network_name), getLength()-sizeof(descr_multilingual_network_name));
}
diff --git a/libsi/descriptor.h b/libsi/descriptor.h
index 4f2e41b6..f105f7a0 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.1 2010/11/01 15:24:32 kls Exp $
+ * $Id: descriptor.h 2.2 2011/06/15 21:26:00 kls Exp $
* *
***************************************************************************/
@@ -361,6 +361,31 @@ protected:
virtual void Parse();
};
+class ContentIdentifierDescriptor : public Descriptor {
+public:
+ class Identifier : public LoopElement {
+ public:
+ String identifier;
+ int getCridType() const;
+ int getCridLocation() const;
+ virtual int getLength() { return sizeof(content_identifier_entry)+identifier.getLength(); }
+ protected:
+ virtual void Parse();
+ private:
+ const content_identifier_entry *s;
+ };
+ StructureLoop<Identifier> identifierLoop;
+protected:
+ virtual void Parse();
+};
+
+class DefaultAuthorityDescriptor : public Descriptor {
+public:
+ String DefaultAuthority; //ID
+protected:
+ virtual void Parse();
+};
+
//abstract base class
class MultilingualNameDescriptor : public Descriptor {
public:
diff --git a/libsi/headers.h b/libsi/headers.h
index 3ec35def..6867d2c9 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.1 2010/11/01 15:24:32 kls Exp $
+ * $Id: headers.h 2.2 2011/06/15 21:26:00 kls Exp $
* *
***************************************************************************/
@@ -1680,6 +1680,24 @@ struct descr_content_identifier {
u_char descriptor_length :8;
};
+struct content_identifier_entry {
+#if BYTE_ORDER == BIG_ENDIAN
+ u_char crid_type :6;
+ u_char crid_location :2;
+#else
+ u_char crid_location :2;
+ u_char crid_type :6;
+#endif
+ union {
+ u_char crid_length :8;
+ u_char crid_ref_hi :8;
+ };
+ union {
+ u_char crid_byte :8;
+ u_char crid_ref_lo :8;
+ };
+};
+
/* 0x77 time_slice_fec_identifier_descriptor (ETSI EN 301 192) */
struct descr_time_slice_fec_identifier {
diff --git a/libsi/si.c b/libsi/si.c
index 39911786..840b3a1f 100644
--- a/libsi/si.c
+++ b/libsi/si.c
@@ -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.3 2010/11/01 15:24:32 kls Exp $
+ * $Id: si.c 2.4 2011/06/15 21:26:00 kls Exp $
* *
***************************************************************************/
@@ -609,6 +609,12 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain,
case RegistrationDescriptorTag:
d=new RegistrationDescriptor();
break;
+ case ContentIdentifierDescriptorTag:
+ d=new ContentIdentifierDescriptor();
+ break;
+ case DefaultAuthorityDescriptorTag:
+ d=new DefaultAuthorityDescriptor();
+ break;
//note that it is no problem to implement one
//of the unimplemented descriptors.
@@ -650,10 +656,8 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain,
case TransportStreamDescriptorTag:
//defined in ETSI EN 300 468 v 1.7.1
- case DefaultAuthorityDescriptorTag:
case RelatedContentDescriptorTag:
case TVAIdDescriptorTag:
- case ContentIdentifierDescriptorTag:
case TimeSliceFecIdentifierDescriptorTag:
case ECMRepetitionRateDescriptorTag:
case EnhancedAC3DescriptorTag: