summaryrefslogtreecommitdiff
path: root/libsi
diff options
context:
space:
mode:
Diffstat (limited to 'libsi')
-rw-r--r--libsi/descriptor.c24
-rw-r--r--libsi/descriptor.h15
-rw-r--r--libsi/headers.h6
-rw-r--r--libsi/si.h8
4 files changed, 46 insertions, 7 deletions
diff --git a/libsi/descriptor.c b/libsi/descriptor.c
index 207b7c2..cc3a016 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.14 2004/10/16 09:51:05 kls Exp $
+ * $Id: descriptor.c 1.15 2005/09/03 15:16:49 kls Exp $
* *
***************************************************************************/
@@ -655,14 +655,32 @@ LinkageType LinkageDescriptor::getLinkageType() const {
}
void ISO639LanguageDescriptor::Parse() {
- unsigned int offset=0;
- data.setPointerAndOffset<const descr_iso_639_language>(s, offset);
+ languageLoop.setData(data+sizeof(descr_iso_639_language), getLength()-sizeof(descr_iso_639_language));
+
+ //all this is for backwards compatibility only
+ Loop::Iterator it;
+ Language first;
+ if (languageLoop.getNext(first, it)) {
+ languageCode[0]=first.languageCode[0];
+ languageCode[1]=first.languageCode[1];
+ languageCode[2]=first.languageCode[2];
+ languageCode[3]=0;
+ } else
+ languageCode[0]=0;
+}
+
+void ISO639LanguageDescriptor::Language::Parse() {
+ s=data.getData<const descr_iso_639_language_loop>();
languageCode[0]=s->lang_code1;
languageCode[1]=s->lang_code2;
languageCode[2]=s->lang_code3;
languageCode[3]=0;
}
+AudioType ISO639LanguageDescriptor::Language::getAudioType() {
+ return (AudioType)s->audio_type;
+}
+
void PDCDescriptor::Parse() {
unsigned int offset=0;
data.setPointerAndOffset<const descr_pdc>(s, offset);
diff --git a/libsi/descriptor.h b/libsi/descriptor.h
index 73fd105..476da3f 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.12 2005/05/08 14:08:19 kls Exp $
+ * $Id: descriptor.h 1.13 2005/09/03 15:17:35 kls Exp $
* *
***************************************************************************/
@@ -392,7 +392,18 @@ private:
class ISO639LanguageDescriptor : public Descriptor {
public:
- char languageCode[4];
+ char languageCode[4]; //for backwards compatibility
+ class Language : public LoopElement {
+ public:
+ virtual int getLength() { return sizeof(descr_iso_639_language_loop); }
+ char languageCode[4];
+ AudioType getAudioType();
+ protected:
+ virtual void Parse();
+ private:
+ const descr_iso_639_language_loop *s;
+ };
+ StructureLoop<Language> languageLoop;
protected:
virtual void Parse();
private:
diff --git a/libsi/headers.h b/libsi/headers.h
index ff3e0f9..69350cd 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.4 2004/02/22 11:12:46 kls Exp $
+ * $Id: headers.h 1.5 2005/09/03 15:18:16 kls Exp $
* *
***************************************************************************/
@@ -821,9 +821,13 @@ struct descr_ca {
struct descr_iso_639_language {
u_char descriptor_tag :8;
u_char descriptor_length :8;
+};
+
+struct descr_iso_639_language_loop {
u_char lang_code1 :8;
u_char lang_code2 :8;
u_char lang_code3 :8;
+ u_char audio_type :8;
};
/* 0x13 carousel_identifier_descriptor */
diff --git a/libsi/si.h b/libsi/si.h
index 8f89c34..3836b2f 100644
--- a/libsi/si.h
+++ b/libsi/si.h
@@ -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.11 2004/10/16 09:58:10 kls Exp $
+ * $Id: si.h 1.12 2005/09/03 15:19:00 kls Exp $
* *
***************************************************************************/
@@ -166,6 +166,12 @@ enum LinkageType { LinkageTypeInformationService = 0x01,
LinkageTypeTSContainingSsuBatOrNit = 0x0A
};
+enum AudioType { AudioTypeUndefined = 0x00,
+ AudioTypeCleanEffects = 0x01,
+ AudioTypeHearingImpaired = 0x02,
+ AudioTypeVisualImpairedCommentary = 0x03
+ };
+
/* Some principles:
- Objects that return references to other objects contained in their data must make sure
that the returned objects have been parsed.