summaryrefslogtreecommitdiff
path: root/libsi
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-02-22 13:08:04 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-02-22 13:08:04 +0100
commit45eac6d94694aa9081bdd0e06794942c49818ff1 (patch)
treeaade606ef3dd0698faabcc7a2eacef1134b85771 /libsi
parent1601918327b72a75b5e5e81405c725ae923f7515 (diff)
downloadvdr-45eac6d94694aa9081bdd0e06794942c49818ff1.tar.gz
vdr-45eac6d94694aa9081bdd0e06794942c49818ff1.tar.bz2
Added PDCDescriptor handling to 'libsi'
Diffstat (limited to 'libsi')
-rw-r--r--libsi/descriptor.c23
-rw-r--r--libsi/descriptor.h14
-rw-r--r--libsi/headers.h14
-rw-r--r--libsi/si.c6
4 files changed, 50 insertions, 7 deletions
diff --git a/libsi/descriptor.c b/libsi/descriptor.c
index 55a6a9c0..0b0019f8 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 1.5 2004/01/24 14:52:41 kls Exp $
+ * $Id: descriptor.c 1.6 2004/02/22 11:11:36 kls Exp $
* *
***************************************************************************/
@@ -529,6 +529,27 @@ void ISO639LanguageDescriptor::Parse() {
languageCode[3]=0;
}
+void PDCDescriptor::Parse() {
+ unsigned int offset=0;
+ data.setPointerAndOffset<const descr_pdc>(s, offset);
+}
+
+int PDCDescriptor::getDay() const {
+ return ((s->pil0 & 0x0F) << 1) | ((s->pil1 & 0x80) >> 7);
+}
+
+int PDCDescriptor::getMonth() const {
+ return (s->pil1 >> 3) & 0x0F;
+}
+
+int PDCDescriptor::getHour() const {
+ return ((s->pil1 & 0x07) << 2) | ((s->pil2 & 0xC0) >> 6);
+}
+
+int PDCDescriptor::getMinute() const {
+ return s->pil2 & 0x3F;
+}
+
void ApplicationSignallingDescriptor::Parse() {
entryLoop.setData(data+sizeof(descr_application_signalling), getLength()-sizeof(descr_application_signalling));
}
diff --git a/libsi/descriptor.h b/libsi/descriptor.h
index 5541cc41..17c81eb0 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 1.5 2004/01/24 14:52:05 kls Exp $
+ * $Id: descriptor.h 1.6 2004/02/22 10:16:47 kls Exp $
* *
***************************************************************************/
@@ -383,6 +383,18 @@ private:
const descr_iso_639_language *s;
};
+class PDCDescriptor : public Descriptor {
+public:
+ int getDay() const;
+ int getMonth() const;
+ int getHour() const;
+ int getMinute() const;
+protected:
+ virtual void Parse();
+private:
+ const descr_pdc *s;
+};
+
//a descriptor currently unimplemented in this library
class UnimplementedDescriptor : public Descriptor {
protected:
diff --git a/libsi/headers.h b/libsi/headers.h
index 26fdb27c..ff3e0f95 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 1.3 2004/02/20 13:49:16 kls Exp $
+ * $Id: headers.h 1.4 2004/02/22 11:12:46 kls Exp $
* *
***************************************************************************/
@@ -1457,11 +1457,19 @@ struct descr_dsng {
/* 0x69 pdc_descriptor */
-#define DESCR_PDC_LEN XX
+#define DESCR_PDC_LEN 5
struct descr_pdc {
u_char descriptor_tag :8;
u_char descriptor_length :8;
- /* TBD */
+#if BYTE_ORDER == BIG_ENDIAN
+ u_char pil2 :8;
+ u_char pil1 :8;
+ u_char pil0 :8;
+#else
+ u_char pil0 :8;
+ u_char pil1 :8;
+ u_char pil2 :8;
+#endif
};
/* 0x6A ac3_descriptor */
diff --git a/libsi/si.c b/libsi/si.c
index b952fb51..ee648020 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 1.7 2004/02/20 13:46:12 kls Exp $
+ * $Id: si.c 1.8 2004/02/22 10:14:12 kls Exp $
* *
***************************************************************************/
@@ -334,6 +334,9 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain)
case ISO639LanguageDescriptorTag:
d=new ISO639LanguageDescriptor();
break;
+ case PDCDescriptorTag:
+ d=new PDCDescriptor();
+ break;
//note that it is no problem to implement one
//of the unimplemented descriptors.
@@ -375,7 +378,6 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain)
case CaSystemDescriptorTag:
case AC3DescriptorTag:
case DSNGDescriptorTag:
- case PDCDescriptorTag:
case AncillaryDataDescriptorTag:
case AnnouncementSupportDescriptorTag:
case AdaptationFieldDataDescriptorTag: